94 &ciphertext ) == 0, file, line );
97 &
test->ciphertext ) == 0, file, line );
104 &plaintext ) == 0, file, line );
106 &
test->plaintext ) == 0, file, line );
117 &ciphertext ) == 0, file, line );
121 &plaintext ) == 0, file, line );
123 &
test->plaintext ) == 0, file, line );
135 &ciphertext ) == 0, file, line );
139 &plaintext ) == 0, file, line );
141 &
test->plaintext ) == 0, file, line );
154 unsigned int line ) {
171 test->plaintext_len );
176 &
test->signature ) == 0, file, line );
183 &cursor ) != 0, file, line );
186 &cursor ) == 0, file, line );
192 &builder ) == 0, file, line );
194 okx ( builder.
len != 0, file, line );
#define NULL
NULL pointer (VOID *).
u8 signature
CPU signature.
int asn1_compare(const struct asn1_cursor *cursor1, const struct asn1_cursor *cursor2)
Compare two ASN.1 objects.
static struct asn1_cursor * asn1_built(struct asn1_builder *builder)
Get cursor for built object.
#define assert(condition)
Assert a condition at run-time.
uint8_t data[48]
Additional event data.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
static int pubkey_match(struct pubkey_algorithm *pubkey, const struct asn1_cursor *private_key, const struct asn1_cursor *public_key)
static void digest_init(struct digest_algorithm *digest, void *ctx)
static void digest_final(struct digest_algorithm *digest, void *ctx, void *out)
static int pubkey_encrypt(struct pubkey_algorithm *pubkey, const struct asn1_cursor *key, const struct asn1_cursor *plaintext, struct asn1_builder *ciphertext)
static int pubkey_verify(struct pubkey_algorithm *pubkey, const struct asn1_cursor *key, struct digest_algorithm *digest, const void *value, const struct asn1_cursor *signature)
static void digest_update(struct digest_algorithm *digest, void *ctx, const void *data, size_t len)
static int pubkey_decrypt(struct pubkey_algorithm *pubkey, const struct asn1_cursor *key, const struct asn1_cursor *ciphertext, struct asn1_builder *plaintext)
static int pubkey_sign(struct pubkey_algorithm *pubkey, const struct asn1_cursor *key, struct digest_algorithm *digest, const void *value, struct asn1_builder *signature)
void * memcpy(void *dest, const void *src, size_t len) __nonnull
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.
static size_t pubkey_random_len
Length of random data input.
int pubkey_test_get_random(void *data, size_t len)
Get random data input.
static const uint8_t * pubkey_random
Random data input.
static void(* free)(struct refcnt *refcnt))
size_t len
Length of data.
A message digest algorithm.
size_t digestsize
Digest size.
size_t ctxsize
Context size.
A public-key signature test.
A public-key encryption and decryption test.
Self-test infrastructure.
#define okx(success, file, line)
Report test result.