46 void ( *
final ) (
void *
ctx,
void *
out );
89 void ( *
setiv ) (
void *
ctx,
const void *
iv,
size_t ivlen );
172 const void *
signature,
size_t signature_len );
207 const void *
data,
size_t len ) {
218 const void *
key,
size_t keylen ) {
224 const void *
iv,
size_t ivlen ) {
230 const void *
src,
void *dst,
size_t len ) {
233 #define cipher_encrypt( cipher, ctx, src, dst, len ) do { \ 234 assert ( ( (len) & ( (cipher)->blocksize - 1 ) ) == 0 ); \ 235 cipher_encrypt ( (cipher), (ctx), (src), (dst), (len) ); \ 240 const void *
src,
void *dst,
size_t len ) {
243 #define cipher_decrypt( cipher, ctx, src, dst, len ) do { \ 244 assert ( ( (len) & ( (cipher)->blocksize - 1 ) ) == 0 ); \ 245 cipher_decrypt ( (cipher), (ctx), (src), (dst), (len) ); \ 296 const void *
signature,
size_t signature_len ) {
309 const void *
base,
const void *scalar,
void *
result ) {
327 const void *plaintext,
size_t plaintext_len,
330 const void *ciphertext,
size_t ciphertext_len,
338 size_t signature_len );
int(* multiply)(const void *base, const void *scalar, void *result)
Multiply scalar by curve point.
static int is_auth_cipher(struct cipher_algorithm *cipher)
size_t blocksize
Block size.
static void digest_update(struct digest_algorithm *digest, void *ctx, const void *data, size_t len)
static int pubkey_verify(struct pubkey_algorithm *pubkey, const struct asn1_cursor *key, struct digest_algorithm *digest, const void *value, const void *signature, size_t signature_len)
void(* decrypt)(void *ctx, const void *src, void *dst, size_t len)
Decrypt data.
static int elliptic_multiply(struct elliptic_curve *curve, const void *base, const void *scalar, void *result)
struct cipher_algorithm cipher_null
int(* decrypt)(const struct asn1_cursor *key, const void *data, size_t len, void *out)
Decrypt.
static int pubkey_encrypt(struct pubkey_algorithm *pubkey, const struct asn1_cursor *key, const void *data, size_t len, void *out)
int(* encrypt)(const struct asn1_cursor *key, const void *data, size_t len, void *out)
Encrypt.
static void digest_final(struct digest_algorithm *digest, void *ctx, void *out)
void(* init)(void *ctx)
Initialise digest.
size_t alignsize
Alignment size.
void cipher_null_setiv(void *ctx, const void *iv, size_t ivlen)
int pubkey_null_sign(const struct asn1_cursor *key, struct digest_algorithm *digest, const void *value, void *signature)
static int pubkey_decrypt(struct pubkey_algorithm *pubkey, const struct asn1_cursor *key, const void *data, size_t len, void *out)
struct golan_eq_context ctx
void(* final)(void *ctx, void *out)
Finalise digest.
u8 iv[16]
Initialization vector.
static int pubkey_match(struct pubkey_algorithm *pubkey, const struct asn1_cursor *private_key, const struct asn1_cursor *public_key)
int(* sign)(const struct asn1_cursor *key, struct digest_algorithm *digest, const void *value, void *signature)
Sign digest value.
struct digest_algorithm digest_null
int pubkey_null_verify(const struct asn1_cursor *key, struct digest_algorithm *digest, const void *value, const void *signature, size_t signature_len)
void cipher_null_auth(void *ctx, void *auth)
void(* encrypt)(void *ctx, const void *src, void *dst, size_t len)
Encrypt data.
#define cipher_encrypt(cipher, ctx, src, dst, len)
size_t authsize
Authentication tag size.
size_t blocksize
Block size.
void(* setiv)(void *ctx, const void *iv, size_t ivlen)
Set initialisation vector.
void digest_null_update(void *ctx, const void *src, size_t len)
pseudo_bit_t value[0x00020]
void(* update)(void *ctx, const void *src, size_t len)
Update digest with new data.
struct pubkey_algorithm pubkey_null
const char * name
Curve name.
int(* match)(const struct asn1_cursor *private_key, const struct asn1_cursor *public_key)
Check that public key matches private key.
static void digest_init(struct digest_algorithm *digest, void *ctx)
void cipher_null_encrypt(void *ctx, const void *src, void *dst, size_t len)
static void cipher_setiv(struct cipher_algorithm *cipher, void *ctx, const void *iv, size_t ivlen)
void(* auth)(void *ctx, void *auth)
Generate authentication tag.
static int is_stream_cipher(struct cipher_algorithm *cipher)
size_t ctxsize
Context size.
#define cipher_decrypt(cipher, ctx, src, dst, len)
void digest_null_final(void *ctx, void *out)
int(* verify)(const struct asn1_cursor *key, struct digest_algorithm *digest, const void *value, const void *signature, size_t signature_len)
Verify signed digest value.
int pubkey_null_encrypt(const struct asn1_cursor *key, const void *plaintext, size_t plaintext_len, void *ciphertext)
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
size_t ctxsize
Context size.
int(* setkey)(void *ctx, const void *key, size_t keylen)
Set key.
size_t digestsize
Digest size.
const char * name
Algorithm name.
int cipher_null_setkey(void *ctx, const void *key, size_t keylen)
void cipher_null_decrypt(void *ctx, const void *src, void *dst, size_t len)
A message digest algorithm.
uint8_t data[48]
Additional event data.
void digest_null_init(void *ctx)
static void cipher_auth(struct cipher_algorithm *cipher, void *ctx, void *auth)
static size_t pubkey_max_len(struct pubkey_algorithm *pubkey, const struct asn1_cursor *key)
const char * name
Algorithm name.
static int pubkey_sign(struct pubkey_algorithm *pubkey, const struct asn1_cursor *key, struct digest_algorithm *digest, const void *value, void *signature)
u8 signature
CPU signature.
struct private_key private_key
Private key.
size_t(* max_len)(const struct asn1_cursor *key)
Calculate maximum output length.
size_t pubkey_null_max_len(const struct asn1_cursor *key)
const char * name
Algorithm name.
static int cipher_setkey(struct cipher_algorithm *cipher, void *ctx, const void *key, size_t keylen)
static int is_block_cipher(struct cipher_algorithm *cipher)
int pubkey_null_decrypt(const struct asn1_cursor *key, const void *ciphertext, size_t ciphertext_len, void *plaintext)