Skip to content

Commit fae1b00

Browse files
committed
Replaced AES-GCM test vector with NIST SP 800-38D Test Case 4
1 parent 71a1a0b commit fae1b00

1 file changed

Lines changed: 20 additions & 14 deletions

File tree

tests/testdata.h

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -422,29 +422,35 @@ static const int sizeof_dh_2048_exp = sizeof(dh_2048_exp);
422422
#endif
423423

424424
#ifndef NO_AES
425+
/* NIST SP 800-38D, Test Case 4 */
425426
static const unsigned char aes_gcm_key[16] = {
426-
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
427-
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
427+
0xFE, 0xFF, 0xE9, 0x92, 0x86, 0x65, 0x73, 0x1C,
428+
0x6D, 0x6A, 0x8F, 0x94, 0x67, 0x30, 0x83, 0x08
428429
};
429430
static const unsigned char aes_gcm_iv[12] = {
430-
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
431-
0x00, 0x00, 0x00, 0x00
431+
0xCA, 0xFE, 0xBA, 0xBE, 0xFA, 0xCE, 0xDB, 0xAD,
432+
0xDE, 0xCA, 0xF8, 0x88
432433
};
433-
static const unsigned char aes_gcm_plain[16] = {
434-
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
435-
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
434+
static const unsigned char aes_gcm_plain[32] = {
435+
0xD9, 0x31, 0x32, 0x25, 0xF8, 0x84, 0x06, 0xE5,
436+
0xA5, 0x59, 0x09, 0xC5, 0xAF, 0xF5, 0x26, 0x9A,
437+
0x86, 0xA7, 0xA9, 0x53, 0x15, 0x34, 0xF7, 0xDA,
438+
0x2E, 0x4C, 0x30, 0x3D, 0x8A, 0x31, 0x8A, 0x72
436439
};
437440
static const unsigned char aes_gcm_aad[] = {
438-
0x77, 0x6F, 0x6C, 0x66, 0x50, 0x4B, 0x43, 0x53,
439-
0x31, 0x31, 0x2D, 0x41, 0x41, 0x44
441+
0xFE, 0xED, 0xFA, 0xCE, 0xDE, 0xAD, 0xBE, 0xEF,
442+
0xFE, 0xED, 0xFA, 0xCE, 0xDE, 0xAD, 0xBE, 0xEF,
443+
0xAB, 0xAD, 0xDA, 0xD2
440444
};
441-
static const unsigned char aes_gcm_cipher[16] = {
442-
0x03, 0x88, 0xDA, 0xCE, 0x60, 0xB6, 0xA3, 0x92,
443-
0xF3, 0x28, 0xC2, 0xB9, 0x71, 0xB2, 0xFE, 0x78
445+
static const unsigned char aes_gcm_cipher[32] = {
446+
0x42, 0x83, 0x1E, 0xC2, 0x21, 0x77, 0x74, 0x24,
447+
0x4B, 0x72, 0x21, 0xB7, 0x84, 0xD0, 0xD4, 0x9C,
448+
0xE3, 0xAA, 0x21, 0x2F, 0x2C, 0x02, 0xA4, 0xE0,
449+
0x35, 0xC1, 0x7E, 0x23, 0x29, 0xAC, 0xA1, 0x2E
444450
};
445451
static const unsigned char aes_gcm_tag[16] = {
446-
0x19, 0x0F, 0x28, 0xEF, 0x98, 0x55, 0x46, 0xBE,
447-
0x30, 0x7F, 0xF8, 0x6C, 0x76, 0x6C, 0x47, 0x81
452+
0xE1, 0x3E, 0x14, 0x34, 0x28, 0x5A, 0x94, 0x26,
453+
0xAD, 0xDF, 0xBF, 0xC2, 0x70, 0xD2, 0x7F, 0x16
448454
};
449455

450456
static const unsigned char aes_cbc_key[16] = {

0 commit comments

Comments
 (0)