1 #ifndef LIB_CRYPTO_AES_TEST_H
2 #define LIB_CRYPTO_AES_TEST_H
4 struct aes_mode_testvector
{
18 #define AES_MODE_TESTVECTOR(_mode, _k, _n, _a, _p, _c, _t) \
20 .K = strhex_to_data_blob(tctx, _k), \
21 .N = strhex_to_data_blob(tctx, _n), \
22 .A = strhex_to_data_blob(tctx, _a), \
23 .P = strhex_to_data_blob(tctx, _p), \
24 .C = strhex_to_data_blob(tctx, _c), \
25 .T = strhex_to_data_blob(tctx, _t), \
28 .location = __location__, \
31 #define aes_mode_testvector_debug(tv, P, C, T) \
32 _aes_mode_testvector_debug(tv, P, C, T, __location__)
33 static inline void _aes_mode_testvector_debug(const struct aes_mode_testvector
*tv
,
39 printf("location: %s\n", location
);
40 printf("TEST: %s\n", tv
->location
);
41 printf("MODE: %s\n", tv
->mode
);
43 dump_data(0, tv
->K
.data
, tv
->K
.length
);
45 dump_data(0, tv
->N
.data
, tv
->N
.length
);
47 dump_data(0, tv
->A
.data
, tv
->A
.length
);
49 dump_data(0, tv
->P
.data
, tv
->P
.length
);
52 dump_data(0, P
->data
, P
->length
);
55 dump_data(0, tv
->C
.data
, tv
->C
.length
);
58 dump_data(0, C
->data
, C
->length
);
61 dump_data(0, tv
->T
.data
, tv
->T
.length
);
64 dump_data(0, T
->data
, T
->length
);
67 #endif /* LIB_CRYPTO_AES_TEST_H */