48#define PRIVATE(...) { __VA_ARGS__ }
51#define PUBLIC(...) { __VA_ARGS__ }
54#define PLAINTEXT(...) { __VA_ARGS__ }
57#define CIPHERTEXT(...) { __VA_ARGS__ }
60#define SIGNATURE(...) { __VA_ARGS__ }
73#define PUBKEY_TEST( name, PUBKEY, PRIVATE, PUBLIC, PLAINTEXT, \
75 static const uint8_t name ## _private[] = PRIVATE; \
76 static const uint8_t name ## _public[] = PUBLIC; \
77 static const uint8_t name ## _plaintext[] = PLAINTEXT; \
78 static const uint8_t name ## _ciphertext[] = CIPHERTEXT; \
79 static struct pubkey_test name = { \
82 .data = name ## _private, \
83 .len = sizeof ( name ## _private ), \
86 .data = name ## _public, \
87 .len = sizeof ( name ## _public ), \
90 .data = name ## _plaintext, \
91 .len = sizeof ( name ## _plaintext ), \
94 .data = name ## _ciphertext, \
95 .len = sizeof ( name ## _ciphertext ), \
111#define PUBKEY_SIGN_TEST( name, PUBKEY, PRIVATE, PUBLIC, PLAINTEXT, \
112 DIGEST, SIGNATURE ) \
113 static const uint8_t name ## _private[] = PRIVATE; \
114 static const uint8_t name ## _public[] = PUBLIC; \
115 static const uint8_t name ## _plaintext[] = PLAINTEXT; \
116 static const uint8_t name ## _signature[] = SIGNATURE; \
117 static struct pubkey_sign_test name = { \
120 .data = name ## _private, \
121 .len = sizeof ( name ## _private ), \
124 .data = name ## _public, \
125 .len = sizeof ( name ## _public ), \
127 .plaintext = name ## _plaintext, \
128 .plaintext_len = sizeof ( name ## _plaintext ), \
131 .data = name ## _signature, \
132 .len = sizeof ( name ## _signature ), \
137 const char *file,
unsigned int line );
139 const char *file,
unsigned int line );
146#define pubkey_ok( test ) \
147 pubkey_okx ( test, __FILE__, __LINE__ )
154#define pubkey_sign_ok( test ) \
155 pubkey_sign_okx ( test, __FILE__, __LINE__ )
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
void pubkey_okx(struct pubkey_test *test, const char *file, unsigned int line)
Report public key encryption and decryption test result.
void pubkey_sign_okx(struct pubkey_sign_test *test, const char *file, unsigned int line)
Report public key signature test result.
A message digest algorithm.
A public-key signature test.
const struct asn1_cursor public
Public key.
struct pubkey_algorithm * pubkey
Public-key algorithm.
const struct asn1_cursor private
Private key.
struct digest_algorithm * digest
Signature algorithm.
const void * plaintext
Plaintext.
size_t plaintext_len
Plaintext length.
const struct asn1_cursor signature
Signature.
A public-key encryption and decryption test.
const struct asn1_cursor private
Private key.
const struct asn1_cursor public
Public key.
struct pubkey_algorithm * pubkey
Public-key algorithm.
const struct asn1_cursor plaintext
Plaintext.
const struct asn1_cursor ciphertext
Ciphertext.
Self-test infrastructure.