Skip to content

Commit

Permalink
[CRYPTO] tcrypt: Added salsa20 speed test
Browse files Browse the repository at this point in the history
This patch adds a simple speed test for salsa20.
Usage: modprobe tcrypt mode=206

Signed-of-by: Tan Swee Heng <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
taswhe authored and herbertx committed Jan 10, 2008
1 parent 0b77abb commit 5de8f1b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crypto/tcrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1668,6 +1668,11 @@ static void do_test(void)
camellia_speed_template);
break;

case 206:
test_cipher_speed("salsa20", ENCRYPT, sec, NULL, 0,
salsa20_speed_template);
break;

case 300:
/* fall through */

Expand Down
16 changes: 16 additions & 0 deletions crypto/tcrypt.h
Original file line number Diff line number Diff line change
Expand Up @@ -7947,4 +7947,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 */

0 comments on commit 5de8f1b

Please sign in to comment.