Skip to content

Commit

Permalink
[CRYPTO] tcrypt: LRW test vectors
Browse files Browse the repository at this point in the history
Do modprobe tcrypt mode=10 to check the included test vectors, they are
from: http://grouper.ieee.org/groups/1619/email/pdf00017.pdf and from
http://www.mail-archive.com/[email protected]/msg00173.html.

To make the last test vector fit, I had to increase the buffer size of
input and result to 512 bytes.

Signed-off-by: Rik Snel <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
Rik Snel authored and David S. Miller committed Dec 7, 2006
1 parent 64470f1 commit f3d1044
Show file tree
Hide file tree
Showing 2 changed files with 542 additions and 4 deletions.
12 changes: 12 additions & 0 deletions crypto/tcrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,10 @@ static void do_test(void)
AES_CBC_ENC_TEST_VECTORS);
test_cipher("cbc(aes)", DECRYPT, aes_cbc_dec_tv_template,
AES_CBC_DEC_TEST_VECTORS);
test_cipher("lrw(aes)", ENCRYPT, aes_lrw_enc_tv_template,
AES_LRW_ENC_TEST_VECTORS);
test_cipher("lrw(aes)", DECRYPT, aes_lrw_dec_tv_template,
AES_LRW_DEC_TEST_VECTORS);

//CAST5
test_cipher("ecb(cast5)", ENCRYPT, cast5_enc_tv_template,
Expand Down Expand Up @@ -1055,6 +1059,10 @@ static void do_test(void)
AES_CBC_ENC_TEST_VECTORS);
test_cipher("cbc(aes)", DECRYPT, aes_cbc_dec_tv_template,
AES_CBC_DEC_TEST_VECTORS);
test_cipher("lrw(aes)", ENCRYPT, aes_lrw_enc_tv_template,
AES_LRW_ENC_TEST_VECTORS);
test_cipher("lrw(aes)", DECRYPT, aes_lrw_dec_tv_template,
AES_LRW_DEC_TEST_VECTORS);
break;

case 11:
Expand Down Expand Up @@ -1194,6 +1202,10 @@ static void do_test(void)
aes_speed_template);
test_cipher_speed("cbc(aes)", DECRYPT, sec, NULL, 0,
aes_speed_template);
test_cipher_speed("lrw(aes)", ENCRYPT, sec, NULL, 0,
aes_lrw_speed_template);
test_cipher_speed("lrw(aes)", DECRYPT, sec, NULL, 0,
aes_lrw_speed_template);
break;

case 201:
Expand Down
Loading

0 comments on commit f3d1044

Please sign in to comment.