This patch adds a simple speed test for salsa20-generic.
Usage: modprobe tcrypt mode=206

Signed-of-by: Tan Swee Heng <[EMAIL PROTECTED]>
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 387d105..6a474f4 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -1659,6 +1659,11 @@ static void do_test(void)
                                camellia_speed_template);
                break;
 
+       case 206:
+               test_cipher_speed("salsa20-generic", ENCRYPT, sec, NULL, 0,
+                               salsa20_speed_template);
+               break;
+
        case 300:
                /* fall through */
 
diff --git a/crypto/tcrypt.h b/crypto/tcrypt.h
index 57f54c7..b9dc414 100644
--- a/crypto/tcrypt.h
+++ b/crypto/tcrypt.h
@@ -7881,4 +7881,20 @@ static struct cipher_speed camellia_speed_template[] = {
       {  .klen = 0, .blen = 0, }
 };
 
+static struct cipher_speed salsa20_speed_template[] = {
+      { .klen = 16, .blen = 16, },
+      { .klen = 16, .blen = 64, },
+      { .klen = 16, .blen = 256, },
+      { .klen = 16, .blen = 1024, },
+      { .klen = 16, .blen = 8192, },
+      { .klen = 32, .blen = 16, },
+      { .klen = 32, .blen = 64, },
+      { .klen = 32, .blen = 256, },
+      { .klen = 32, .blen = 1024, },
+      { .klen = 32, .blen = 8192, },
+
+      /* End marker */
+      {  .klen = 0, .blen = 0, }
+};
+
 #endif /* _CRYPTO_TCRYPT_H */

Reply via email to