Commit f9e8cd59 authored by Niels Möller's avatar Niels Möller

(test_cbc_bulk): Use aes_set_encrypt_key

and aes_set_decrypt_key.

Rev: src/nettle/testsuite/cbc-test.c:1.4
parent da017b5b
......@@ -30,7 +30,7 @@ test_cbc_bulk(void)
/* Byte that should not be overwritten */
cipher[CBC_BULK_DATA] = 17;
aes_set_key(&aes.ctx, 32, key);
aes_set_encrypt_key(&aes.ctx, 32, key);
CBC_SET_IV(&aes, start_iv);
CBC_ENCRYPT(&aes, aes_encrypt, CBC_BULK_DATA, cipher, clear);
......@@ -49,6 +49,7 @@ test_cbc_bulk(void)
FAIL();
/* Decrypt, in place */
aes_set_decrypt_key(&aes.ctx, 32, key);
CBC_SET_IV(&aes, start_iv);
CBC_DECRYPT(&aes, aes_decrypt, CBC_BULK_DATA, cipher, cipher);
......@@ -110,67 +111,67 @@ test_main(void)
* 604ed7ddf32efdff7020d0238b7c2a5d
* 8521f2fd3c8eef2cdc3da7e5c44ea206
*/
test_cipher_cbc(&nettle_aes128,
HL("2b7e151628aed2a6abf7158809cf4f3c"),
HL("6bc1bee22e409f96e93d7e117393172a"
"ae2d8a571e03ac9c9eb76fac45af8e51"
"30c81c46a35ce411e5fbc1191a0a52ef"
"f69f2445df4f9b17ad2b417be66c3710"),
H("7649abac8119b246cee98e9b12e9197d"
"5086cb9b507219ee95db113a917678b2"
"73bed6b8e3c1743b7116e69e22229516"
"3ff1caa1681fac09120eca307586e1a7"),
H("000102030405060708090a0b0c0d0e0f"));
/* F.2.3 CBC-AES192.Encrypt */
/* Intermediate values, blcoks input to AES:
*
* 6bc0bce12a459991e134741a7f9e1925
* e12f97e55dbfcfa1efcf7796da0fffb9
* 8411b1ef0e2109e5001cf96f256346b5
* a1840065cdb4e1f7d282fbd7db9d35f0
*/
test_cipher_cbc(&nettle_aes128,
HL("2b7e151628aed2a6abf7158809cf4f3c"),
HL("6bc1bee22e409f96e93d7e117393172a"
"ae2d8a571e03ac9c9eb76fac45af8e51"
"30c81c46a35ce411e5fbc1191a0a52ef"
"f69f2445df4f9b17ad2b417be66c3710"),
H("7649abac8119b246cee98e9b12e9197d"
"5086cb9b507219ee95db113a917678b2"
"73bed6b8e3c1743b7116e69e22229516"
"3ff1caa1681fac09120eca307586e1a7"),
H("000102030405060708090a0b0c0d0e0f"));
/* F.2.3 CBC-AES192.Encrypt */
/* Intermediate values, blcoks input to AES:
*
* 6bc0bce12a459991e134741a7f9e1925
* e12f97e55dbfcfa1efcf7796da0fffb9
* 8411b1ef0e2109e5001cf96f256346b5
* a1840065cdb4e1f7d282fbd7db9d35f0
*/
test_cipher_cbc(&nettle_aes192,
HL("8e73b0f7da0e6452c810f32b809079e5"
"62f8ead2522c6b7b"),
HL("6bc1bee22e409f96e93d7e117393172a"
"ae2d8a571e03ac9c9eb76fac45af8e51"
"30c81c46a35ce411e5fbc1191a0a52ef"
"f69f2445df4f9b17ad2b417be66c3710"),
H("4f021db243bc633d7178183a9fa071e8"
"b4d9ada9ad7dedf4e5e738763f69145a"
"571b242012fb7ae07fa9baac3df102e0"
"08b0e27988598881d920a9e64f5615cd"),
H("000102030405060708090a0b0c0d0e0f"));
test_cipher_cbc(&nettle_aes192,
HL("8e73b0f7da0e6452c810f32b809079e5"
"62f8ead2522c6b7b"),
HL("6bc1bee22e409f96e93d7e117393172a"
"ae2d8a571e03ac9c9eb76fac45af8e51"
"30c81c46a35ce411e5fbc1191a0a52ef"
"f69f2445df4f9b17ad2b417be66c3710"),
H("4f021db243bc633d7178183a9fa071e8"
"b4d9ada9ad7dedf4e5e738763f69145a"
"571b242012fb7ae07fa9baac3df102e0"
"08b0e27988598881d920a9e64f5615cd"),
H("000102030405060708090a0b0c0d0e0f"));
/* F.2.5 CBC-AES256.Encrypt */
/* F.2.5 CBC-AES256.Encrypt */
/* Intermediate values, blcoks input to AES:
*
* 6bc0bce12a459991e134741a7f9e1925
* 5ba1c653c8e65d26e929c4571ad47587
* ac3452d0dd87649c8264b662dc7a7e92
* cf6d172c769621d8081ba318e24f2371
*/
/* Intermediate values, blcoks input to AES:
*
* 6bc0bce12a459991e134741a7f9e1925
* 5ba1c653c8e65d26e929c4571ad47587
* ac3452d0dd87649c8264b662dc7a7e92
* cf6d172c769621d8081ba318e24f2371
*/
test_cipher_cbc(&nettle_aes256,
HL("603deb1015ca71be2b73aef0857d7781"
"1f352c073b6108d72d9810a30914dff4"),
HL("6bc1bee22e409f96e93d7e117393172a"
"ae2d8a571e03ac9c9eb76fac45af8e51"
"30c81c46a35ce411e5fbc1191a0a52ef"
"f69f2445df4f9b17ad2b417be66c3710"),
H("f58c4c04d6e5f1ba779eabfb5f7bfbd6"
"9cfc4e967edb808d679f777bc6702c7d"
"39f23369a9d9bacfa530e26304231461"
"b2eb05e2c39be9fcda6c19078c6a9d1b"),
H("000102030405060708090a0b0c0d0e0f"));
test_cipher_cbc(&nettle_aes256,
HL("603deb1015ca71be2b73aef0857d7781"
"1f352c073b6108d72d9810a30914dff4"),
HL("6bc1bee22e409f96e93d7e117393172a"
"ae2d8a571e03ac9c9eb76fac45af8e51"
"30c81c46a35ce411e5fbc1191a0a52ef"
"f69f2445df4f9b17ad2b417be66c3710"),
H("f58c4c04d6e5f1ba779eabfb5f7bfbd6"
"9cfc4e967edb808d679f777bc6702c7d"
"39f23369a9d9bacfa530e26304231461"
"b2eb05e2c39be9fcda6c19078c6a9d1b"),
H("000102030405060708090a0b0c0d0e0f"));
test_cbc_bulk();
test_cbc_bulk();
SUCCESS();
SUCCESS();
}
/*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment