Skip to contentSkip to conversation

PATCH: SEED cipher support

DISCUSSION Hye-Shik Chang 3 participants 6 messages Aug 12, 2007 – Aug 21, 2007 Crypto API

lore
Share & tools
lore
#0 lore raw

Hello,

Here I propose a patch for linux crypto API to add a support SEED (RFC4269). This patch was generated against git-HEAD as of today. This patch have been used in few VPN appliance vendors in Korea for several years. And it was verified by KISA, who developed the algorithm itself.

As its importance in Korean banking industry, it would be great if linux incorporates the support.

Thanks,
Hye-Shik

#1 lore raw

Hi.

Quoted 10 lines · Hye-Shik Chang

Hello,

Here I propose a patch for linux crypto API to add a support SEED (RFC4269). This patch was generated against git-HEAD as of today. This patch have been used in few VPN appliance vendors in Korea for several years. And it was verified by KISA, who developed the algorithm itself.

As its importance in Korean banking industry, it would be great if linux incorporates the support.

Besides the only c++ comment in the tcrypt.c this patch looks really good. This is a good submission.
As a side note: please do not send gzipped patches, since it is quite hard to show where the problem in the patch is if any when replying.

Signature · 1 line
	Evgeniy Polyakov
maintainer
#3 lore raw
In reply to Hye-Shik Chang
Quoted 10 lines · Hye-Shik Chang

Hello,

Here I propose a patch for linux crypto API to add a support SEED (RFC4269). This patch was generated against git-HEAD as of today. This patch have been used in few VPN appliance vendors in Korea for several years. And it was verified by KISA, who developed the algorithm itself.

As its importance in Korean banking industry, it would be great if linux incorporates the support.

Thanks for the patch! Could you please add a Signed-off-by and I'll merge it in.

Cheers,

Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
maintainer
#2 lore raw
In reply to Evgeniy Polyakov
Quoted 2 lines · Evgeniy Polyakov

Besides the only c++ comment in the tcrypt.c this patch

Those C++ comments are a pre-existing wart :)

I'll make sure that they get killed.

Cheers,

Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
#4 lore raw
In reply to Herbert Xu
Quoted 9 lines · Herbert Xu
Quoted 8 lines · Hye-Shik Chang

Hello,

Here I propose a patch for linux crypto API to add a support SEED (RFC4269). This patch was generated against git-HEAD as of today. This patch have been used in few VPN appliance vendors in Korea for several years. And it was verified by KISA, who developed the algorithm itself.

Quoted 6 lines
Quoted 2 lines

As its importance in Korean banking industry, it would be great if linux incorporates the support.

Thanks for the patch! Could you please add a Signed-off-by and I'll merge it in.

Thank you for the review!

I have changed the copyright and MODULE_AUTHOR lines by a request of KISA in the following new patch. Please apply it instead.

crypto/Kconfig +14 -0
index ec8369c..981497c 100644
@@ -412,6 +412,20 @@ config CRYPTO_ANUBIS
 	  <https://www.cosic.esat.kuleuven.ac.be/nessie/reports/>
 	  <http://planeta.terra.com.br/informatica/paulobarreto/AnubisPage.html>
 
+config CRYPTO_SEED
+	tristate "SEED cipher algorithm"
+	select CRYPTO_ALGAPI
+	help
+	  SEED cipher algorithm (RFC4269).
+
+	  SEED is a 128-bit symmetric key block cipher that has been
+	  developed by KISA (Korea Information Security Agency) as a
+	  national standard encryption algorithm of the Republic of Korea.
+	  It is a 16 round block cipher with the key size of 128 bit.
+
+	  See also:
+	  <http://www.kisa.or.kr/kisa/seed/jsp/seed_eng.jsp>
+
 
 config CRYPTO_DEFLATE
 	tristate "Deflate compression algorithm"
crypto/Makefile +1 -0
index 0cf17f1..a070dcc 100644
@@ -45,6 +45,7 @@ obj-$(CONFIG_CRYPTO_ARC4) += arc4.o
 obj-$(CONFIG_CRYPTO_TEA) += tea.o
 obj-$(CONFIG_CRYPTO_KHAZAD) += khazad.o
 obj-$(CONFIG_CRYPTO_ANUBIS) += anubis.o
+obj-$(CONFIG_CRYPTO_SEED) += seed.o
 obj-$(CONFIG_CRYPTO_DEFLATE) += deflate.o
 obj-$(CONFIG_CRYPTO_MICHAEL_MIC) += michael_mic.o
 obj-$(CONFIG_CRYPTO_CRC32C) += crc32c.o
crypto/seed.c new file +479 -0

479 lines not on this page · raw message

crypto/tcrypt.c +7 -1
index 11f9359..de6435e 100644
@@ -78,7 +78,7 @@ static char *check[] = {
 	"twofish", "serpent", "sha384", "sha512", "md4", "aes", "cast6",
 	"arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea",
 	"khazad", "wp512", "wp384", "wp256", "tnepres", "xeta",  "fcrypt",
-	"camellia", NULL
+	"camellia", "seed", NULL
 };
 
 static void hexdump(unsigned char *buf, unsigned int len)
@@ -1029,6 +1029,12 @@ static void do_test(void)
 			    camellia_cbc_dec_tv_template,
 			    CAMELLIA_CBC_DEC_TEST_VECTORS);
 
+		//SEED
+		test_cipher("ecb(seed)", ENCRYPT, seed_enc_tv_template,
+			    SEED_ENC_TEST_VECTORS);
+		test_cipher("ecb(seed)", DECRYPT, seed_dec_tv_template,
+			    SEED_DEC_TEST_VECTORS);
+
 		test_hash("sha384", sha384_tv_template, SHA384_TEST_VECTORS);
 		test_hash("sha512", sha512_tv_template, SHA512_TEST_VECTORS);
 		test_hash("wp512", wp512_tv_template, WP512_TEST_VECTORS);
crypto/tcrypt.h +90 -0

96 lines not on this page · raw message

maintainer
#5 lore raw
Quoted 5 lines · Hye-Shik Chang

I have changed the copyright and MODULE_AUTHOR lines by a request of KISA in the following new patch. Please apply it instead.

Patch applied. Thanks a lot!

Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt