64 &plaintext ) == 0, file, line );
66 &
test->plaintext ) == 0, file, line );
75 &ciphertext ) == 0, file, line );
78 &plaintext ) == 0, file, line );
80 &
test->plaintext ) == 0, file, line );
90 &ciphertext ) == 0, file, line );
93 &plaintext ) == 0, file, line );
95 &
test->plaintext ) == 0, file, line );
108 unsigned int line ) {
123 test->plaintext_len );
131 &
test->signature ) == 0, file, line );
135 &
test->signature ) == 0, file, line );
static void digest_update(struct digest_algorithm *digest, void *ctx, const void *data, size_t len)
int asn1_compare(const struct asn1_cursor *cursor1, const struct asn1_cursor *cursor2)
Compare two ASN.1 objects.
void pubkey_okx(struct pubkey_test *test, const char *file, unsigned int line)
Report public key encryption and decryption test result.
static void digest_final(struct digest_algorithm *digest, void *ctx, void *out)
A public-key encryption and decryption test.
Self-test infrastructure.
void pubkey_sign_okx(struct pubkey_sign_test *test, const char *file, unsigned int line)
Report public key signature test result.
static int pubkey_match(struct pubkey_algorithm *pubkey, const struct asn1_cursor *private_key, const struct asn1_cursor *public_key)
A public-key signature test.
static int pubkey_sign(struct pubkey_algorithm *pubkey, const struct asn1_cursor *key, struct digest_algorithm *digest, const void *value, struct asn1_builder *signature)
#define okx(success, file, line)
Report test result.
static void digest_init(struct digest_algorithm *digest, void *ctx)
static void(* free)(struct refcnt *refcnt))
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
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)
size_t ctxsize
Context size.
static int pubkey_encrypt(struct pubkey_algorithm *pubkey, const struct asn1_cursor *key, const struct asn1_cursor *plaintext, struct asn1_builder *ciphertext)
size_t digestsize
Digest size.
A message digest algorithm.
static struct asn1_cursor * asn1_built(struct asn1_builder *builder)
Get cursor for built object.
u8 signature
CPU signature.
#define NULL
NULL pointer (VOID *)
size_t len
Length of data.
static int pubkey_decrypt(struct pubkey_algorithm *pubkey, const struct asn1_cursor *key, const struct asn1_cursor *ciphertext, struct asn1_builder *plaintext)