diff --git a/tests/api.c b/tests/api.c index eb627a15f2..81e48e1924 100644 --- a/tests/api.c +++ b/tests/api.c @@ -19556,6 +19556,1480 @@ static int test_wc_AesCcmEncryptDecrypt(void) } /* END test_wc_AesCcmEncryptDecrypt */ +#if defined(WOLFSSL_AES_EAX) + +/* + * Testing test_wc_AesEaxVectors() + */ +static int test_wc_AesEaxVectors(void) +{ + EXPECT_DECLS; + + typedef struct { + byte key[AES_256_KEY_SIZE]; + int key_length; + byte iv[AES_BLOCK_SIZE]; + int iv_length; + byte aad[AES_BLOCK_SIZE * 2]; + int aad_length; + byte msg[AES_BLOCK_SIZE * 5]; + int msg_length; + byte ct[AES_BLOCK_SIZE * 5]; + int ct_length; + byte tag[AES_BLOCK_SIZE]; + int tag_length; + int valid; + } AadVector; + + /* Test vectors obtained from Google wycheproof project + * https://github.com/google/wycheproof + * from testvectors/aes_eax_test.json + */ + const AadVector vectors[] = { + { + /* key, key length */ + {0x23, 0x39, 0x52, 0xde, 0xe4, 0xd5, 0xed, 0x5f, + 0x9b, 0x9c, 0x6d, 0x6f, 0xf8, 0x0f, 0xf4, 0x78}, 16, + /* iv, iv length */ + {0x62, 0xec, 0x67, 0xf9, 0xc3, 0xa4, 0xa4, 0x07, + 0xfc, 0xb2, 0xa8, 0xc4, 0x90, 0x31, 0xa8, 0xb3}, 16, + /* aad, aad length */ + {0x6b, 0xfb, 0x91, 0x4f, 0xd0, 0x7e, 0xae, 0x6b}, 8, + /* msg, msg length */ + {0x00}, 0, + /* ct, ct length */ + {0x00}, 0, + /* tag, tag length */ + {0xe0, 0x37, 0x83, 0x0e, 0x83, 0x89, 0xf2, 0x7b, + 0x02, 0x5a, 0x2d, 0x65, 0x27, 0xe7, 0x9d, 0x01}, 16, + /* valid */ + 1, + }, + { + /* key, key length */ + {0x91, 0x94, 0x5d, 0x3f, 0x4d, 0xcb, 0xee, 0x0b, + 0xf4, 0x5e, 0xf5, 0x22, 0x55, 0xf0, 0x95, 0xa4}, 16, + /* iv, iv length */ + {0xbe, 0xca, 0xf0, 0x43, 0xb0, 0xa2, 0x3d, 0x84, + 0x31, 0x94, 0xba, 0x97, 0x2c, 0x66, 0xde, 0xbd}, 16, + /* aad, aad length */ + {0xfa, 0x3b, 0xfd, 0x48, 0x06, 0xeb, 0x53, 0xfa}, 8, + /* msg, msg length */ + {0xf7, 0xfb}, 2, + /* ct, ct length */ + {0x19, 0xdd}, 2, + /* tag, tag length */ + {0x5c, 0x4c, 0x93, 0x31, 0x04, 0x9d, 0x0b, 0xda, + 0xb0, 0x27, 0x74, 0x08, 0xf6, 0x79, 0x67, 0xe5}, 16, + /* valid */ + 1, + }, + { + /* key, key length */ + {0x01, 0xf7, 0x4a, 0xd6, 0x40, 0x77, 0xf2, 0xe7, + 0x04, 0xc0, 0xf6, 0x0a, 0xda, 0x3d, 0xd5, 0x23}, 16, + /* iv, iv length */ + {0x70, 0xc3, 0xdb, 0x4f, 0x0d, 0x26, 0x36, 0x84, + 0x00, 0xa1, 0x0e, 0xd0, 0x5d, 0x2b, 0xff, 0x5e}, 16, + /* aad, aad length */ + {0x23, 0x4a, 0x34, 0x63, 0xc1, 0x26, 0x4a, 0xc6}, 8, + /* msg, msg length */ + {0x1a, 0x47, 0xcb, 0x49, 0x33}, 5, + /* ct, ct length */ + {0xd8, 0x51, 0xd5, 0xba, 0xe0}, 5, + /* tag, tag length */ + {0x3a, 0x59, 0xf2, 0x38, 0xa2, 0x3e, 0x39, 0x19, + 0x9d, 0xc9, 0x26, 0x66, 0x26, 0xc4, 0x0f, 0x80}, 16, + /* valid */ + 1, + }, + { + /* key, key length */ + {0xd0, 0x7c, 0xf6, 0xcb, 0xb7, 0xf3, 0x13, 0xbd, + 0xde, 0x66, 0xb7, 0x27, 0xaf, 0xd3, 0xc5, 0xe8}, 16, + /* iv, iv length */ + {0x84, 0x08, 0xdf, 0xff, 0x3c, 0x1a, 0x2b, 0x12, + 0x92, 0xdc, 0x19, 0x9e, 0x46, 0xb7, 0xd6, 0x17}, 16, + /* aad, aad length */ + {0x33, 0xcc, 0xe2, 0xea, 0xbf, 0xf5, 0xa7, 0x9d}, 8, + /* msg, msg length */ + {0x48, 0x1c, 0x9e, 0x39, 0xb1}, 5, + /* ct, ct length */ + {0x63, 0x2a, 0x9d, 0x13, 0x1a}, 5, + /* tag, tag length */ + {0xd4, 0xc1, 0x68, 0xa4, 0x22, 0x5d, 0x8e, 0x1f, + 0xf7, 0x55, 0x93, 0x99, 0x74, 0xa7, 0xbe, 0xde}, 16, + /* valid */ + 1, + }, + { + /* key, key length */ + {0x35, 0xb6, 0xd0, 0x58, 0x00, 0x05, 0xbb, 0xc1, + 0x2b, 0x05, 0x87, 0x12, 0x45, 0x57, 0xd2, 0xc2}, 16, + /* iv, iv length */ + {0xfd, 0xb6, 0xb0, 0x66, 0x76, 0xee, 0xdc, 0x5c, + 0x61, 0xd7, 0x42, 0x76, 0xe1, 0xf8, 0xe8, 0x16}, 16, + /* aad, aad length */ + {0xae, 0xb9, 0x6e, 0xae, 0xbe, 0x29, 0x70, 0xe9}, 8, + /* msg, msg length */ + {0x40, 0xd0, 0xc0, 0x7d, 0xa5, 0xe4}, 6, + /* ct, ct length */ + {0x07, 0x1d, 0xfe, 0x16, 0xc6, 0x75}, 6, + /* tag, tag length */ + {0xcb, 0x06, 0x77, 0xe5, 0x36, 0xf7, 0x3a, 0xfe, + 0x6a, 0x14, 0xb7, 0x4e, 0xe4, 0x98, 0x44, 0xdd}, 16, + /* valid */ + 1, + }, + { + /* key, key length */ + {0xbd, 0x8e, 0x6e, 0x11, 0x47, 0x5e, 0x60, 0xb2, + 0x68, 0x78, 0x4c, 0x38, 0xc6, 0x2f, 0xeb, 0x22}, 16, + /* iv, iv length */ + {0x6e, 0xac, 0x5c, 0x93, 0x07, 0x2d, 0x8e, 0x85, + 0x13, 0xf7, 0x50, 0x93, 0x5e, 0x46, 0xda, 0x1b}, 16, + /* aad, aad length */ + {0xd4, 0x48, 0x2d, 0x1c, 0xa7, 0x8d, 0xce, 0x0f}, 8, + /* msg, msg length */ + {0x4d, 0xe3, 0xb3, 0x5c, 0x3f, 0xc0, 0x39, 0x24, + 0x5b, 0xd1, 0xfb, 0x7d}, 12, + /* ct, ct length */ + {0x83, 0x5b, 0xb4, 0xf1, 0x5d, 0x74, 0x3e, 0x35, + 0x0e, 0x72, 0x84, 0x14}, 12, + /* tag, tag length */ + {0xab, 0xb8, 0x64, 0x4f, 0xd6, 0xcc, 0xb8, 0x69, + 0x47, 0xc5, 0xe1, 0x05, 0x90, 0x21, 0x0a, 0x4f}, 16, + /* valid */ + 1, + }, + { + /* key, key length */ + {0x7c, 0x77, 0xd6, 0xe8, 0x13, 0xbe, 0xd5, 0xac, + 0x98, 0xba, 0xa4, 0x17, 0x47, 0x7a, 0x2e, 0x7d}, 16, + /* iv, iv length */ + {0x1a, 0x8c, 0x98, 0xdc, 0xd7, 0x3d, 0x38, 0x39, + 0x3b, 0x2b, 0xf1, 0x56, 0x9d, 0xee, 0xfc, 0x19}, 16, + /* aad, aad length */ + {0x65, 0xd2, 0x01, 0x79, 0x90, 0xd6, 0x25, 0x28}, 8, + /* msg, msg length */ + {0x8b, 0x0a, 0x79, 0x30, 0x6c, 0x9c, 0xe7, 0xed, + 0x99, 0xda, 0xe4, 0xf8, 0x7f, 0x8d, 0xd6, 0x16, + 0x36}, 17, + /* ct, ct length */ + {0x02, 0x08, 0x3e, 0x39, 0x79, 0xda, 0x01, 0x48, + 0x12, 0xf5, 0x9f, 0x11, 0xd5, 0x26, 0x30, 0xda, + 0x30}, 17, + /* tag, tag length */ + {0x13, 0x73, 0x27, 0xd1, 0x06, 0x49, 0xb0, 0xaa, + 0x6e, 0x1c, 0x18, 0x1d, 0xb6, 0x17, 0xd7, 0xf2}, 16, + /* valid */ + 1, + }, + { + /* key, key length */ + {0x5f, 0xff, 0x20, 0xca, 0xfa, 0xb1, 0x19, 0xca, + 0x2f, 0xc7, 0x35, 0x49, 0xe2, 0x0f, 0x5b, 0x0d}, 16, + /* iv, iv length */ + {0xdd, 0xe5, 0x9b, 0x97, 0xd7, 0x22, 0x15, 0x6d, + 0x4d, 0x9a, 0xff, 0x2b, 0xc7, 0x55, 0x98, 0x26}, 16, + /* aad, aad length */ + {0x54, 0xb9, 0xf0, 0x4e, 0x6a, 0x09, 0x18, 0x9a}, 8, + /* msg, msg length */ + {0x1b, 0xda, 0x12, 0x2b, 0xce, 0x8a, 0x8d, 0xba, + 0xf1, 0x87, 0x7d, 0x96, 0x2b, 0x85, 0x92, 0xdd, + 0x2d, 0x56}, 18, + /* ct, ct length */ + {0x2e, 0xc4, 0x7b, 0x2c, 0x49, 0x54, 0xa4, 0x89, + 0xaf, 0xc7, 0xba, 0x48, 0x97, 0xed, 0xcd, 0xae, + 0x8c, 0xc3}, 18, + /* tag, tag length */ + {0x3b, 0x60, 0x45, 0x05, 0x99, 0xbd, 0x02, 0xc9, + 0x63, 0x82, 0x90, 0x2a, 0xef, 0x7f, 0x83, 0x2a}, 16, + /* valid */ + 1, + }, + { + /* key, key length */ + {0xa4, 0xa4, 0x78, 0x2b, 0xcf, 0xfd, 0x3e, 0xc5, + 0xe7, 0xef, 0x6d, 0x8c, 0x34, 0xa5, 0x61, 0x23}, 16, + /* iv, iv length */ + {0xb7, 0x81, 0xfc, 0xf2, 0xf7, 0x5f, 0xa5, 0xa8, + 0xde, 0x97, 0xa9, 0xca, 0x48, 0xe5, 0x22, 0xec}, 16, + /* aad, aad length */ + {0x89, 0x9a, 0x17, 0x58, 0x97, 0x56, 0x1d, 0x7e}, 8, + /* msg, msg length */ + {0x6c, 0xf3, 0x67, 0x20, 0x87, 0x2b, 0x85, 0x13, + 0xf6, 0xea, 0xb1, 0xa8, 0xa4, 0x44, 0x38, 0xd5, + 0xef, 0x11}, 18, + /* ct, ct length */ + {0x0d, 0xe1, 0x8f, 0xd0, 0xfd, 0xd9, 0x1e, 0x7a, + 0xf1, 0x9f, 0x1d, 0x8e, 0xe8, 0x73, 0x39, 0x38, + 0xb1, 0xe8}, 18, + /* tag, tag length */ + {0xe7, 0xf6, 0xd2, 0x23, 0x16, 0x18, 0x10, 0x2f, + 0xdb, 0x7f, 0xe5, 0x5f, 0xf1, 0x99, 0x17, 0x00}, 16, + /* valid */ + 1, + }, + { + /* key, key length */ + {0x83, 0x95, 0xfc, 0xf1, 0xe9, 0x5b, 0xeb, 0xd6, + 0x97, 0xbd, 0x01, 0x0b, 0xc7, 0x66, 0xaa, 0xc3}, 16, + /* iv, iv length */ + {0x22, 0xe7, 0xad, 0xd9, 0x3c, 0xfc, 0x63, 0x93, + 0xc5, 0x7e, 0xc0, 0xb3, 0xc1, 0x7d, 0x6b, 0x44}, 16, + /* aad, aad length */ + {0x12, 0x67, 0x35, 0xfc, 0xc3, 0x20, 0xd2, 0x5a}, 8, + /* msg, msg length */ + {0xca, 0x40, 0xd7, 0x44, 0x6e, 0x54, 0x5f, 0xfa, + 0xed, 0x3b, 0xd1, 0x2a, 0x74, 0x0a, 0x65, 0x9f, + 0xfb, 0xbb, 0x3c, 0xea, 0xb7}, 21, + /* ct, ct length */ + {0xcb, 0x89, 0x20, 0xf8, 0x7a, 0x6c, 0x75, 0xcf, + 0xf3, 0x96, 0x27, 0xb5, 0x6e, 0x3e, 0xd1, 0x97, + 0xc5, 0x52, 0xd2, 0x95, 0xa7}, 21, + /* tag, tag length */ + {0xcf, 0xc4, 0x6a, 0xfc, 0x25, 0x3b, 0x46, 0x52, + 0xb1, 0xaf, 0x37, 0x95, 0xb1, 0x24, 0xab, 0x6e}, 16, + /* valid */ + 1, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0x3c, 0x8c, 0xc2, 0x97, 0x0a, 0x00, 0x8f, 0x75, + 0xcc, 0x5b, 0xea, 0xe2, 0x84, 0x72, 0x58, 0xc2}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11}, 32, + /* ct, ct length */ + {0x3c, 0x44, 0x1f, 0x32, 0xce, 0x07, 0x82, 0x23, + 0x64, 0xd7, 0xa2, 0x99, 0x0e, 0x50, 0xbb, 0x13, + 0xd7, 0xb0, 0x2a, 0x26, 0x96, 0x9e, 0x4a, 0x93, + 0x7e, 0x5e, 0x90, 0x73, 0xb0, 0xd9, 0xc9, 0x68}, 32, + /* tag, tag length */ + {0xdb, 0x90, 0xbd, 0xb3, 0xda, 0x3d, 0x00, 0xaf, + 0xd0, 0xfc, 0x6a, 0x83, 0x55, 0x1d, 0xa9, 0x5e}, 16, + /* valid */ + 1, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0xae, 0xf0, 0x3d, 0x00, 0x59, 0x84, 0x94, 0xe9, + 0xfb, 0x03, 0xcd, 0x7d, 0x8b, 0x59, 0x08, 0x66}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11}, 32, + /* ct, ct length */ + {0xd1, 0x9a, 0xc5, 0x98, 0x49, 0x02, 0x6a, 0x91, + 0xaa, 0x1b, 0x9a, 0xec, 0x29, 0xb1, 0x1a, 0x20, + 0x2a, 0x4d, 0x73, 0x9f, 0xd8, 0x6c, 0x28, 0xe3, + 0xae, 0x3d, 0x58, 0x8e, 0xa2, 0x1d, 0x70, 0xc6}, 32, + /* tag, tag length */ + {0xc3, 0x0f, 0x6c, 0xd9, 0x20, 0x20, 0x74, 0xed, + 0x6e, 0x2a, 0x2a, 0x36, 0x0e, 0xac, 0x8c, 0x47}, 16, + /* valid */ + 1, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0x55, 0xd1, 0x25, 0x11, 0xc6, 0x96, 0xa8, 0x0d, + 0x05, 0x14, 0xd1, 0xff, 0xba, 0x49, 0xca, 0xda}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11}, 32, + /* ct, ct length */ + {0x21, 0x08, 0x55, 0x8a, 0xc4, 0xb2, 0xc2, 0xd5, + 0xcc, 0x66, 0xce, 0xa5, 0x1d, 0x62, 0x10, 0xe0, + 0x46, 0x17, 0x7a, 0x67, 0x63, 0x1c, 0xd2, 0xdd, + 0x8f, 0x09, 0x46, 0x97, 0x33, 0xac, 0xb5, 0x17}, 32, + /* tag, tag length */ + {0xfc, 0x35, 0x5e, 0x87, 0xa2, 0x67, 0xbe, 0x3a, + 0xe3, 0xe4, 0x4c, 0x0b, 0xf3, 0xf9, 0x9b, 0x2b}, 16, + /* valid */ + 1, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0x79, 0x42, 0x2d, 0xdd, 0x91, 0xc4, 0xee, 0xe2, + 0xde, 0xae, 0xf1, 0xf9, 0x68, 0x30, 0x53, 0x04}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11}, 32, + /* ct, ct length */ + {0x4d, 0x2c, 0x15, 0x24, 0xca, 0x4b, 0xaa, 0x4e, + 0xef, 0xcc, 0xe6, 0xb9, 0x1b, 0x22, 0x7e, 0xe8, + 0x3a, 0xba, 0xff, 0x81, 0x05, 0xdc, 0xaf, 0xa2, + 0xab, 0x19, 0x1f, 0x5d, 0xf2, 0x57, 0x50, 0x35}, 32, + /* tag, tag length */ + {0xe2, 0xc8, 0x65, 0xce, 0x2d, 0x7a, 0xbd, 0xac, + 0x02, 0x4c, 0x6f, 0x99, 0x1a, 0x84, 0x83, 0x90}, 16, + /* valid */ + 1, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0x0a, 0xf5, 0xaa, 0x7a, 0x76, 0x76, 0xe2, 0x83, + 0x06, 0x30, 0x6b, 0xcd, 0x9b, 0xf2, 0x00, 0x3a}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11}, 32, + /* ct, ct length */ + {0x8e, 0xb0, 0x1e, 0x62, 0x18, 0x5d, 0x78, 0x2e, + 0xb9, 0x28, 0x7a, 0x34, 0x1a, 0x68, 0x62, 0xac, + 0x52, 0x57, 0xd6, 0xf9, 0xad, 0xc9, 0x9e, 0xe0, + 0xa2, 0x4d, 0x9c, 0x22, 0xb3, 0xe9, 0xb3, 0x8a}, 32, + /* tag, tag length */ + {0x39, 0xc3, 0x39, 0xbc, 0x8a, 0x74, 0xc7, 0x5e, + 0x2c, 0x65, 0xc6, 0x11, 0x95, 0x44, 0xd6, 0x1e}, 16, + /* valid */ + 1, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0xaf, 0x5a, 0x03, 0xae, 0x7e, 0xdd, 0x73, 0x47, + 0x1b, 0xdc, 0xdf, 0xac, 0x5e, 0x19, 0x4a, 0x60}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11}, 32, + /* ct, ct length */ + {0x94, 0xc5, 0xd2, 0xac, 0xa6, 0xdb, 0xbc, 0xe8, + 0xc2, 0x45, 0x13, 0xa2, 0x5e, 0x09, 0x5c, 0x0e, + 0x54, 0xa9, 0x42, 0x86, 0x0d, 0x32, 0x7a, 0x22, + 0x2a, 0x81, 0x5c, 0xc7, 0x13, 0xb1, 0x63, 0xb4}, 32, + /* tag, tag length */ + {0xf5, 0x0b, 0x30, 0x30, 0x4e, 0x45, 0xc9, 0xd4, + 0x11, 0xe8, 0xdf, 0x45, 0x08, 0xa9, 0x86, 0x12}, 16, + /* valid */ + 1, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0xb3, 0x70, 0x87, 0x68, 0x0f, 0x0e, 0xdd, 0x5a, + 0x52, 0x22, 0x8b, 0x8c, 0x7a, 0xae, 0xa6, 0x64}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, + 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, + 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, + 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33}, 64, + /* ct, ct length */ + {0x3b, 0xb6, 0x17, 0x3e, 0x37, 0x72, 0xd4, 0xb6, + 0x2e, 0xef, 0x37, 0xf9, 0xef, 0x07, 0x81, 0xf3, + 0x60, 0xb6, 0xc7, 0x4b, 0xe3, 0xbf, 0x6b, 0x37, + 0x10, 0x67, 0xbc, 0x1b, 0x09, 0x0d, 0x9d, 0x66, + 0x22, 0xa1, 0xfb, 0xec, 0x6a, 0xc4, 0x71, 0xb3, + 0x34, 0x9c, 0xd4, 0x27, 0x7a, 0x10, 0x1d, 0x40, + 0x89, 0x0f, 0xbf, 0x27, 0xdf, 0xdc, 0xd0, 0xb4, + 0xe3, 0x78, 0x1f, 0x98, 0x06, 0xda, 0xab, 0xb6}, 64, + /* tag, tag length */ + {0xa0, 0x49, 0x87, 0x45, 0xe5, 0x99, 0x99, 0xdd, + 0xc3, 0x2d, 0x5b, 0x14, 0x02, 0x41, 0x12, 0x4e}, 16, + /* valid */ + 1, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0x4f, 0x80, 0x2d, 0xa6, 0x2a, 0x38, 0x45, 0x55, + 0xa1, 0x9b, 0xc2, 0xb3, 0x82, 0xeb, 0x25, 0xaf}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, + 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, + 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, + 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44}, 80, + /* ct, ct length */ + {0xe9, 0xb0, 0xbb, 0x88, 0x57, 0x81, 0x8c, 0xe3, + 0x20, 0x1c, 0x36, 0x90, 0xd2, 0x1d, 0xaa, 0x7f, + 0x26, 0x4f, 0xb8, 0xee, 0x93, 0xcc, 0x7a, 0x46, + 0x74, 0xea, 0x2f, 0xc3, 0x2b, 0xf1, 0x82, 0xfb, + 0x2a, 0x7e, 0x8a, 0xd5, 0x15, 0x07, 0xad, 0x4f, + 0x31, 0xce, 0xfc, 0x23, 0x56, 0xfe, 0x79, 0x36, + 0xa7, 0xf6, 0xe1, 0x9f, 0x95, 0xe8, 0x8f, 0xdb, + 0xf1, 0x76, 0x20, 0x91, 0x6d, 0x3a, 0x6f, 0x3d, + 0x01, 0xfc, 0x17, 0xd3, 0x58, 0x67, 0x2f, 0x77, + 0x7f, 0xd4, 0x09, 0x92, 0x46, 0xe4, 0x36, 0xe1}, 80, + /* tag, tag length */ + {0x67, 0x91, 0x0b, 0xe7, 0x44, 0xb8, 0x31, 0x5a, + 0xe0, 0xeb, 0x61, 0x24, 0x59, 0x0c, 0x5d, 0x8b}, 16, + /* valid */ + 1, + }, + { + /* key, key length */ + {0xb6, 0x7b, 0x1a, 0x6e, 0xfd, 0xd4, 0x0d, 0x37, + 0x08, 0x0f, 0xbe, 0x8f, 0x80, 0x47, 0xae, 0xb9}, 16, + /* iv, iv length */ + {0xfa, 0x29, 0x4b, 0x12, 0x99, 0x72, 0xf7, 0xfc, + 0x5b, 0xbd, 0x5b, 0x96, 0xbb, 0xa8, 0x37, 0xc9}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x00}, 0, + /* ct, ct length */ + {0x00}, 0, + /* tag, tag length */ + {0xb1, 0x4b, 0x64, 0xfb, 0x58, 0x98, 0x99, 0x69, + 0x95, 0x70, 0xcc, 0x91, 0x60, 0xe3, 0x98, 0x96}, 16, + /* valid */ + 1, + }, + { + /* key, key length */ + {0x20, 0x9e, 0x6d, 0xbf, 0x2a, 0xd2, 0x6a, 0x10, + 0x54, 0x45, 0xfc, 0x02, 0x07, 0xcd, 0x9e, 0x9a}, 16, + /* iv, iv length */ + {0x94, 0x77, 0x84, 0x9d, 0x6c, 0xcd, 0xfc, 0xa1, + 0x12, 0xd9, 0x2e, 0x53, 0xfa, 0xe4, 0xa7, 0xca}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x01}, 1, + /* ct, ct length */ + {0x1d}, 1, + /* tag, tag length */ + {0x52, 0xa5, 0xf6, 0x00, 0xfe, 0x53, 0x38, 0x02, + 0x6a, 0x7c, 0xb0, 0x9c, 0x11, 0x64, 0x00, 0x82}, 16, + /* valid */ + 1, + }, + { + /* key, key length */ + {0xa5, 0x49, 0x44, 0x2e, 0x35, 0x15, 0x40, 0x32, + 0xd0, 0x7c, 0x86, 0x66, 0x00, 0x6a, 0xa6, 0xa2}, 16, + /* iv, iv length */ + {0x51, 0x71, 0x52, 0x45, 0x68, 0xe8, 0x1d, 0x97, + 0xe8, 0xc4, 0xde, 0x4b, 0xa5, 0x6c, 0x10, 0xa0}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x11, 0x82, 0xe9, 0x35, 0x96, 0xca, 0xc5, 0x60, + 0x89, 0x46, 0x40, 0x0b, 0xc7, 0x3f, 0x3a}, 15, + /* ct, ct length */ + {0xd7, 0xb8, 0xa6, 0xb4, 0x3d, 0x2e, 0x9f, 0x98, + 0xc2, 0xb4, 0x4c, 0xe5, 0xe3, 0xcf, 0xdb}, 15, + /* tag, tag length */ + {0x1b, 0xdd, 0x52, 0xfc, 0x98, 0x7d, 0xaf, 0x0e, + 0xe1, 0x92, 0x34, 0xc9, 0x05, 0xea, 0x64, 0x5f}, 16, + /* valid */ + 1, + }, + { + /* key, key length */ + {0x95, 0x8b, 0xcd, 0xb6, 0x6a, 0x39, 0x52, 0xb5, + 0x37, 0x01, 0x58, 0x2a, 0x68, 0xa0, 0xe4, 0x74}, 16, + /* iv, iv length */ + {0x0e, 0x6e, 0xc8, 0x79, 0xb0, 0x2c, 0x6f, 0x51, + 0x69, 0x76, 0xe3, 0x58, 0x98, 0x42, 0x8d, 0xa7}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x14, 0x04, 0x15, 0x82, 0x3e, 0xcc, 0x89, 0x32, + 0xa0, 0x58, 0x38, 0x4b, 0x73, 0x8e, 0xa6, 0xea, + 0x6d, 0x4d, 0xfe, 0x3b, 0xbe, 0xee}, 22, + /* ct, ct length */ + {0x73, 0xe5, 0xc6, 0xf0, 0xe7, 0x03, 0xa5, 0x2d, + 0x02, 0xf7, 0xf7, 0xfa, 0xeb, 0x1b, 0x77, 0xfd, + 0x4f, 0xd0, 0xcb, 0x42, 0x1e, 0xaf}, 22, + /* tag, tag length */ + {0x6c, 0x15, 0x4a, 0x85, 0x96, 0x8e, 0xdd, 0x74, + 0x77, 0x65, 0x75, 0xa4, 0x45, 0x0b, 0xd8, 0x97}, 16, + /* valid */ + 1, + }, + { + /* key, key length */ + {0x96, 0x5b, 0x75, 0x7b, 0xa5, 0x01, 0x8a, 0x8d, + 0x66, 0xed, 0xc7, 0x8e, 0x0c, 0xee, 0xe8, 0x6b}, 16, + /* iv, iv length */ + {0x2e, 0x35, 0x90, 0x1a, 0xe7, 0xd4, 0x91, 0xee, + 0xcc, 0x88, 0x38, 0xfe, 0xdd, 0x63, 0x14, 0x05}, 16, + /* aad, aad length */ + {0xdf, 0x10, 0xd0, 0xd2, 0x12, 0x24, 0x24, 0x50}, 8, + /* msg, msg length */ + {0x36, 0xe5, 0x7a, 0x76, 0x39, 0x58, 0xb0, 0x2c, + 0xea, 0x9d, 0x6a, 0x67, 0x6e, 0xbc, 0xe8, 0x1f}, 16, + /* ct, ct length */ + {0x93, 0x6b, 0x69, 0xb6, 0xc9, 0x55, 0xad, 0xfd, + 0x15, 0x53, 0x9b, 0x9b, 0xe4, 0x98, 0x9c, 0xb6}, 16, + /* tag, tag length */ + {0xee, 0x15, 0xa1, 0x45, 0x4e, 0x88, 0xfa, 0xad, + 0x8e, 0x48, 0xa8, 0xdf, 0x29, 0x83, 0xb4, 0x25}, 16, + /* valid */ + 1, + }, + { + /* key, key length */ + {0x88, 0xd0, 0x20, 0x33, 0x78, 0x1c, 0x7b, 0x41, + 0x64, 0x71, 0x1a, 0x05, 0x42, 0x0f, 0x25, 0x6e}, 16, + /* iv, iv length */ + {0x7f, 0x29, 0x85, 0x29, 0x63, 0x15, 0x50, 0x7a, + 0xa4, 0xc0, 0xa9, 0x3d, 0x5c, 0x12, 0xbd, 0x77}, 16, + /* aad, aad length */ + {0x7c, 0x57, 0x1d, 0x2f, 0xbb, 0x5f, 0x62, 0x52, + 0x3c, 0x0e, 0xb3, 0x38, 0xbe, 0xf9, 0xa9}, 15, + /* msg, msg length */ + {0xd9, 0x8a, 0xdc, 0x03, 0xd9, 0xd5, 0x82, 0x73, + 0x2e, 0xb0, 0x7d, 0xf2, 0x3d, 0x7b, 0x9f, 0x74}, 16, + /* ct, ct length */ + {0x67, 0xca, 0xac, 0x35, 0x44, 0x3a, 0x31, 0x38, + 0xd2, 0xcb, 0x81, 0x1f, 0x0c, 0xe0, 0x4d, 0xd2}, 16, + /* tag, tag length */ + {0xb7, 0x96, 0x8e, 0x0b, 0x56, 0x40, 0xe3, 0xb2, + 0x36, 0x56, 0x96, 0x53, 0x20, 0x8b, 0x9d, 0xeb}, 16, + /* valid */ + 1, + }, + { + /* key, key length */ + {0x51, 0x58, 0x40, 0xcf, 0x67, 0xd2, 0xe4, 0x0e, + 0xb6, 0x5e, 0x54, 0xa2, 0x4c, 0x72, 0xcb, 0xf2}, 16, + /* iv, iv length */ + {0xbf, 0x47, 0xaf, 0xdf, 0xd4, 0x92, 0x13, 0x7a, + 0x24, 0x23, 0x6b, 0xc3, 0x67, 0x97, 0xa8, 0x8e}, 16, + /* aad, aad length */ + {0x16, 0x84, 0x3c, 0x09, 0x1d, 0x43, 0xb0, 0xa1, + 0x91, 0xd0, 0xc7, 0x3d, 0x15, 0x60, 0x1b, 0xe9}, 16, + /* msg, msg length */ + {0xc8, 0x34, 0x58, 0x8c, 0xb6, 0xda, 0xf9, 0xf0, + 0x6d, 0xd2, 0x35, 0x19, 0xf4, 0xbe, 0x9f, 0x56}, 16, + /* ct, ct length */ + {0x20, 0x0a, 0xc4, 0x51, 0xfb, 0xeb, 0x0f, 0x61, + 0x51, 0xd6, 0x15, 0x83, 0xa4, 0x3b, 0x73, 0x43}, 16, + /* tag, tag length */ + {0x2a, 0xd4, 0x3e, 0x4c, 0xaa, 0x51, 0x98, 0x3a, + 0x9d, 0x4d, 0x24, 0x48, 0x1b, 0xf4, 0xc8, 0x39}, 16, + /* valid */ + 1, + }, + { + /* key, key length */ + {0x2e, 0x44, 0x92, 0xd4, 0x44, 0xe5, 0xb6, 0xf4, + 0xce, 0xc8, 0xc2, 0xd3, 0x61, 0x5a, 0xc8, 0x58}, 16, + /* iv, iv length */ + {0xd0, 0x2b, 0xf0, 0x76, 0x3a, 0x9f, 0xef, 0xbf, + 0x70, 0xc3, 0x3a, 0xee, 0x1e, 0x9d, 0xa1, 0xd6}, 16, + /* aad, aad length */ + {0x90, 0x4d, 0x86, 0xf1, 0x33, 0xce, 0xc1, 0x5a, + 0x0c, 0x3c, 0xaf, 0x14, 0xd7, 0xe0, 0x29, 0xc8, + 0x2a, 0x07, 0x70, 0x5a, 0x23, 0xf0, 0xd0, 0x80}, 24, + /* msg, msg length */ + {0x9e, 0x62, 0xd6, 0x51, 0x1b, 0x0b, 0xda, 0x7d, + 0xd7, 0x74, 0x0b, 0x61, 0x4d, 0x97, 0xba, 0xe0}, 16, + /* ct, ct length */ + {0x27, 0xc6, 0xe9, 0xa6, 0x53, 0xc5, 0x25, 0x3c, + 0xa1, 0xc5, 0x67, 0x3f, 0x97, 0xb9, 0xb3, 0x3e}, 16, + /* tag, tag length */ + {0x2d, 0x58, 0x12, 0x71, 0xe1, 0xfa, 0x9e, 0x36, + 0x86, 0x13, 0x6c, 0xaa, 0x8f, 0x4d, 0x6c, 0x8e}, 16, + /* valid */ + 1, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f}, 16, + /* ct, ct length */ + {0x29, 0xa0, 0x91, 0x4f, 0xec, 0x4b, 0xef, 0x54, + 0xba, 0xbf, 0x66, 0x13, 0xa9, 0xf9, 0xcd, 0x70}, 16, + /* tag, tag length */ + {0xe7, 0x0e, 0x7c, 0x50, 0x13, 0xa6, 0xdb, 0xf2, + 0x52, 0x98, 0xb1, 0x92, 0x9b, 0xc3, 0x56, 0xa7}, 16, + /* valid */ + 0, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f}, 16, + /* ct, ct length */ + {0x29, 0xa0, 0x91, 0x4f, 0xec, 0x4b, 0xef, 0x54, + 0xba, 0xbf, 0x66, 0x13, 0xa9, 0xf9, 0xcd, 0x70}, 16, + /* tag, tag length */ + {0xe4, 0x0e, 0x7c, 0x50, 0x13, 0xa6, 0xdb, 0xf2, + 0x52, 0x98, 0xb1, 0x92, 0x9b, 0xc3, 0x56, 0xa7}, 16, + /* valid */ + 0, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f}, 16, + /* ct, ct length */ + {0x29, 0xa0, 0x91, 0x4f, 0xec, 0x4b, 0xef, 0x54, + 0xba, 0xbf, 0x66, 0x13, 0xa9, 0xf9, 0xcd, 0x70}, 16, + /* tag, tag length */ + {0x66, 0x0e, 0x7c, 0x50, 0x13, 0xa6, 0xdb, 0xf2, + 0x52, 0x98, 0xb1, 0x92, 0x9b, 0xc3, 0x56, 0xa7}, 16, + /* valid */ + 0, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f}, 16, + /* ct, ct length */ + {0x29, 0xa0, 0x91, 0x4f, 0xec, 0x4b, 0xef, 0x54, + 0xba, 0xbf, 0x66, 0x13, 0xa9, 0xf9, 0xcd, 0x70}, 16, + /* tag, tag length */ + {0xe6, 0x0f, 0x7c, 0x50, 0x13, 0xa6, 0xdb, 0xf2, + 0x52, 0x98, 0xb1, 0x92, 0x9b, 0xc3, 0x56, 0xa7}, 16, + /* valid */ + 0, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f}, 16, + /* ct, ct length */ + {0x29, 0xa0, 0x91, 0x4f, 0xec, 0x4b, 0xef, 0x54, + 0xba, 0xbf, 0x66, 0x13, 0xa9, 0xf9, 0xcd, 0x70}, 16, + /* tag, tag length */ + {0xe6, 0x0e, 0x7c, 0xd0, 0x13, 0xa6, 0xdb, 0xf2, + 0x52, 0x98, 0xb1, 0x92, 0x9b, 0xc3, 0x56, 0xa7}, 16, + /* valid */ + 0, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f}, 16, + /* ct, ct length */ + {0x29, 0xa0, 0x91, 0x4f, 0xec, 0x4b, 0xef, 0x54, + 0xba, 0xbf, 0x66, 0x13, 0xa9, 0xf9, 0xcd, 0x70}, 16, + /* tag, tag length */ + {0xe6, 0x0e, 0x7c, 0x50, 0x12, 0xa6, 0xdb, 0xf2, + 0x52, 0x98, 0xb1, 0x92, 0x9b, 0xc3, 0x56, 0xa7}, 16, + /* valid */ + 0, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f}, 16, + /* ct, ct length */ + {0x29, 0xa0, 0x91, 0x4f, 0xec, 0x4b, 0xef, 0x54, + 0xba, 0xbf, 0x66, 0x13, 0xa9, 0xf9, 0xcd, 0x70}, 16, + /* tag, tag length */ + {0xe6, 0x0e, 0x7c, 0x50, 0x11, 0xa6, 0xdb, 0xf2, + 0x52, 0x98, 0xb1, 0x92, 0x9b, 0xc3, 0x56, 0xa7}, 16, + /* valid */ + 0, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f}, 16, + /* ct, ct length */ + {0x29, 0xa0, 0x91, 0x4f, 0xec, 0x4b, 0xef, 0x54, + 0xba, 0xbf, 0x66, 0x13, 0xa9, 0xf9, 0xcd, 0x70}, 16, + /* tag, tag length */ + {0xe6, 0x0e, 0x7c, 0x50, 0x13, 0xa6, 0xdb, 0x72, + 0x52, 0x98, 0xb1, 0x92, 0x9b, 0xc3, 0x56, 0xa7}, 16, + /* valid */ + 0, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f}, 16, + /* ct, ct length */ + {0x29, 0xa0, 0x91, 0x4f, 0xec, 0x4b, 0xef, 0x54, + 0xba, 0xbf, 0x66, 0x13, 0xa9, 0xf9, 0xcd, 0x70}, 16, + /* tag, tag length */ + {0xe6, 0x0e, 0x7c, 0x50, 0x13, 0xa6, 0xdb, 0xf2, + 0x53, 0x98, 0xb1, 0x92, 0x9b, 0xc3, 0x56, 0xa7}, 16, + /* valid */ + 0, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f}, 16, + /* ct, ct length */ + {0x29, 0xa0, 0x91, 0x4f, 0xec, 0x4b, 0xef, 0x54, + 0xba, 0xbf, 0x66, 0x13, 0xa9, 0xf9, 0xcd, 0x70}, 16, + /* tag, tag length */ + {0xe6, 0x0e, 0x7c, 0x50, 0x13, 0xa6, 0xdb, 0xf2, + 0xd2, 0x98, 0xb1, 0x92, 0x9b, 0xc3, 0x56, 0xa7}, 16, + /* valid */ + 0, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f}, 16, + /* ct, ct length */ + {0x29, 0xa0, 0x91, 0x4f, 0xec, 0x4b, 0xef, 0x54, + 0xba, 0xbf, 0x66, 0x13, 0xa9, 0xf9, 0xcd, 0x70}, 16, + /* tag, tag length */ + {0xe6, 0x0e, 0x7c, 0x50, 0x13, 0xa6, 0xdb, 0xf2, + 0x52, 0xb8, 0xb1, 0x92, 0x9b, 0xc3, 0x56, 0xa7}, 16, + /* valid */ + 0, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f}, 16, + /* ct, ct length */ + {0x29, 0xa0, 0x91, 0x4f, 0xec, 0x4b, 0xef, 0x54, + 0xba, 0xbf, 0x66, 0x13, 0xa9, 0xf9, 0xcd, 0x70}, 16, + /* tag, tag length */ + {0xe6, 0x0e, 0x7c, 0x50, 0x13, 0xa6, 0xdb, 0xf2, + 0x52, 0x98, 0xb0, 0x92, 0x9b, 0xc3, 0x56, 0xa7}, 16, + /* valid */ + 0, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f}, 16, + /* ct, ct length */ + {0x29, 0xa0, 0x91, 0x4f, 0xec, 0x4b, 0xef, 0x54, + 0xba, 0xbf, 0x66, 0x13, 0xa9, 0xf9, 0xcd, 0x70}, 16, + /* tag, tag length */ + {0xe6, 0x0e, 0x7c, 0x50, 0x13, 0xa6, 0xdb, 0xf2, + 0x52, 0x98, 0xb1, 0x92, 0x9a, 0xc3, 0x56, 0xa7}, 16, + /* valid */ + 0, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f}, 16, + /* ct, ct length */ + {0x29, 0xa0, 0x91, 0x4f, 0xec, 0x4b, 0xef, 0x54, + 0xba, 0xbf, 0x66, 0x13, 0xa9, 0xf9, 0xcd, 0x70}, 16, + /* tag, tag length */ + {0xe6, 0x0e, 0x7c, 0x50, 0x13, 0xa6, 0xdb, 0xf2, + 0x52, 0x98, 0xb1, 0x92, 0x99, 0xc3, 0x56, 0xa7}, 16, + /* valid */ + 0, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f}, 16, + /* ct, ct length */ + {0x29, 0xa0, 0x91, 0x4f, 0xec, 0x4b, 0xef, 0x54, + 0xba, 0xbf, 0x66, 0x13, 0xa9, 0xf9, 0xcd, 0x70}, 16, + /* tag, tag length */ + {0xe6, 0x0e, 0x7c, 0x50, 0x13, 0xa6, 0xdb, 0xf2, + 0x52, 0x98, 0xb1, 0x92, 0x1b, 0xc3, 0x56, 0xa7}, 16, + /* valid */ + 0, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f}, 16, + /* ct, ct length */ + {0x29, 0xa0, 0x91, 0x4f, 0xec, 0x4b, 0xef, 0x54, + 0xba, 0xbf, 0x66, 0x13, 0xa9, 0xf9, 0xcd, 0x70}, 16, + /* tag, tag length */ + {0xe6, 0x0e, 0x7c, 0x50, 0x13, 0xa6, 0xdb, 0xf2, + 0x52, 0x98, 0xb1, 0x92, 0x9b, 0xc3, 0x56, 0xa6}, 16, + /* valid */ + 0, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f}, 16, + /* ct, ct length */ + {0x29, 0xa0, 0x91, 0x4f, 0xec, 0x4b, 0xef, 0x54, + 0xba, 0xbf, 0x66, 0x13, 0xa9, 0xf9, 0xcd, 0x70}, 16, + /* tag, tag length */ + {0xe6, 0x0e, 0x7c, 0x50, 0x13, 0xa6, 0xdb, 0xf2, + 0x52, 0x98, 0xb1, 0x92, 0x9b, 0xc3, 0x56, 0xa5}, 16, + /* valid */ + 0, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f}, 16, + /* ct, ct length */ + {0x29, 0xa0, 0x91, 0x4f, 0xec, 0x4b, 0xef, 0x54, + 0xba, 0xbf, 0x66, 0x13, 0xa9, 0xf9, 0xcd, 0x70}, 16, + /* tag, tag length */ + {0xe6, 0x0e, 0x7c, 0x50, 0x13, 0xa6, 0xdb, 0xf2, + 0x52, 0x98, 0xb1, 0x92, 0x9b, 0xc3, 0x56, 0xe7}, 16, + /* valid */ + 0, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f}, 16, + /* ct, ct length */ + {0x29, 0xa0, 0x91, 0x4f, 0xec, 0x4b, 0xef, 0x54, + 0xba, 0xbf, 0x66, 0x13, 0xa9, 0xf9, 0xcd, 0x70}, 16, + /* tag, tag length */ + {0xe6, 0x0e, 0x7c, 0x50, 0x13, 0xa6, 0xdb, 0xf2, + 0x52, 0x98, 0xb1, 0x92, 0x9b, 0xc3, 0x56, 0x27}, 16, + /* valid */ + 0, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f}, 16, + /* ct, ct length */ + {0x29, 0xa0, 0x91, 0x4f, 0xec, 0x4b, 0xef, 0x54, + 0xba, 0xbf, 0x66, 0x13, 0xa9, 0xf9, 0xcd, 0x70}, 16, + /* tag, tag length */ + {0xe7, 0x0e, 0x7c, 0x50, 0x13, 0xa6, 0xdb, 0xf2, + 0x53, 0x98, 0xb1, 0x92, 0x9b, 0xc3, 0x56, 0xa7}, 16, + /* valid */ + 0, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f}, 16, + /* ct, ct length */ + {0x29, 0xa0, 0x91, 0x4f, 0xec, 0x4b, 0xef, 0x54, + 0xba, 0xbf, 0x66, 0x13, 0xa9, 0xf9, 0xcd, 0x70}, 16, + /* tag, tag length */ + {0xe6, 0x0e, 0x7c, 0xd0, 0x13, 0xa6, 0xdb, 0x72, + 0x52, 0x98, 0xb1, 0x92, 0x9b, 0xc3, 0x56, 0xa7}, 16, + /* valid */ + 0, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f}, 16, + /* ct, ct length */ + {0x29, 0xa0, 0x91, 0x4f, 0xec, 0x4b, 0xef, 0x54, + 0xba, 0xbf, 0x66, 0x13, 0xa9, 0xf9, 0xcd, 0x70}, 16, + /* tag, tag length */ + {0xe6, 0x0e, 0x7c, 0x50, 0x13, 0xa6, 0xdb, 0x72, + 0x52, 0x98, 0xb1, 0x92, 0x9b, 0xc3, 0x56, 0x27}, 16, + /* valid */ + 0, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f}, 16, + /* ct, ct length */ + {0x29, 0xa0, 0x91, 0x4f, 0xec, 0x4b, 0xef, 0x54, + 0xba, 0xbf, 0x66, 0x13, 0xa9, 0xf9, 0xcd, 0x70}, 16, + /* tag, tag length */ + {0x19, 0xf1, 0x83, 0xaf, 0xec, 0x59, 0x24, 0x0d, + 0xad, 0x67, 0x4e, 0x6d, 0x64, 0x3c, 0xa9, 0x58}, 16, + /* valid */ + 0, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f}, 16, + /* ct, ct length */ + {0x29, 0xa0, 0x91, 0x4f, 0xec, 0x4b, 0xef, 0x54, + 0xba, 0xbf, 0x66, 0x13, 0xa9, 0xf9, 0xcd, 0x70}, 16, + /* tag, tag length */ + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 16, + /* valid */ + 0, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f}, 16, + /* ct, ct length */ + {0x29, 0xa0, 0x91, 0x4f, 0xec, 0x4b, 0xef, 0x54, + 0xba, 0xbf, 0x66, 0x13, 0xa9, 0xf9, 0xcd, 0x70}, 16, + /* tag, tag length */ + {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, 16, + /* valid */ + 0, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f}, 16, + /* ct, ct length */ + {0x29, 0xa0, 0x91, 0x4f, 0xec, 0x4b, 0xef, 0x54, + 0xba, 0xbf, 0x66, 0x13, 0xa9, 0xf9, 0xcd, 0x70}, 16, + /* tag, tag length */ + {0x66, 0x8e, 0xfc, 0xd0, 0x93, 0x26, 0x5b, 0x72, + 0xd2, 0x18, 0x31, 0x12, 0x1b, 0x43, 0xd6, 0x27}, 16, + /* valid */ + 0, + }, + { + /* key, key length */ + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, 16, + /* iv, iv length */ + {0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f}, 16, + /* aad, aad length */ + {0x00}, 0, + /* msg, msg length */ + {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f}, 16, + /* ct, ct length */ + {0x29, 0xa0, 0x91, 0x4f, 0xec, 0x4b, 0xef, 0x54, + 0xba, 0xbf, 0x66, 0x13, 0xa9, 0xf9, 0xcd, 0x70}, 16, + /* tag, tag length */ + {0xe7, 0x0f, 0x7d, 0x51, 0x12, 0xa7, 0xda, 0xf3, + 0x53, 0x99, 0xb0, 0x93, 0x9a, 0xc2, 0x57, 0xa6}, 16, + /* valid */ + 0, + }, + }; + + byte ciphertext[sizeof(vectors[0].ct)]; + byte authtag[sizeof(vectors[0].tag)]; + int i; + int len; + int ret; + + + for (i = 0; i < (int)(sizeof(vectors)/sizeof(vectors[0])); i++) { + + XMEMSET(ciphertext, 0, sizeof(ciphertext)); + + len = sizeof(authtag); + ExpectIntEQ(wc_AesEaxEncryptAuth(vectors[i].key, vectors[i].key_length, + ciphertext, + vectors[i].msg, vectors[i].msg_length, + vectors[i].iv, vectors[i].iv_length, + authtag, len, + vectors[i].aad, vectors[i].aad_length), + 0); + + /* check ciphertext matches vector */ + ExpectIntEQ(XMEMCMP(ciphertext, vectors[i].ct, vectors[i].ct_length), + 0); + + /* check that computed tag matches vector only for vectors marked as valid */ + ret = XMEMCMP(authtag, vectors[i].tag, len); + if (vectors[i].valid) { + ExpectIntEQ(ret, 0); + } + else { + ExpectIntNE(ret, 0); + } + + XMEMSET(ciphertext, 0, sizeof(ciphertext)); + + /* Decrypt, checking that the computed auth tags match */ + ExpectIntEQ(wc_AesEaxDecryptAuth(vectors[i].key, vectors[i].key_length, + ciphertext, + vectors[i].ct, vectors[i].ct_length, + vectors[i].iv, vectors[i].iv_length, + authtag, len, + vectors[i].aad, vectors[i].aad_length), + 0); + + /* check decrypted ciphertext matches vector plaintext */ + ExpectIntEQ(XMEMCMP(ciphertext, vectors[i].msg, vectors[i].msg_length), + 0); + } + return EXPECT_RESULT(); +} /* END test_wc_AesEaxVectors */ + + +/* + * Testing test_wc_AesEaxEncryptAuth() + */ +static int test_wc_AesEaxEncryptAuth(void) +{ + EXPECT_DECLS; + + const byte 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}; + const byte iv[] = {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}; + const byte aad[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}; + const byte msg[] = {0x00, 0x01, 0x02, 0x03, 0x04}; + + byte ciphertext[sizeof(msg)]; + byte authtag[AES_BLOCK_SIZE]; + int i; + int len; + + len = sizeof(authtag); + ExpectIntEQ(wc_AesEaxEncryptAuth(key, sizeof(key), + ciphertext, + msg, sizeof(msg), + iv, sizeof(iv), + authtag, len, + aad, sizeof(aad)), + 0); + + /* Test null checking */ + ExpectIntEQ(wc_AesEaxEncryptAuth(NULL, sizeof(key), + ciphertext, + msg, sizeof(msg), + iv, sizeof(iv), + authtag, len, + aad, sizeof(aad)), + BAD_FUNC_ARG); + ExpectIntEQ(wc_AesEaxEncryptAuth(key, sizeof(key), + NULL, + msg, sizeof(msg), + iv, sizeof(iv), + authtag, len, + aad, sizeof(aad)), + BAD_FUNC_ARG); + ExpectIntEQ(wc_AesEaxEncryptAuth(key, sizeof(key), + ciphertext, + NULL, sizeof(msg), + iv, sizeof(iv), + authtag, len, + aad, sizeof(aad)), + BAD_FUNC_ARG); + ExpectIntEQ(wc_AesEaxEncryptAuth(key, sizeof(key), + ciphertext, + msg, sizeof(msg), + NULL, sizeof(iv), + authtag, len, + aad, sizeof(aad)), + BAD_FUNC_ARG); + ExpectIntEQ(wc_AesEaxEncryptAuth(key, sizeof(key), + ciphertext, + msg, sizeof(msg), + iv, sizeof(iv), + NULL, len, + aad, sizeof(aad)), + BAD_FUNC_ARG); + ExpectIntEQ(wc_AesEaxEncryptAuth(key, sizeof(key), + ciphertext, + msg, sizeof(msg), + iv, sizeof(iv), + authtag, len, + NULL, sizeof(aad)), + BAD_FUNC_ARG); + + /* Test bad key lengths */ + for (i = 0; i <= 32; i++) { + int exp_ret; + if (i == AES_128_KEY_SIZE || i == AES_192_KEY_SIZE + || i == AES_256_KEY_SIZE) { + exp_ret = 0; + } + else { + exp_ret = BAD_FUNC_ARG; + } + + ExpectIntEQ(wc_AesEaxEncryptAuth(key, i, + ciphertext, + msg, sizeof(msg), + iv, sizeof(iv), + authtag, len, + aad, sizeof(aad)), + exp_ret); + } + + + /* Test auth tag size out of range */ + len = AES_BLOCK_SIZE + 1; + ExpectIntEQ(wc_AesEaxEncryptAuth(key, sizeof(key), + ciphertext, + msg, sizeof(msg), + iv, sizeof(iv), + authtag, len, + aad, sizeof(aad)), + BAD_FUNC_ARG); + + return EXPECT_RESULT(); +} /* END test_wc_AesEaxEncryptAuth() */ + + +/* + * Testing test_wc_AesEaxDecryptAuth() + */ +static int test_wc_AesEaxDecryptAuth(void) +{ + EXPECT_DECLS; + + const byte 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}; + const byte iv[] = {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}; + const byte aad[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}; + const byte ct[] = {0x00, 0x01, 0x02, 0x03, 0x04}; + /* Garbage tag that should always fail for above aad */ + const byte tag[] = {0xFE, 0xED, 0xBE, 0xEF, 0xDE, 0xAD, 0xC0, 0xDE, + 0xCA, 0xFE, 0xBE, 0xEF, 0xDE, 0xAF, 0xBE, 0xEF}; + + byte plaintext[sizeof(ct)]; + int i; + int len; + + len = sizeof(tag); + ExpectIntEQ(wc_AesEaxDecryptAuth(key, sizeof(key), + plaintext, + ct, sizeof(ct), + iv, sizeof(iv), + tag, len, + aad, sizeof(aad)), + AES_EAX_AUTH_E); + + /* Test null checking */ + ExpectIntEQ(wc_AesEaxDecryptAuth(NULL, sizeof(key), + plaintext, + ct, sizeof(ct), + iv, sizeof(iv), + tag, len, + aad, sizeof(aad)), + BAD_FUNC_ARG); + ExpectIntEQ(wc_AesEaxDecryptAuth(key, sizeof(key), + NULL, + ct, sizeof(ct), + iv, sizeof(iv), + tag, len, + aad, sizeof(aad)), + BAD_FUNC_ARG); + ExpectIntEQ(wc_AesEaxDecryptAuth(key, sizeof(key), + plaintext, + NULL, sizeof(ct), + iv, sizeof(iv), + tag, len, + aad, sizeof(aad)), + BAD_FUNC_ARG); + ExpectIntEQ(wc_AesEaxDecryptAuth(key, sizeof(key), + plaintext, + ct, sizeof(ct), + NULL, sizeof(iv), + tag, len, + aad, sizeof(aad)), + BAD_FUNC_ARG); + ExpectIntEQ(wc_AesEaxDecryptAuth(key, sizeof(key), + plaintext, + ct, sizeof(ct), + iv, sizeof(iv), + NULL, len, + aad, sizeof(aad)), + BAD_FUNC_ARG); + ExpectIntEQ(wc_AesEaxDecryptAuth(key, sizeof(key), + plaintext, + ct, sizeof(ct), + iv, sizeof(iv), + tag, len, + NULL, sizeof(aad)), + BAD_FUNC_ARG); + + /* Test bad key lengths */ + for (i = 0; i <= 32; i++) { + int exp_ret; + if (i == AES_128_KEY_SIZE || i == AES_192_KEY_SIZE + || i == AES_256_KEY_SIZE) { + exp_ret = AES_EAX_AUTH_E; + } + else { + exp_ret = BAD_FUNC_ARG; + } + + ExpectIntEQ(wc_AesEaxDecryptAuth(key, i, + plaintext, + ct, sizeof(ct), + iv, sizeof(iv), + tag, len, + aad, sizeof(aad)), + exp_ret); + } + + + /* Test auth tag size out of range */ + len = AES_BLOCK_SIZE + 1; + ExpectIntEQ(wc_AesEaxDecryptAuth(key, sizeof(key), + plaintext, + ct, sizeof(ct), + iv, sizeof(iv), + tag, len, + aad, sizeof(aad)), + BAD_FUNC_ARG); + + return EXPECT_RESULT(); +} /* END test_wc_AesEaxDecryptAuth() */ + +#endif /* defined(WOLFSSL_AES_EAX) */ + /* * Testing wc_InitDsaKey() */ @@ -65740,6 +67214,11 @@ TEST_CASE testCases[] = { TEST_DECL(test_wc_GmacUpdate), TEST_DECL(test_wc_AesCcmSetKey), TEST_DECL(test_wc_AesCcmEncryptDecrypt), +#if defined(WOLFSSL_AES_EAX) + TEST_DECL(test_wc_AesEaxVectors), + TEST_DECL(test_wc_AesEaxEncryptAuth), + TEST_DECL(test_wc_AesEaxDecryptAuth), +#endif /* WOLFSSL_AES_EAX */ /* SM4 cipher */ TEST_DECL(test_wc_Sm4),