17#define KEY(...) { __VA_ARGS__ }
20#define DATA(...) { __VA_ARGS__ }
23#define EXPECTED(...) { __VA_ARGS__ }
53#define HMAC_TEST( name, DIGEST, KEY, DATA, EXPECTED ) \
54 static const uint8_t name ## _key[] = KEY; \
55 static const uint8_t name ## _data[] = DATA; \
56 static const uint8_t name ## _expected[] = EXPECTED; \
57 static struct hmac_test name = { \
59 .key = name ## _key, \
60 .key_len = sizeof ( name ## _key ), \
61 .data = name ## _data, \
62 .data_len = sizeof ( name ## _data ), \
63 .expected = name ## _expected, \
64 .expected_len = sizeof ( name ## _expected ), \
75#define hmac_ok( test ) hmac_okx ( test, __FILE__, __LINE__ )
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
void hmac_okx(struct hmac_test *test, const char *file, unsigned int line)
Report an HMAC test result.
A message digest algorithm.
size_t expected_len
Length of expected HMAC.
size_t data_len
Length of data.
size_t key_len
Length of key.
const void * expected
Expected HMAC.
struct digest_algorithm * digest
Digest algorithm.
Self-test infrastructure.