From 3f9abfa4df1f33826f6e72912cfcc64403095a29 Mon Sep 17 00:00:00 2001 From: Aveen Ismail Date: Thu, 28 Nov 2024 14:30:34 +0100 Subject: [PATCH] SCP11: Fix AES decryption test --- lib/tests/aes.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/tests/aes.c b/lib/tests/aes.c index 8c5b3969..4fad2ee4 100644 --- a/lib/tests/aes.c +++ b/lib/tests/aes.c @@ -54,6 +54,7 @@ struct dec_test_data { uint8_t counter; uint8_t enc_text[64]; uint8_t plain_text[64]; + size_t plain_text_len; } dec_data[] = { {{0xd1, 0xad, 0x52, 0xc5, 0xe8, 0x4d, 0xcc, 0x33, 0x28, 0x26, 0xe5, 0x06, 0xc8, 0x57, 0xef, 0x52}, 8, @@ -64,7 +65,8 @@ struct dec_test_data { {0x53, 0x3b, 0x30, 0x19, 0xd4, 0xe7, 0x39, 0xda, 0x73, 0x9c, 0xed, 0x39, 0xce, 0x73, 0x9d, 0x83, 0x68, 0x58, 0x21, 0x08, 0x42, 0x10, 0x84, 0x21, 0xc8, 0x42, 0x10, 0xc3, 0xeb, 0x34, 0x10, 0x19, 0x9e, 0xe7, 0x77, 0x16, 0x57, 0xcf, 0xde, 0x06, 0x1b, 0x74, 0x57, 0x15, 0x1a, 0xc4, 0x6d, 0x35, 0x08, 0x32, 0x30, 0x33, 0x30, 0x30, - 0x31, 0x30, 0x31, 0x3e, 0x00, 0xfe, 0x00, 0x80, 0x00, 0x00}} + 0x31, 0x30, 0x31, 0x3e, 0x00, 0xfe, 0x00}, + 61} }; struct mac_test_data { @@ -126,7 +128,7 @@ END_TEST START_TEST(test_decryption) { int res = decryption(dec_data[_i].dec_key, dec_data[_i].counter, dec_data[_i].enc_text, - sizeof(dec_data[_i].enc_text), dec_data[_i].plain_text, sizeof(dec_data[_i].plain_text)); + sizeof(dec_data[_i].enc_text), dec_data[_i].plain_text, dec_data[_i].plain_text_len); ck_assert(res == EXIT_SUCCESS); }