Hi James.
I have cleaned up the testing module.
A complete rewrite.
Code is reduced by almost 1900+ lines in tcrypt.c.
I have compiled and test it on my machine.
The kernel size is reduced by 5 Kb.
I am including the patch for testing as an attachment.
It provides uniform interface for adding new tests.
Anyway, I think, now you won't call it a dirty module.
I expect changes in the comments at the beginning of source files.
Any suggestions are welcome.
-Kartikey Mahendra Bhatt
_________________________________________________________________
Talk to Karthikeyan. Watch his stunning feats.
http://server1.msn.co.in/sp03/tataracing/index.asp Download images.
On Mon, Sep 15, 2003 at 12:30:10AM +0530, kartikey bhatt wrote:
> Hi James.
>
> I have cleaned up the testing module.
> A complete rewrite.
> Code is reduced by almost 1900+ lines in tcrypt.c.
> I have compiled and test it on my machine.
> The kernel size is reduced by 5 Kb.
> I am including the patch for testing as an attachment.
> It provides uniform interface for adding new tests.
> Anyway, I think, now you won't call it a dirty module.
> I expect changes in the comments at the beginning of source files.
> Any suggestions are welcome.
>
> -Kartikey Mahendra Bhatt
It's generally preferred to post patches in the body of your messages
rather than as an attachment. The attachment you posted also appears
to be empty.
--
Matt Mackall : http://www.selenic.com : of or relating to the moon
patch is too long.
that's why i'm not including it in mail body.
if it's empty, any way i'm resending it.
thanks for comment.
-Kartikey Mahendra Bhatt
>From: Matt Mackall <[email protected]>
>To: kartikey bhatt <[email protected]>
>CC: [email protected], [email protected]
>Subject: Re: [CRYPTO] Testing Module Cleanup.
>Date: Sun, 14 Sep 2003 22:16:43 -0500
>
>On Mon, Sep 15, 2003 at 12:30:10AM +0530, kartikey bhatt wrote:
> > Hi James.
> >
> > I have cleaned up the testing module.
> > A complete rewrite.
> > Code is reduced by almost 1900+ lines in tcrypt.c.
> > I have compiled and test it on my machine.
> > The kernel size is reduced by 5 Kb.
> > I am including the patch for testing as an attachment.
> > It provides uniform interface for adding new tests.
> > Anyway, I think, now you won't call it a dirty module.
> > I expect changes in the comments at the beginning of source files.
> > Any suggestions are welcome.
> >
> > -Kartikey Mahendra Bhatt
>
>It's generally preferred to post patches in the body of your messages
>rather than as an attachment. The attachment you posted also appears
>to be empty.
>
>--
>Matt Mackall : http://www.selenic.com : of or relating to the moon
_________________________________________________________________
Talk to Karthikeyan. Watch his stunning feats.
http://server1.msn.co.in/sp03/tataracing/index.asp Download images.
patch is too long.
that's why i'm sending it as an attachment.
anyway if it's empty , i'm resending it.
thanks for comments.
-Kartikey Mahendra Bhatt
>From: Matt Mackall <[email protected]>
>To: kartikey bhatt <[email protected]>
>CC: [email protected], [email protected]
>Subject: Re: [CRYPTO] Testing Module Cleanup.
>Date: Sun, 14 Sep 2003 22:16:43 -0500
>
>On Mon, Sep 15, 2003 at 12:30:10AM +0530, kartikey bhatt wrote:
> > Hi James.
> >
> > I have cleaned up the testing module.
> > A complete rewrite.
> > Code is reduced by almost 1900+ lines in tcrypt.c.
> > I have compiled and test it on my machine.
> > The kernel size is reduced by 5 Kb.
> > I am including the patch for testing as an attachment.
> > It provides uniform interface for adding new tests.
> > Anyway, I think, now you won't call it a dirty module.
> > I expect changes in the comments at the beginning of source files.
> > Any suggestions are welcome.
> >
> > -Kartikey Mahendra Bhatt
>
>It's generally preferred to post patches in the body of your messages
>rather than as an attachment. The attachment you posted also appears
>to be empty.
>
>--
>Matt Mackall : http://www.selenic.com : of or relating to the moon
_________________________________________________________________
The hottest things. The coolest deals. http://www.msn.co.in/Shopping/ Get
them online!
On 09/15/03 00:30, kartikey bhatt wrote:
> I have cleaned up the testing module.
> A complete rewrite.
> Any suggestions are welcome.
What about removing some magic numbers to make it a little more
readable?
Regards
Erlend Aasland
--- linux-2.6.0-test5-dirty/crypto/tcrypt.c 2003-09-15 21:36:30.000000000 +0200
+++ linux-2.6.0-test5-dirty/crypto/tcrypt.c~ 2003-09-15 21:35:21.000000000 +0200
@@ -43,6 +43,14 @@
#define IDX7 27333
#define IDX8 3000
+/*
+ * Used by test_cipher()
+ */
+#define ENCRYPT 1
+#define DECRYPT 0
+#define MODE_ECB 1
+#define MODE_CBC 0
+
static unsigned int IDX[8] = { IDX1, IDX2, IDX3, IDX4, IDX5, IDX6, IDX7, IDX8 };
static int mode;
@@ -251,10 +259,16 @@
char *key;
struct cipher_testvec *cipher_tv;
struct scatterlist sg[8];
- char *e, *m;
+ char e[11], m[4];
- e = enc ? "encryption" : "decryption";
- m = mode ? "ECB" : "CBC";
+ if (enc == ENCRYPT)
+ strncpy(e, "encryption", 11);
+ else
+ strncpy(e, "decryption", 11);
+ if (mode == MODE_ECB)
+ strncpy(m, "ECB", 4);
+ else
+ strncpy(m, "CBC", 4);
printk("\ntesting %s %s %s \n", algo, m, e);
@@ -497,46 +511,46 @@
test_hash("sha1", sha1_tv_template, SHA1_TEST_VECTORS);
//DES
- test_cipher ("des", 1, 1, des_enc_tv_template, DES_ENC_TEST_VECTORS);
- test_cipher ("des", 1, 0, des_dec_tv_template, DES_DEC_TEST_VECTORS);
- test_cipher ("des", 0, 1, des_cbc_enc_tv_template, DES_CBC_ENC_TEST_VECTORS);
- test_cipher ("des", 0, 0, des_cbc_dec_tv_template, DES_CBC_DEC_TEST_VECTORS);
+ test_cipher ("des", MODE_ECB, ENCRYPT, des_enc_tv_template, DES_ENC_TEST_VECTORS);
+ test_cipher ("des", MODE_ECB, DECRYPT, des_dec_tv_template, DES_DEC_TEST_VECTORS);
+ test_cipher ("des", MODE_CBC, ENCRYPT, des_cbc_enc_tv_template, DES_CBC_ENC_TEST_VECTORS);
+ test_cipher ("des", MODE_CBC, DECRYPT, des_cbc_dec_tv_template, DES_CBC_DEC_TEST_VECTORS);
//DES3_EDE
- test_cipher ("des3_ede", 1, 1, des3_ede_enc_tv_template, DES3_EDE_ENC_TEST_VECTORS);
- test_cipher ("des3_ede", 1, 0, des3_ede_dec_tv_template, DES3_EDE_DEC_TEST_VECTORS);
+ test_cipher ("des3_ede", MODE_ECB, ENCRYPT, des3_ede_enc_tv_template, DES3_EDE_ENC_TEST_VECTORS);
+ test_cipher ("des3_ede", MODE_ECB, DECRYPT, des3_ede_dec_tv_template, DES3_EDE_DEC_TEST_VECTORS);
test_hash("md4", md4_tv_template, MD4_TEST_VECTORS);
test_hash("sha256", sha256_tv_template, SHA256_TEST_VECTORS);
//BLOWFISH
- test_cipher ("blowfish", 1, 1, bf_enc_tv_template, BF_ENC_TEST_VECTORS);
- test_cipher ("blowfish", 1, 0, bf_dec_tv_template, BF_DEC_TEST_VECTORS);
- test_cipher ("blowfish", 0, 1, bf_cbc_enc_tv_template, BF_CBC_ENC_TEST_VECTORS);
- test_cipher ("blowfish", 0, 0, bf_cbc_dec_tv_template, BF_CBC_DEC_TEST_VECTORS);
+ test_cipher ("blowfish", MODE_ECB, ENCRYPT, bf_enc_tv_template, BF_ENC_TEST_VECTORS);
+ test_cipher ("blowfish", MODE_ECB, DECRYPT, bf_dec_tv_template, BF_DEC_TEST_VECTORS);
+ test_cipher ("blowfish", MODE_CBC, ENCRYPT, bf_cbc_enc_tv_template, BF_CBC_ENC_TEST_VECTORS);
+ test_cipher ("blowfish", MODE_CBC, DECRYPT, bf_cbc_dec_tv_template, BF_CBC_DEC_TEST_VECTORS);
//TWOFISH
- test_cipher ("twofish", 1, 1, tf_enc_tv_template, TF_ENC_TEST_VECTORS);
- test_cipher ("twofish", 1, 0, tf_dec_tv_template, TF_DEC_TEST_VECTORS);
- test_cipher ("twofish", 0, 1, tf_cbc_enc_tv_template, TF_CBC_ENC_TEST_VECTORS);
- test_cipher ("twofish", 0, 0, tf_cbc_dec_tv_template, TF_CBC_DEC_TEST_VECTORS);
+ test_cipher ("twofish", MODE_ECB, ENCRYPT, tf_enc_tv_template, TF_ENC_TEST_VECTORS);
+ test_cipher ("twofish", MODE_ECB, DECRYPT, tf_dec_tv_template, TF_DEC_TEST_VECTORS);
+ test_cipher ("twofish", MODE_CBC, ENCRYPT, tf_cbc_enc_tv_template, TF_CBC_ENC_TEST_VECTORS);
+ test_cipher ("twofish", MODE_CBC, DECRYPT, tf_cbc_dec_tv_template, TF_CBC_DEC_TEST_VECTORS);
//SERPENT
- test_cipher ("serpent", 1, 1, serpent_enc_tv_template, SERPENT_ENC_TEST_VECTORS);
- test_cipher ("serpent", 1, 0, serpent_dec_tv_template, SERPENT_DEC_TEST_VECTORS);
+ test_cipher ("serpent", MODE_ECB, ENCRYPT, serpent_enc_tv_template, SERPENT_ENC_TEST_VECTORS);
+ test_cipher ("serpent", MODE_ECB, DECRYPT, serpent_dec_tv_template, SERPENT_DEC_TEST_VECTORS);
//AES
- test_cipher ("aes", 1, 1, aes_enc_tv_template, AES_ENC_TEST_VECTORS);
- test_cipher ("aes", 1, 0, aes_dec_tv_template, AES_DEC_TEST_VECTORS);
+ test_cipher ("aes", MODE_ECB, ENCRYPT, aes_enc_tv_template, AES_ENC_TEST_VECTORS);
+ test_cipher ("aes", MODE_ECB, DECRYPT, aes_dec_tv_template, AES_DEC_TEST_VECTORS);
//CAST5
- test_cipher ("cast5", 1, 1, cast5_enc_tv_template, CAST5_ENC_TEST_VECTORS);
- test_cipher ("cast5", 1, 0, cast5_dec_tv_template, CAST5_DEC_TEST_VECTORS);
+ test_cipher ("cast5", MODE_ECB, ENCRYPT, cast5_enc_tv_template, CAST5_ENC_TEST_VECTORS);
+ test_cipher ("cast5", MODE_ECB, DECRYPT, cast5_dec_tv_template, CAST5_DEC_TEST_VECTORS);
//CAST6
- test_cipher ("cast6", 1, 1, cast6_enc_tv_template, CAST6_ENC_TEST_VECTORS);
- test_cipher ("cast6", 1, 0, cast6_dec_tv_template, CAST6_DEC_TEST_VECTORS);
+ test_cipher ("cast6", MODE_ECB, ENCRYPT, cast6_enc_tv_template, CAST6_ENC_TEST_VECTORS);
+ test_cipher ("cast6", MODE_ECB, DECRYPT, cast6_dec_tv_template, CAST6_DEC_TEST_VECTORS);
test_hash("sha384", sha384_tv_template, SHA384_TEST_VECTORS);
test_hash("sha512", sha512_tv_template, SHA512_TEST_VECTORS);
@@ -557,15 +571,15 @@
break;
case 3:
- test_cipher ("des", 1, 1, des_enc_tv_template, DES_ENC_TEST_VECTORS);
- test_cipher ("des", 1, 0, des_dec_tv_template, DES_DEC_TEST_VECTORS);
- test_cipher ("des", 0, 1, des_cbc_enc_tv_template, DES_CBC_ENC_TEST_VECTORS);
- test_cipher ("des", 0, 0, des_cbc_dec_tv_template, DES_CBC_DEC_TEST_VECTORS);
+ test_cipher ("des", MODE_ECB, ENCRYPT, des_enc_tv_template, DES_ENC_TEST_VECTORS);
+ test_cipher ("des", MODE_ECB, DECRYPT, des_dec_tv_template, DES_DEC_TEST_VECTORS);
+ test_cipher ("des", MODE_CBC, ENCRYPT, des_cbc_enc_tv_template, DES_CBC_ENC_TEST_VECTORS);
+ test_cipher ("des", MODE_CBC, DECRYPT, des_cbc_dec_tv_template, DES_CBC_DEC_TEST_VECTORS);
break;
case 4:
- test_cipher ("des3_ede", 1, 1, des3_ede_enc_tv_template, DES3_EDE_ENC_TEST_VECTORS);
- test_cipher ("des3_ede", 1, 0, des3_ede_dec_tv_template, DES3_EDE_DEC_TEST_VECTORS);
+ test_cipher ("des3_ede", MODE_ECB, ENCRYPT, des3_ede_enc_tv_template, DES3_EDE_ENC_TEST_VECTORS);
+ test_cipher ("des3_ede", MODE_ECB, DECRYPT, des3_ede_dec_tv_template, DES3_EDE_DEC_TEST_VECTORS);
break;
case 5:
@@ -577,28 +591,28 @@
break;
case 7:
- test_cipher ("blowfish", 1, 1, bf_enc_tv_template, BF_ENC_TEST_VECTORS);
- test_cipher ("blowfish", 1, 0, bf_dec_tv_template, BF_DEC_TEST_VECTORS);
- test_cipher ("blowfish", 0, 1, bf_cbc_enc_tv_template, BF_CBC_ENC_TEST_VECTORS);
- test_cipher ("blowfish", 0, 0, bf_cbc_dec_tv_template, BF_CBC_DEC_TEST_VECTORS);
+ test_cipher ("blowfish", MODE_ECB, ENCRYPT, bf_enc_tv_template, BF_ENC_TEST_VECTORS);
+ test_cipher ("blowfish", MODE_ECB, DECRYPT, bf_dec_tv_template, BF_DEC_TEST_VECTORS);
+ test_cipher ("blowfish", MODE_CBC, ENCRYPT, bf_cbc_enc_tv_template, BF_CBC_ENC_TEST_VECTORS);
+ test_cipher ("blowfish", MODE_CBC, DECRYPT, bf_cbc_dec_tv_template, BF_CBC_DEC_TEST_VECTORS);
break;
case 8:
- test_cipher ("twofish", 1, 1, tf_enc_tv_template, TF_ENC_TEST_VECTORS);
- test_cipher ("twofish", 1, 0, tf_dec_tv_template, TF_DEC_TEST_VECTORS);
- test_cipher ("twofish", 0, 1, tf_cbc_enc_tv_template, TF_CBC_ENC_TEST_VECTORS);
- test_cipher ("twofish", 0, 0, tf_cbc_dec_tv_template, TF_CBC_DEC_TEST_VECTORS);
+ test_cipher ("twofish", MODE_ECB, ENCRYPT, tf_enc_tv_template, TF_ENC_TEST_VECTORS);
+ test_cipher ("twofish", MODE_ECB, DECRYPT, tf_dec_tv_template, TF_DEC_TEST_VECTORS);
+ test_cipher ("twofish", MODE_CBC, ENCRYPT, tf_cbc_enc_tv_template, TF_CBC_ENC_TEST_VECTORS);
+ test_cipher ("twofish", MODE_CBC, DECRYPT, tf_cbc_dec_tv_template, TF_CBC_DEC_TEST_VECTORS);
break;
case 9:
- test_cipher ("serpent", 1, 1, serpent_enc_tv_template, SERPENT_ENC_TEST_VECTORS);
- test_cipher ("serpent", 1, 0, serpent_dec_tv_template, SERPENT_DEC_TEST_VECTORS);
+ test_cipher ("serpent", MODE_ECB, ENCRYPT, serpent_enc_tv_template, SERPENT_ENC_TEST_VECTORS);
+ test_cipher ("serpent", MODE_ECB, DECRYPT, serpent_dec_tv_template, SERPENT_DEC_TEST_VECTORS);
break;
case 10:
- test_cipher ("aes", 1, 1, aes_enc_tv_template, AES_ENC_TEST_VECTORS);
- test_cipher ("aes", 1, 0, aes_dec_tv_template, AES_DEC_TEST_VECTORS);
+ test_cipher ("aes", MODE_ECB, ENCRYPT, aes_enc_tv_template, AES_ENC_TEST_VECTORS);
+ test_cipher ("aes", MODE_ECB, DECRYPT, aes_dec_tv_template, AES_DEC_TEST_VECTORS);
break;
case 11:
@@ -614,13 +628,13 @@
break;
case 14:
- test_cipher ("cast5", 1, 1, cast5_enc_tv_template, CAST5_ENC_TEST_VECTORS);
- test_cipher ("cast5", 1, 0, cast5_dec_tv_template, CAST5_DEC_TEST_VECTORS);
+ test_cipher ("cast5", MODE_ECB, ENCRYPT, cast5_enc_tv_template, CAST5_ENC_TEST_VECTORS);
+ test_cipher ("cast5", MODE_ECB, DECRYPT, cast5_dec_tv_template, CAST5_DEC_TEST_VECTORS);
break;
case 15:
- test_cipher ("cast6", 1, 1, cast6_enc_tv_template, CAST6_ENC_TEST_VECTORS);
- test_cipher ("cast6", 1, 0, cast6_dec_tv_template, CAST6_DEC_TEST_VECTORS);
+ test_cipher ("cast6", MODE_ECB, ENCRYPT, cast6_enc_tv_template, CAST6_ENC_TEST_VECTORS);
+ test_cipher ("cast6", MODE_ECB, DECRYPT, cast6_dec_tv_template, CAST6_DEC_TEST_VECTORS);
break;
#ifdef CONFIG_CRYPTO_HMAC
anyway you have modified it.
thanks for improving code.
-Kartikey Mahendra Bhatt
>From: Erlend Aasland <[email protected]>
>To: kartikey bhatt <[email protected]>
>CC: [email protected], [email protected]
>Subject: Re: [CRYPTO] Testing Module Cleanup.
>Date: Mon, 15 Sep 2003 15:43:34 +0200
>
>On 09/15/03 00:30, kartikey bhatt wrote:
> > I have cleaned up the testing module.
> > A complete rewrite.
> > Any suggestions are welcome.
>
>What about removing some magic numbers to make it a little more
>readable?
>
>
>Regards
> Erlend Aasland
>
>--- linux-2.6.0-test5-dirty/crypto/tcrypt.c 2003-09-15 21:36:30.000000000
>+0200
>+++ linux-2.6.0-test5-dirty/crypto/tcrypt.c~ 2003-09-15 21:35:21.000000000
>+0200
>@@ -43,6 +43,14 @@
> #define IDX7 27333
> #define IDX8 3000
>
>+/*
>+ * Used by test_cipher()
>+ */
>+#define ENCRYPT 1
>+#define DECRYPT 0
>+#define MODE_ECB 1
>+#define MODE_CBC 0
>+
> static unsigned int IDX[8] = { IDX1, IDX2, IDX3, IDX4, IDX5, IDX6, IDX7,
>IDX8 };
>
> static int mode;
>@@ -251,10 +259,16 @@
> char *key;
> struct cipher_testvec *cipher_tv;
> struct scatterlist sg[8];
>- char *e, *m;
>+ char e[11], m[4];
>
>- e = enc ? "encryption" : "decryption";
>- m = mode ? "ECB" : "CBC";
>+ if (enc == ENCRYPT)
>+ strncpy(e, "encryption", 11);
>+ else
>+ strncpy(e, "decryption", 11);
>+ if (mode == MODE_ECB)
>+ strncpy(m, "ECB", 4);
>+ else
>+ strncpy(m, "CBC", 4);
>
> printk("\ntesting %s %s %s \n", algo, m, e);
>
>@@ -497,46 +511,46 @@
> test_hash("sha1", sha1_tv_template, SHA1_TEST_VECTORS);
>
> //DES
>- test_cipher ("des", 1, 1, des_enc_tv_template, DES_ENC_TEST_VECTORS);
>- test_cipher ("des", 1, 0, des_dec_tv_template, DES_DEC_TEST_VECTORS);
>- test_cipher ("des", 0, 1, des_cbc_enc_tv_template,
>DES_CBC_ENC_TEST_VECTORS);
>- test_cipher ("des", 0, 0, des_cbc_dec_tv_template,
>DES_CBC_DEC_TEST_VECTORS);
>+ test_cipher ("des", MODE_ECB, ENCRYPT, des_enc_tv_template,
>DES_ENC_TEST_VECTORS);
>+ test_cipher ("des", MODE_ECB, DECRYPT, des_dec_tv_template,
>DES_DEC_TEST_VECTORS);
>+ test_cipher ("des", MODE_CBC, ENCRYPT, des_cbc_enc_tv_template,
>DES_CBC_ENC_TEST_VECTORS);
>+ test_cipher ("des", MODE_CBC, DECRYPT, des_cbc_dec_tv_template,
>DES_CBC_DEC_TEST_VECTORS);
>
> //DES3_EDE
>- test_cipher ("des3_ede", 1, 1, des3_ede_enc_tv_template,
>DES3_EDE_ENC_TEST_VECTORS);
>- test_cipher ("des3_ede", 1, 0, des3_ede_dec_tv_template,
>DES3_EDE_DEC_TEST_VECTORS);
>+ test_cipher ("des3_ede", MODE_ECB, ENCRYPT, des3_ede_enc_tv_template,
>DES3_EDE_ENC_TEST_VECTORS);
>+ test_cipher ("des3_ede", MODE_ECB, DECRYPT, des3_ede_dec_tv_template,
>DES3_EDE_DEC_TEST_VECTORS);
>
> test_hash("md4", md4_tv_template, MD4_TEST_VECTORS);
>
> test_hash("sha256", sha256_tv_template, SHA256_TEST_VECTORS);
>
> //BLOWFISH
>- test_cipher ("blowfish", 1, 1, bf_enc_tv_template, BF_ENC_TEST_VECTORS);
>- test_cipher ("blowfish", 1, 0, bf_dec_tv_template, BF_DEC_TEST_VECTORS);
>- test_cipher ("blowfish", 0, 1, bf_cbc_enc_tv_template,
>BF_CBC_ENC_TEST_VECTORS);
>- test_cipher ("blowfish", 0, 0, bf_cbc_dec_tv_template,
>BF_CBC_DEC_TEST_VECTORS);
>+ test_cipher ("blowfish", MODE_ECB, ENCRYPT, bf_enc_tv_template,
>BF_ENC_TEST_VECTORS);
>+ test_cipher ("blowfish", MODE_ECB, DECRYPT, bf_dec_tv_template,
>BF_DEC_TEST_VECTORS);
>+ test_cipher ("blowfish", MODE_CBC, ENCRYPT, bf_cbc_enc_tv_template,
>BF_CBC_ENC_TEST_VECTORS);
>+ test_cipher ("blowfish", MODE_CBC, DECRYPT, bf_cbc_dec_tv_template,
>BF_CBC_DEC_TEST_VECTORS);
>
> //TWOFISH
>- test_cipher ("twofish", 1, 1, tf_enc_tv_template, TF_ENC_TEST_VECTORS);
>- test_cipher ("twofish", 1, 0, tf_dec_tv_template, TF_DEC_TEST_VECTORS);
>- test_cipher ("twofish", 0, 1, tf_cbc_enc_tv_template,
>TF_CBC_ENC_TEST_VECTORS);
>- test_cipher ("twofish", 0, 0, tf_cbc_dec_tv_template,
>TF_CBC_DEC_TEST_VECTORS);
>+ test_cipher ("twofish", MODE_ECB, ENCRYPT, tf_enc_tv_template,
>TF_ENC_TEST_VECTORS);
>+ test_cipher ("twofish", MODE_ECB, DECRYPT, tf_dec_tv_template,
>TF_DEC_TEST_VECTORS);
>+ test_cipher ("twofish", MODE_CBC, ENCRYPT, tf_cbc_enc_tv_template,
>TF_CBC_ENC_TEST_VECTORS);
>+ test_cipher ("twofish", MODE_CBC, DECRYPT, tf_cbc_dec_tv_template,
>TF_CBC_DEC_TEST_VECTORS);
>
> //SERPENT
>- test_cipher ("serpent", 1, 1, serpent_enc_tv_template,
>SERPENT_ENC_TEST_VECTORS);
>- test_cipher ("serpent", 1, 0, serpent_dec_tv_template,
>SERPENT_DEC_TEST_VECTORS);
>+ test_cipher ("serpent", MODE_ECB, ENCRYPT, serpent_enc_tv_template,
>SERPENT_ENC_TEST_VECTORS);
>+ test_cipher ("serpent", MODE_ECB, DECRYPT, serpent_dec_tv_template,
>SERPENT_DEC_TEST_VECTORS);
>
> //AES
>- test_cipher ("aes", 1, 1, aes_enc_tv_template, AES_ENC_TEST_VECTORS);
>- test_cipher ("aes", 1, 0, aes_dec_tv_template, AES_DEC_TEST_VECTORS);
>+ test_cipher ("aes", MODE_ECB, ENCRYPT, aes_enc_tv_template,
>AES_ENC_TEST_VECTORS);
>+ test_cipher ("aes", MODE_ECB, DECRYPT, aes_dec_tv_template,
>AES_DEC_TEST_VECTORS);
>
> //CAST5
>- test_cipher ("cast5", 1, 1, cast5_enc_tv_template,
>CAST5_ENC_TEST_VECTORS);
>- test_cipher ("cast5", 1, 0, cast5_dec_tv_template,
>CAST5_DEC_TEST_VECTORS);
>+ test_cipher ("cast5", MODE_ECB, ENCRYPT, cast5_enc_tv_template,
>CAST5_ENC_TEST_VECTORS);
>+ test_cipher ("cast5", MODE_ECB, DECRYPT, cast5_dec_tv_template,
>CAST5_DEC_TEST_VECTORS);
>
> //CAST6
>- test_cipher ("cast6", 1, 1, cast6_enc_tv_template,
>CAST6_ENC_TEST_VECTORS);
>- test_cipher ("cast6", 1, 0, cast6_dec_tv_template,
>CAST6_DEC_TEST_VECTORS);
>+ test_cipher ("cast6", MODE_ECB, ENCRYPT, cast6_enc_tv_template,
>CAST6_ENC_TEST_VECTORS);
>+ test_cipher ("cast6", MODE_ECB, DECRYPT, cast6_dec_tv_template,
>CAST6_DEC_TEST_VECTORS);
>
> test_hash("sha384", sha384_tv_template, SHA384_TEST_VECTORS);
> test_hash("sha512", sha512_tv_template, SHA512_TEST_VECTORS);
>@@ -557,15 +571,15 @@
> break;
>
> case 3:
>- test_cipher ("des", 1, 1, des_enc_tv_template, DES_ENC_TEST_VECTORS);
>- test_cipher ("des", 1, 0, des_dec_tv_template, DES_DEC_TEST_VECTORS);
>- test_cipher ("des", 0, 1, des_cbc_enc_tv_template,
>DES_CBC_ENC_TEST_VECTORS);
>- test_cipher ("des", 0, 0, des_cbc_dec_tv_template,
>DES_CBC_DEC_TEST_VECTORS);
>+ test_cipher ("des", MODE_ECB, ENCRYPT, des_enc_tv_template,
>DES_ENC_TEST_VECTORS);
>+ test_cipher ("des", MODE_ECB, DECRYPT, des_dec_tv_template,
>DES_DEC_TEST_VECTORS);
>+ test_cipher ("des", MODE_CBC, ENCRYPT, des_cbc_enc_tv_template,
>DES_CBC_ENC_TEST_VECTORS);
>+ test_cipher ("des", MODE_CBC, DECRYPT, des_cbc_dec_tv_template,
>DES_CBC_DEC_TEST_VECTORS);
> break;
>
> case 4:
>- test_cipher ("des3_ede", 1, 1, des3_ede_enc_tv_template,
>DES3_EDE_ENC_TEST_VECTORS);
>- test_cipher ("des3_ede", 1, 0, des3_ede_dec_tv_template,
>DES3_EDE_DEC_TEST_VECTORS);
>+ test_cipher ("des3_ede", MODE_ECB, ENCRYPT, des3_ede_enc_tv_template,
>DES3_EDE_ENC_TEST_VECTORS);
>+ test_cipher ("des3_ede", MODE_ECB, DECRYPT, des3_ede_dec_tv_template,
>DES3_EDE_DEC_TEST_VECTORS);
> break;
>
> case 5:
>@@ -577,28 +591,28 @@
> break;
>
> case 7:
>- test_cipher ("blowfish", 1, 1, bf_enc_tv_template, BF_ENC_TEST_VECTORS);
>- test_cipher ("blowfish", 1, 0, bf_dec_tv_template, BF_DEC_TEST_VECTORS);
>- test_cipher ("blowfish", 0, 1, bf_cbc_enc_tv_template,
>BF_CBC_ENC_TEST_VECTORS);
>- test_cipher ("blowfish", 0, 0, bf_cbc_dec_tv_template,
>BF_CBC_DEC_TEST_VECTORS);
>+ test_cipher ("blowfish", MODE_ECB, ENCRYPT, bf_enc_tv_template,
>BF_ENC_TEST_VECTORS);
>+ test_cipher ("blowfish", MODE_ECB, DECRYPT, bf_dec_tv_template,
>BF_DEC_TEST_VECTORS);
>+ test_cipher ("blowfish", MODE_CBC, ENCRYPT, bf_cbc_enc_tv_template,
>BF_CBC_ENC_TEST_VECTORS);
>+ test_cipher ("blowfish", MODE_CBC, DECRYPT, bf_cbc_dec_tv_template,
>BF_CBC_DEC_TEST_VECTORS);
> break;
>
> case 8:
>- test_cipher ("twofish", 1, 1, tf_enc_tv_template, TF_ENC_TEST_VECTORS);
>- test_cipher ("twofish", 1, 0, tf_dec_tv_template, TF_DEC_TEST_VECTORS);
>- test_cipher ("twofish", 0, 1, tf_cbc_enc_tv_template,
>TF_CBC_ENC_TEST_VECTORS);
>- test_cipher ("twofish", 0, 0, tf_cbc_dec_tv_template,
>TF_CBC_DEC_TEST_VECTORS);
>+ test_cipher ("twofish", MODE_ECB, ENCRYPT, tf_enc_tv_template,
>TF_ENC_TEST_VECTORS);
>+ test_cipher ("twofish", MODE_ECB, DECRYPT, tf_dec_tv_template,
>TF_DEC_TEST_VECTORS);
>+ test_cipher ("twofish", MODE_CBC, ENCRYPT, tf_cbc_enc_tv_template,
>TF_CBC_ENC_TEST_VECTORS);
>+ test_cipher ("twofish", MODE_CBC, DECRYPT, tf_cbc_dec_tv_template,
>TF_CBC_DEC_TEST_VECTORS);
> break;
>
> case 9:
>- test_cipher ("serpent", 1, 1, serpent_enc_tv_template,
>SERPENT_ENC_TEST_VECTORS);
>- test_cipher ("serpent", 1, 0, serpent_dec_tv_template,
>SERPENT_DEC_TEST_VECTORS);
>+ test_cipher ("serpent", MODE_ECB, ENCRYPT, serpent_enc_tv_template,
>SERPENT_ENC_TEST_VECTORS);
>+ test_cipher ("serpent", MODE_ECB, DECRYPT, serpent_dec_tv_template,
>SERPENT_DEC_TEST_VECTORS);
>
> break;
>
> case 10:
>- test_cipher ("aes", 1, 1, aes_enc_tv_template, AES_ENC_TEST_VECTORS);
>- test_cipher ("aes", 1, 0, aes_dec_tv_template, AES_DEC_TEST_VECTORS);
>+ test_cipher ("aes", MODE_ECB, ENCRYPT, aes_enc_tv_template,
>AES_ENC_TEST_VECTORS);
>+ test_cipher ("aes", MODE_ECB, DECRYPT, aes_dec_tv_template,
>AES_DEC_TEST_VECTORS);
> break;
>
> case 11:
>@@ -614,13 +628,13 @@
> break;
>
> case 14:
>- test_cipher ("cast5", 1, 1, cast5_enc_tv_template,
>CAST5_ENC_TEST_VECTORS);
>- test_cipher ("cast5", 1, 0, cast5_dec_tv_template,
>CAST5_DEC_TEST_VECTORS);
>+ test_cipher ("cast5", MODE_ECB, ENCRYPT, cast5_enc_tv_template,
>CAST5_ENC_TEST_VECTORS);
>+ test_cipher ("cast5", MODE_ECB, DECRYPT, cast5_dec_tv_template,
>CAST5_DEC_TEST_VECTORS);
> break;
>
> case 15:
>- test_cipher ("cast6", 1, 1, cast6_enc_tv_template,
>CAST6_ENC_TEST_VECTORS);
>- test_cipher ("cast6", 1, 0, cast6_dec_tv_template,
>CAST6_DEC_TEST_VECTORS);
>+ test_cipher ("cast6", MODE_ECB, ENCRYPT, cast6_enc_tv_template,
>CAST6_ENC_TEST_VECTORS);
>+ test_cipher ("cast6", MODE_ECB, DECRYPT, cast6_dec_tv_template,
>CAST6_DEC_TEST_VECTORS);
> break;
>
> #ifdef CONFIG_CRYPTO_HMAC
_________________________________________________________________
Get personal loans. It's hassle-free.
http://server1.msn.co.in/msnleads/citibankpersonalloan/citibankploanjuly03.asp?type=txt
It's approved instantly.
Hi Kartikey,
Nice cleanup!
Do you think it'd be hard to add a speed testing code for ciphers? .. so one
can choose the fastest cipher for cryptoloop :)
Regards, Clemens
On Mon, 15 Sep 2003, kartikey bhatt wrote:
> I have cleaned up the testing module.
> A complete rewrite.
Thanks! I'll look at this as soon as possible (just processing a large
backlog at the moment).
- James
--
James Morris
<[email protected]>
thanks for reply.
i was worried whether you find it useful or not.
>From: James Morris <[email protected]>
>To: kartikey bhatt <[email protected]>
>CC: [email protected]
>Subject: Re: [CRYPTO] Testing Module Cleanup.
>Date: Wed, 17 Sep 2003 07:21:06 -0400 (EDT)
>
>On Mon, 15 Sep 2003, kartikey bhatt wrote:
>
> > I have cleaned up the testing module.
> > A complete rewrite.
>
>Thanks! I'll look at this as soon as possible (just processing a large
>backlog at the moment).
>
>
>- James
>--
>James Morris
><[email protected]>
>
_________________________________________________________________
The hottest things. The coolest deals. http://www.msn.co.in/Shopping/ Get
them online!
What's the progress?
-Kartikey Mahendra Bhatt
>From: James Morris <[email protected]>
>To: kartikey bhatt <[email protected]>
>CC: [email protected]
>Subject: Re: [CRYPTO] Testing Module Cleanup.
>Date: Wed, 17 Sep 2003 07:21:06 -0400 (EDT)
>
>On Mon, 15 Sep 2003, kartikey bhatt wrote:
>
> > I have cleaned up the testing module.
> > A complete rewrite.
>
>Thanks! I'll look at this as soon as possible (just processing a large
>backlog at the moment).
>
>
>- James
>--
>James Morris
><[email protected]>
>
_________________________________________________________________
On Sun, 28 Sep 2003, kartikey bhatt wrote:
> What's the progress?
Could you please send the patch updated with Erlend Aasland's
contribution?
Thanks,
- James
--
James Morris
<[email protected]>