X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=crypto%2Ftcrypt.h;h=df08d0d8c6bd19ad0d8c219bdeee7e7ca0055a8a;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=18370befc652b1ef475f0218789c4bb2557e6e5d;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/crypto/tcrypt.h b/crypto/tcrypt.h index 18370befc..df08d0d8c 100644 --- a/crypto/tcrypt.h +++ b/crypto/tcrypt.h @@ -63,7 +63,7 @@ struct cipher_testvec { */ #define MD4_TEST_VECTORS 7 -struct hash_testvec md4_tv_template [] = { +static struct hash_testvec md4_tv_template [] = { { .plaintext = "", .digest = { 0x31, 0xd6, 0xcf, 0xe0, 0xd1, 0x6a, 0xe9, 0x31, @@ -109,7 +109,7 @@ struct hash_testvec md4_tv_template [] = { */ #define MD5_TEST_VECTORS 7 -struct hash_testvec md5_tv_template[] = { +static struct hash_testvec md5_tv_template[] = { { .digest = { 0xd4, 0x1d, 0x8c, 0xd9, 0x8f, 0x00, 0xb2, 0x04, 0xe9, 0x80, 0x09, 0x98, 0xec, 0xf8, 0x42, 0x7e }, @@ -154,7 +154,7 @@ struct hash_testvec md5_tv_template[] = { */ #define SHA1_TEST_VECTORS 2 -struct hash_testvec sha1_tv_template[] = { +static struct hash_testvec sha1_tv_template[] = { { .plaintext = "abc", .psize = 3, @@ -175,7 +175,7 @@ struct hash_testvec sha1_tv_template[] = { */ #define SHA256_TEST_VECTORS 2 -struct hash_testvec sha256_tv_template[] = { +static struct hash_testvec sha256_tv_template[] = { { .plaintext = "abc", .psize = 3, @@ -200,7 +200,7 @@ struct hash_testvec sha256_tv_template[] = { */ #define SHA384_TEST_VECTORS 4 -struct hash_testvec sha384_tv_template[] = { +static struct hash_testvec sha384_tv_template[] = { { .plaintext= "abc", .psize = 3, @@ -249,7 +249,7 @@ struct hash_testvec sha384_tv_template[] = { */ #define SHA512_TEST_VECTORS 4 -struct hash_testvec sha512_tv_template[] = { +static struct hash_testvec sha512_tv_template[] = { { .plaintext = "abc", .psize = 3, @@ -309,7 +309,7 @@ struct hash_testvec sha512_tv_template[] = { */ #define WP512_TEST_VECTORS 8 -struct hash_testvec wp512_tv_template[] = { +static struct hash_testvec wp512_tv_template[] = { { .plaintext = "", .psize = 0, @@ -407,7 +407,7 @@ struct hash_testvec wp512_tv_template[] = { #define WP384_TEST_VECTORS 8 -struct hash_testvec wp384_tv_template[] = { +static struct hash_testvec wp384_tv_template[] = { { .plaintext = "", .psize = 0, @@ -489,7 +489,7 @@ struct hash_testvec wp384_tv_template[] = { #define WP256_TEST_VECTORS 8 -struct hash_testvec wp256_tv_template[] = { +static struct hash_testvec wp256_tv_template[] = { { .plaintext = "", .psize = 0, @@ -561,7 +561,7 @@ struct hash_testvec wp256_tv_template[] = { */ #define HMAC_MD5_TEST_VECTORS 7 -struct hmac_testvec hmac_md5_tv_template[] = +static struct hmac_testvec hmac_md5_tv_template[] = { { .key = { [0 ... 15] = 0x0b }, @@ -625,7 +625,7 @@ struct hmac_testvec hmac_md5_tv_template[] = */ #define HMAC_SHA1_TEST_VECTORS 7 -struct hmac_testvec hmac_sha1_tv_template[] = { +static struct hmac_testvec hmac_sha1_tv_template[] = { { .key = { [0 ... 19] = 0x0b }, .ksize = 20, @@ -690,7 +690,7 @@ struct hmac_testvec hmac_sha1_tv_template[] = { */ #define HMAC_SHA256_TEST_VECTORS 10 -struct hmac_testvec hmac_sha256_tv_template[] = { +static struct hmac_testvec hmac_sha256_tv_template[] = { { .key = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, @@ -813,7 +813,7 @@ struct hmac_testvec hmac_sha256_tv_template[] = { #define DES3_EDE_ENC_TEST_VECTORS 3 #define DES3_EDE_DEC_TEST_VECTORS 3 -struct cipher_testvec des_enc_tv_template[] = { +static struct cipher_testvec des_enc_tv_template[] = { { /* From Applied Cryptography */ .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }, .klen = 8, @@ -917,7 +917,7 @@ struct cipher_testvec des_enc_tv_template[] = { }, }; -struct cipher_testvec des_dec_tv_template[] = { +static struct cipher_testvec des_dec_tv_template[] = { { /* From Applied Cryptography */ .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }, .klen = 8, @@ -957,7 +957,7 @@ struct cipher_testvec des_dec_tv_template[] = { }, }; -struct cipher_testvec des_cbc_enc_tv_template[] = { +static struct cipher_testvec des_cbc_enc_tv_template[] = { { /* From OpenSSL */ .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef}, .klen = 8, @@ -1012,7 +1012,7 @@ struct cipher_testvec des_cbc_enc_tv_template[] = { }, }; -struct cipher_testvec des_cbc_dec_tv_template[] = { +static struct cipher_testvec des_cbc_dec_tv_template[] = { { /* FIPS Pub 81 */ .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }, .klen = 8, @@ -1053,7 +1053,7 @@ struct cipher_testvec des_cbc_dec_tv_template[] = { /* * We really need some more test vectors, especially for DES3 CBC. */ -struct cipher_testvec des3_ede_enc_tv_template[] = { +static struct cipher_testvec des3_ede_enc_tv_template[] = { { /* These are from openssl */ .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, @@ -1084,7 +1084,7 @@ struct cipher_testvec des3_ede_enc_tv_template[] = { }, }; -struct cipher_testvec des3_ede_dec_tv_template[] = { +static struct cipher_testvec des3_ede_dec_tv_template[] = { { /* These are from openssl */ .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, @@ -1123,7 +1123,7 @@ struct cipher_testvec des3_ede_dec_tv_template[] = { #define BF_CBC_ENC_TEST_VECTORS 1 #define BF_CBC_DEC_TEST_VECTORS 1 -struct cipher_testvec bf_enc_tv_template[] = { +static struct cipher_testvec bf_enc_tv_template[] = { { /* DES test vectors from OpenSSL */ .key = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }, .klen = 8, @@ -1178,7 +1178,7 @@ struct cipher_testvec bf_enc_tv_template[] = { }, }; -struct cipher_testvec bf_dec_tv_template[] = { +static struct cipher_testvec bf_dec_tv_template[] = { { /* DES test vectors from OpenSSL */ .key = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, .klen = 8, @@ -1233,7 +1233,7 @@ struct cipher_testvec bf_dec_tv_template[] = { }, }; -struct cipher_testvec bf_cbc_enc_tv_template[] = { +static struct cipher_testvec bf_cbc_enc_tv_template[] = { { /* From OpenSSL */ .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87 }, @@ -1252,7 +1252,7 @@ struct cipher_testvec bf_cbc_enc_tv_template[] = { }, }; -struct cipher_testvec bf_cbc_dec_tv_template[] = { +static struct cipher_testvec bf_cbc_dec_tv_template[] = { { /* From OpenSSL */ .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87 }, @@ -1279,7 +1279,7 @@ struct cipher_testvec bf_cbc_dec_tv_template[] = { #define TF_CBC_ENC_TEST_VECTORS 4 #define TF_CBC_DEC_TEST_VECTORS 4 -struct cipher_testvec tf_enc_tv_template[] = { +static struct cipher_testvec tf_enc_tv_template[] = { { .key = { [0 ... 15] = 0x00 }, .klen = 16, @@ -1312,7 +1312,7 @@ struct cipher_testvec tf_enc_tv_template[] = { }, }; -struct cipher_testvec tf_dec_tv_template[] = { +static struct cipher_testvec tf_dec_tv_template[] = { { .key = { [0 ... 15] = 0x00 }, .klen = 16, @@ -1345,7 +1345,7 @@ struct cipher_testvec tf_dec_tv_template[] = { }, }; -struct cipher_testvec tf_cbc_enc_tv_template[] = { +static struct cipher_testvec tf_cbc_enc_tv_template[] = { { /* Generated with Nettle */ .key = { [0 ... 15] = 0x00 }, .klen = 16, @@ -1391,7 +1391,7 @@ struct cipher_testvec tf_cbc_enc_tv_template[] = { }, }; -struct cipher_testvec tf_cbc_dec_tv_template[] = { +static struct cipher_testvec tf_cbc_dec_tv_template[] = { { /* Reverse of the first four above */ .key = { [0 ... 15] = 0x00 }, .klen = 16, @@ -1444,7 +1444,10 @@ struct cipher_testvec tf_cbc_dec_tv_template[] = { #define SERPENT_ENC_TEST_VECTORS 4 #define SERPENT_DEC_TEST_VECTORS 4 -struct cipher_testvec serpent_enc_tv_template[] = +#define TNEPRES_ENC_TEST_VECTORS 4 +#define TNEPRES_DEC_TEST_VECTORS 4 + +static struct cipher_testvec serpent_enc_tv_template[] = { { .input = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, @@ -1486,7 +1489,58 @@ struct cipher_testvec serpent_enc_tv_template[] = }, }; -struct cipher_testvec serpent_dec_tv_template[] = +static struct cipher_testvec tnepres_enc_tv_template[] = +{ + { /* KeySize=128, PT=0, I=1 */ + .input = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .key = { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .klen = 16, + .ilen = 16, + .result = { 0x49, 0xaf, 0xbf, 0xad, 0x9d, 0x5a, 0x34, 0x05, + 0x2c, 0xd8, 0xff, 0xa5, 0x98, 0x6b, 0xd2, 0xdd }, + .rlen = 16, + }, { /* KeySize=192, PT=0, I=1 */ + .key = { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .klen = 24, + .input = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .ilen = 16, + .result = { 0xe7, 0x8e, 0x54, 0x02, 0xc7, 0x19, 0x55, 0x68, + 0xac, 0x36, 0x78, 0xf7, 0xa3, 0xf6, 0x0c, 0x66 }, + .rlen = 16, + }, { /* KeySize=256, PT=0, I=1 */ + .key = { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .klen = 32, + .input = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .ilen = 16, + .result = { 0xab, 0xed, 0x96, 0xe7, 0x66, 0xbf, 0x28, 0xcb, + 0xc0, 0xeb, 0xd2, 0x1a, 0x82, 0xef, 0x08, 0x19 }, + .rlen = 16, + }, { /* KeySize=256, I=257 */ + .key = { 0x1f, 0x1e, 0x1d, 0x1c, 0x1b, 0x1a, 0x19, 0x18, + 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x10, + 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, + 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00 }, + .klen = 32, + .input = { 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, + 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00 }, + .ilen = 16, + .result = { 0x5c, 0xe7, 0x1c, 0x70, 0xd2, 0x88, 0x2e, 0x5b, + 0xb8, 0x32, 0xe4, 0x33, 0xf8, 0x9f, 0x26, 0xde }, + .rlen = 16, + }, +}; + + +static struct cipher_testvec serpent_dec_tv_template[] = { { .input = { 0x12, 0x07, 0xfc, 0xce, 0x9b, 0xd0, 0xd6, 0x47, @@ -1528,11 +1582,54 @@ struct cipher_testvec serpent_dec_tv_template[] = }, }; +static struct cipher_testvec tnepres_dec_tv_template[] = +{ + { + .input = { 0x41, 0xcc, 0x6b, 0x31, 0x59, 0x31, 0x45, 0x97, + 0x6d, 0x6f, 0xbb, 0x38, 0x4b, 0x37, 0x21, 0x28 }, + .ilen = 16, + .result = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, + .rlen = 16, + }, { + .key = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, + .klen = 16, + .input = { 0xea, 0xf4, 0xd7, 0xfc, 0xd8, 0x01, 0x34, 0x47, + 0x81, 0x45, 0x0b, 0xfa, 0x0c, 0xd6, 0xad, 0x6e }, + .ilen = 16, + .result = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, + .rlen = 16, + }, { + .key = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f }, + .klen = 32, + .input = { 0x64, 0xa9, 0x1a, 0x37, 0xed, 0x9f, 0xe7, 0x49, + 0xa8, 0x4e, 0x76, 0xd6, 0xf5, 0x0d, 0x78, 0xee }, + .ilen = 16, + .result = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, + .rlen = 16, + }, { /* KeySize=128, I=121 */ + .key = { [15] = 0x80 }, + .klen = 16, + .input = { 0x3d, 0xda, 0xbf, 0xc0, 0x06, 0xda, 0xab, 0x06, + 0x46, 0x2a, 0xf4, 0xef, 0x81, 0x54, 0x4e, 0x26 }, + .ilen = 16, + .result = { [0 ... 15] = 0x00 }, + .rlen = 16, + }, +}; + + /* Cast6 test vectors from RFC 2612 */ #define CAST6_ENC_TEST_VECTORS 3 #define CAST6_DEC_TEST_VECTORS 3 -struct cipher_testvec cast6_enc_tv_template[] = +static struct cipher_testvec cast6_enc_tv_template[] = { { .key = { 0x23, 0x42, 0xbb, 0x9e, 0xfa, 0x38, 0x54, 0x2c, @@ -1567,7 +1664,7 @@ struct cipher_testvec cast6_enc_tv_template[] = }, }; -struct cipher_testvec cast6_dec_tv_template[] = +static struct cipher_testvec cast6_dec_tv_template[] = { { .key = { 0x23, 0x42, 0xbb, 0x9e, 0xfa, 0x38, 0x54, 0x2c, @@ -1609,7 +1706,7 @@ struct cipher_testvec cast6_dec_tv_template[] = #define AES_ENC_TEST_VECTORS 3 #define AES_DEC_TEST_VECTORS 3 -struct cipher_testvec aes_enc_tv_template[] = { +static struct cipher_testvec aes_enc_tv_template[] = { { /* From FIPS-197 */ .key = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, @@ -1646,7 +1743,7 @@ struct cipher_testvec aes_enc_tv_template[] = { }, }; -struct cipher_testvec aes_dec_tv_template[] = { +static struct cipher_testvec aes_dec_tv_template[] = { { /* From FIPS-197 */ .key = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, @@ -1687,7 +1784,7 @@ struct cipher_testvec aes_dec_tv_template[] = { #define CAST5_ENC_TEST_VECTORS 3 #define CAST5_DEC_TEST_VECTORS 3 -struct cipher_testvec cast5_enc_tv_template[] = +static struct cipher_testvec cast5_enc_tv_template[] = { { .key = { 0x01, 0x23, 0x45, 0x67, 0x12, 0x34, 0x56, 0x78, @@ -1715,7 +1812,7 @@ struct cipher_testvec cast5_enc_tv_template[] = }, }; -struct cipher_testvec cast5_dec_tv_template[] = +static struct cipher_testvec cast5_dec_tv_template[] = { { .key = { 0x01, 0x23, 0x45, 0x67, 0x12, 0x34, 0x56, 0x78, @@ -1749,7 +1846,7 @@ struct cipher_testvec cast5_dec_tv_template[] = #define ARC4_ENC_TEST_VECTORS 7 #define ARC4_DEC_TEST_VECTORS 7 -struct cipher_testvec arc4_enc_tv_template[] = +static struct cipher_testvec arc4_enc_tv_template[] = { { .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }, @@ -1816,7 +1913,7 @@ struct cipher_testvec arc4_enc_tv_template[] = }, }; -struct cipher_testvec arc4_dec_tv_template[] = +static struct cipher_testvec arc4_dec_tv_template[] = { { .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }, @@ -1889,7 +1986,7 @@ struct cipher_testvec arc4_dec_tv_template[] = #define TEA_ENC_TEST_VECTORS 4 #define TEA_DEC_TEST_VECTORS 4 -struct cipher_testvec tea_enc_tv_template[] = +static struct cipher_testvec tea_enc_tv_template[] = { { .key = { [0 ... 15] = 0x00 }, @@ -1933,7 +2030,7 @@ struct cipher_testvec tea_enc_tv_template[] = } }; -struct cipher_testvec tea_dec_tv_template[] = +static struct cipher_testvec tea_dec_tv_template[] = { { .key = { [0 ... 15] = 0x00 }, @@ -1983,7 +2080,7 @@ struct cipher_testvec tea_dec_tv_template[] = #define XTEA_ENC_TEST_VECTORS 4 #define XTEA_DEC_TEST_VECTORS 4 -struct cipher_testvec xtea_enc_tv_template[] = +static struct cipher_testvec xtea_enc_tv_template[] = { { .key = { [0 ... 15] = 0x00 }, @@ -2027,7 +2124,7 @@ struct cipher_testvec xtea_enc_tv_template[] = } }; -struct cipher_testvec xtea_dec_tv_template[] = +static struct cipher_testvec xtea_dec_tv_template[] = { { .key = { [0 ... 15] = 0x00 }, @@ -2077,7 +2174,7 @@ struct cipher_testvec xtea_dec_tv_template[] = #define KHAZAD_ENC_TEST_VECTORS 5 #define KHAZAD_DEC_TEST_VECTORS 5 -struct cipher_testvec khazad_enc_tv_template[] = { +static struct cipher_testvec khazad_enc_tv_template[] = { { .key = { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, @@ -2123,7 +2220,7 @@ struct cipher_testvec khazad_enc_tv_template[] = { }, }; -struct cipher_testvec khazad_dec_tv_template[] = { +static struct cipher_testvec khazad_dec_tv_template[] = { { .key = { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, @@ -2169,6 +2266,211 @@ struct cipher_testvec khazad_dec_tv_template[] = { }, }; +/* + * Anubis test vectors. + */ + +#define ANUBIS_ENC_TEST_VECTORS 5 +#define ANUBIS_DEC_TEST_VECTORS 5 +#define ANUBIS_CBC_ENC_TEST_VECTORS 2 +#define ANUBIS_CBC_DEC_TEST_VECTORS 2 + +static struct cipher_testvec anubis_enc_tv_template[] = { + { + .key = { 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, + 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe }, + .klen = 16, + .input = { 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, + 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe }, + .ilen = 16, + .result = { 0x6d, 0xc5, 0xda, 0xa2, 0x26, 0x7d, 0x62, 0x6f, + 0x08, 0xb7, 0x52, 0x8e, 0x6e, 0x6e, 0x86, 0x90 }, + .rlen = 16, + }, { + + .key = { 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03 }, + .klen = 20, + .input = { 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 }, + .ilen = 16, + .result = { 0xdb, 0xf1, 0x42, 0xf4, 0xd1, 0x8a, 0xc7, 0x49, + 0x87, 0x41, 0x6f, 0x82, 0x0a, 0x98, 0x64, 0xae }, + .rlen = 16, + }, { + .key = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, + 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, + 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, + 0x24, 0x24, 0x24, 0x24 }, + .klen = 28, + .input = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, + 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + .ilen = 16, + .result = { 0xfd, 0x1b, 0x4a, 0xe3, 0xbf, 0xf0, 0xad, 0x3d, + 0x06, 0xd3, 0x61, 0x27, 0xfd, 0x13, 0x9e, 0xde }, + .rlen = 16, + }, { + .key = { 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, + 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, + 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, + 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25 }, + .klen = 32, + .input = { 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, + 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25 }, + .ilen = 16, + .result = { 0x1a, 0x91, 0xfb, 0x2b, 0xb7, 0x78, 0x6b, 0xc4, + 0x17, 0xd9, 0xff, 0x40, 0x3b, 0x0e, 0xe5, 0xfe }, + .rlen = 16, + }, { + .key = { 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35 }, + .klen = 40, + .input = { 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35 }, + .ilen = 16, + .result = { 0xa5, 0x2c, 0x85, 0x6f, 0x9c, 0xba, 0xa0, 0x97, + 0x9e, 0xc6, 0x84, 0x0f, 0x17, 0x21, 0x07, 0xee }, + .rlen = 16, + }, +}; + +static struct cipher_testvec anubis_dec_tv_template[] = { + { + .key = { 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, + 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe }, + .klen = 16, + .input = { 0x6d, 0xc5, 0xda, 0xa2, 0x26, 0x7d, 0x62, 0x6f, + 0x08, 0xb7, 0x52, 0x8e, 0x6e, 0x6e, 0x86, 0x90 }, + .ilen = 16, + .result = { 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, + 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe }, + .rlen = 16, + }, { + + .key = { 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03 }, + .klen = 20, + .input = { 0xdb, 0xf1, 0x42, 0xf4, 0xd1, 0x8a, 0xc7, 0x49, + 0x87, 0x41, 0x6f, 0x82, 0x0a, 0x98, 0x64, 0xae }, + .ilen = 16, + .result = { 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 }, + .rlen = 16, + }, { + .key = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, + 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, + 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, + 0x24, 0x24, 0x24, 0x24 }, + .klen = 28, + .input = { 0xfd, 0x1b, 0x4a, 0xe3, 0xbf, 0xf0, 0xad, 0x3d, + 0x06, 0xd3, 0x61, 0x27, 0xfd, 0x13, 0x9e, 0xde }, + .ilen = 16, + .result = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, + 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + .rlen = 16, + }, { + .key = { 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, + 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, + 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, + 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25 }, + .klen = 32, + .input = { 0x1a, 0x91, 0xfb, 0x2b, 0xb7, 0x78, 0x6b, 0xc4, + 0x17, 0xd9, 0xff, 0x40, 0x3b, 0x0e, 0xe5, 0xfe }, + .ilen = 16, + .result = { 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, + 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25 }, + .rlen = 16, + }, { + .key = { 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35 }, + .input = { 0xa5, 0x2c, 0x85, 0x6f, 0x9c, 0xba, 0xa0, 0x97, + 0x9e, 0xc6, 0x84, 0x0f, 0x17, 0x21, 0x07, 0xee }, + .klen = 40, + .ilen = 16, + .result = { 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35 }, + .rlen = 16, + }, +}; + +static struct cipher_testvec anubis_cbc_enc_tv_template[] = { + { + .key = { 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, + 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe }, + .klen = 16, + .input = { 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, + 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, + 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, + 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe }, + .ilen = 32, + .result = { 0x6d, 0xc5, 0xda, 0xa2, 0x26, 0x7d, 0x62, 0x6f, + 0x08, 0xb7, 0x52, 0x8e, 0x6e, 0x6e, 0x86, 0x90, + 0x86, 0xd8, 0xb5, 0x6f, 0x98, 0x5e, 0x8a, 0x66, + 0x4f, 0x1f, 0x78, 0xa1, 0xbb, 0x37, 0xf1, 0xbe }, + .rlen = 32, + }, { + .key = { 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35 }, + .klen = 40, + .input = { 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35 }, + .ilen = 32, + .result = { 0xa5, 0x2c, 0x85, 0x6f, 0x9c, 0xba, 0xa0, 0x97, + 0x9e, 0xc6, 0x84, 0x0f, 0x17, 0x21, 0x07, 0xee, + 0xa2, 0xbc, 0x06, 0x98, 0xc6, 0x4b, 0xda, 0x75, + 0x2e, 0xaa, 0xbe, 0x58, 0xce, 0x01, 0x5b, 0xc7 }, + .rlen = 32, + }, +}; + +static struct cipher_testvec anubis_cbc_dec_tv_template[] = { + { + .key = { 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, + 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe }, + .klen = 16, + .input = { 0x6d, 0xc5, 0xda, 0xa2, 0x26, 0x7d, 0x62, 0x6f, + 0x08, 0xb7, 0x52, 0x8e, 0x6e, 0x6e, 0x86, 0x90, + 0x86, 0xd8, 0xb5, 0x6f, 0x98, 0x5e, 0x8a, 0x66, + 0x4f, 0x1f, 0x78, 0xa1, 0xbb, 0x37, 0xf1, 0xbe }, + .ilen = 32, + .result = { 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, + 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, + 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, + 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe }, + .rlen = 32, + }, { + .key = { 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35 }, + .klen = 40, + .input = { 0xa5, 0x2c, 0x85, 0x6f, 0x9c, 0xba, 0xa0, 0x97, + 0x9e, 0xc6, 0x84, 0x0f, 0x17, 0x21, 0x07, 0xee, + 0xa2, 0xbc, 0x06, 0x98, 0xc6, 0x4b, 0xda, 0x75, + 0x2e, 0xaa, 0xbe, 0x58, 0xce, 0x01, 0x5b, 0xc7 }, + .ilen = 32, + .result = { 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, + 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35 }, + .rlen = 32, + }, +}; + /* * Compression stuff. */ @@ -2187,7 +2489,7 @@ struct comp_testvec { #define DEFLATE_COMP_TEST_VECTORS 2 #define DEFLATE_DECOMP_TEST_VECTORS 2 -struct comp_testvec deflate_comp_tv_template[] = { +static struct comp_testvec deflate_comp_tv_template[] = { { .inlen = 70, .outlen = 38, @@ -2223,7 +2525,7 @@ struct comp_testvec deflate_comp_tv_template[] = { }, }; -struct comp_testvec deflate_decomp_tv_template[] = { +static struct comp_testvec deflate_decomp_tv_template[] = { { .inlen = 122, .outlen = 191, @@ -2264,7 +2566,7 @@ struct comp_testvec deflate_decomp_tv_template[] = { */ #define MICHAEL_MIC_TEST_VECTORS 6 -struct hash_testvec michael_mic_tv_template[] = +static struct hash_testvec michael_mic_tv_template[] = { { .key = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },