17#define IKM(...) { __VA_ARGS__ }
20#define SALT(...) { __VA_ARGS__ }
23#define INFO(...) { __VA_ARGS__ }
26#define PRK(...) { __VA_ARGS__ }
29#define PRK_UNSPECIFIED PRK()
32#define OKM(...) { __VA_ARGS__ }
72#define HKDF_TEST( name, DIGEST, SALTED, IKM, SALT, INFO, PRK, OKM ) \
73 static const uint8_t name ## _ikm[] = IKM; \
74 static const uint8_t name ## _salt[] = SALT; \
75 static const uint8_t name ## _info[] = INFO; \
76 static const uint8_t name ## _prk[] = PRK; \
77 static const uint8_t name ## _okm[] = OKM; \
78 static struct hkdf_test name = { \
80 .ikm = name ## _ikm, \
81 .ikm_len = sizeof ( name ## _ikm ), \
82 .salt = ( SALTED ? name ## _salt : NULL ), \
83 .salt_len = sizeof ( name ## _salt ), \
84 .info = name ## _info, \
85 .info_len = sizeof ( name ## _info ), \
86 .prk = name ## _prk, \
87 .prk_len = sizeof ( name ## _prk ), \
88 .okm = name ## _okm, \
89 .okm_len = sizeof ( name ## _okm ), \
100#define hkdf_ok( test ) hkdf_okx ( test, __FILE__, __LINE__ )
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
void hkdf_okx(struct hkdf_test *test, const char *file, unsigned int line)
Report an HKDF test result.
A message digest algorithm.
size_t info_len
Length of additional information.
const void * okm
Expected output keying material.
const void * info
Additional information.
struct digest_algorithm * digest
Digest algorithm.
size_t salt_len
Length of salt.
size_t ikm_len
Length of input keying material.
const void * prk
Expected pseudorandom key.
size_t prk_len
Length of expected pseudorandom key.
const void * ikm
Input keying material.
size_t okm_len
Length of expected output keying material.
Self-test infrastructure.