2006-09-23 17:21:12

by Rik Snel

[permalink] [raw]
Subject: [PATCH] adding speed_test_template for lrw(aes)

From: Rik Snel <[email protected]>

lrw(aes) needs a different speed_test_template from standard aes because of
the different keysize, lrw(aes) has 256, 320 and 384 bits and other aes
modes have 128, 192, 256 bits.

Signed-off-by: Rik Snel <[email protected]>
---
crypto/tcrypt.c | 4 ++--
crypto/tcrypt.h | 21 +++++++++++++++++++++
2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index ccad842..777fc63 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -1200,9 +1200,9 @@ static void do_test(void)
test_cipher_speed("cbc(aes)", DECRYPT, sec, NULL, 0,
aes_speed_template);
test_cipher_speed("lrw(aes)", ENCRYPT, sec, NULL, 0,
- aes_speed_template);
+ aes_lrw_speed_template);
test_cipher_speed("lrw(aes)", DECRYPT, sec, NULL, 0,
- aes_speed_template);
+ aes_lrw_speed_template);
break;

case 201:
diff --git a/crypto/tcrypt.h b/crypto/tcrypt.h
index ab98b28..59fbc39 100644
--- a/crypto/tcrypt.h
+++ b/crypto/tcrypt.h
@@ -3589,6 +3589,27 @@ static struct cipher_speed aes_speed_tem
{ .klen = 0, .blen = 0, }
};

+static struct cipher_speed aes_lrw_speed_template[] = {
+ { .klen = 32, .blen = 16, },
+ { .klen = 32, .blen = 64, },
+ { .klen = 32, .blen = 256, },
+ { .klen = 32, .blen = 1024, },
+ { .klen = 32, .blen = 8192, },
+ { .klen = 40, .blen = 16, },
+ { .klen = 40, .blen = 64, },
+ { .klen = 40, .blen = 256, },
+ { .klen = 40, .blen = 1024, },
+ { .klen = 40, .blen = 8192, },
+ { .klen = 48, .blen = 16, },
+ { .klen = 48, .blen = 64, },
+ { .klen = 48, .blen = 256, },
+ { .klen = 48, .blen = 1024, },
+ { .klen = 48, .blen = 8192, },
+
+ /* End marker */
+ { .klen = 0, .blen = 0, }
+};
+
static struct cipher_speed des3_ede_speed_template[] = {
{ .klen = 24, .blen = 16, },
{ .klen = 24, .blen = 64, },
--
1.4.2.1