Skip to content

Commit

Permalink
SCP11: Fix AES decryption test
Browse files Browse the repository at this point in the history
  • Loading branch information
aveenismail committed Nov 28, 2024
1 parent e5d47a4 commit 3f9abfa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/tests/aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 {
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 3f9abfa

Please sign in to comment.