47 void ( *
final ) (
void *
ctx,
void *
out );
90 void ( *
setiv ) (
void *
ctx,
const void *
iv,
size_t ivlen );
215 int ( *
add ) (
const void *addend,
const void *augend,
void *
result );
225 const void *
data,
size_t len ) {
236 const void *
key,
size_t keylen ) {
242 const void *
iv,
size_t ivlen ) {
248 const void *
src,
void *dst,
size_t len ) {
251#define cipher_encrypt( cipher, ctx, src, dst, len ) do { \
252 assert ( ( (len) & ( (cipher)->blocksize - 1 ) ) == 0 ); \
253 cipher_encrypt ( (cipher), (ctx), (src), (dst), (len) ); \
258 const void *
src,
void *dst,
size_t len ) {
261#define cipher_decrypt( cipher, ctx, src, dst, len ) do { \
262 assert ( ( (len) & ( (cipher)->blocksize - 1 ) ) == 0 ); \
263 cipher_decrypt ( (cipher), (ctx), (src), (dst), (len) ); \
290 return pubkey->
encrypt (
key, plaintext, ciphertext );
297 return pubkey->
decrypt (
key, ciphertext, plaintext );
328 const void *
base,
const void *scalar,
void *
result ) {
334 const void *augend,
void *
result ) {
335 return curve->
add ( addend, augend,
result );
union @162305117151260234136356364136041353210355154177 key
Sense key.
struct golan_eq_context ctx
u8 signature
CPU signature.
pseudo_bit_t value[0x00020]
struct cipher_algorithm cipher_null
struct pubkey_algorithm pubkey_null
struct digest_algorithm digest_null
uint8_t data[48]
Additional event data.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
static int is_block_cipher(struct cipher_algorithm *cipher)
int pubkey_null_decrypt(const struct asn1_cursor *key, const struct asn1_cursor *ciphertext, struct asn1_builder *plaintext)
int pubkey_null_encrypt(const struct asn1_cursor *key, const struct asn1_cursor *plaintext, struct asn1_builder *ciphertext)
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 int elliptic_multiply(struct elliptic_curve *curve, const void *base, const void *scalar, void *result)
void cipher_null_setiv(void *ctx, const void *iv, size_t ivlen)
static int cipher_setkey(struct cipher_algorithm *cipher, void *ctx, const void *key, size_t keylen)
void cipher_null_encrypt(void *ctx, const void *src, void *dst, size_t len)
void digest_null_update(void *ctx, const void *src, size_t len)
static void digest_final(struct digest_algorithm *digest, void *ctx, void *out)
static int elliptic_is_infinity(struct elliptic_curve *curve, const void *point)
static int is_stream_cipher(struct cipher_algorithm *cipher)
static int pubkey_encrypt(struct pubkey_algorithm *pubkey, const struct asn1_cursor *key, const struct asn1_cursor *plaintext, struct asn1_builder *ciphertext)
void cipher_null_decrypt(void *ctx, const void *src, void *dst, size_t len)
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 int elliptic_add(struct elliptic_curve *curve, const void *addend, const void *augend, void *result)
int pubkey_null_verify(const struct asn1_cursor *key, struct digest_algorithm *digest, const void *value, const struct asn1_cursor *signature)
int pubkey_null_sign(const struct asn1_cursor *key, struct digest_algorithm *digest, const void *value, struct asn1_builder *signature)
static void digest_update(struct digest_algorithm *digest, void *ctx, const void *data, size_t len)
static void cipher_setiv(struct cipher_algorithm *cipher, void *ctx, const void *iv, size_t ivlen)
#define cipher_decrypt(cipher, ctx, src, dst, len)
static int pubkey_decrypt(struct pubkey_algorithm *pubkey, const struct asn1_cursor *key, const struct asn1_cursor *ciphertext, struct asn1_builder *plaintext)
void cipher_null_auth(void *ctx, void *auth)
void digest_null_final(void *ctx, void *out)
int cipher_null_setkey(void *ctx, const void *key, size_t keylen)
static int is_auth_cipher(struct cipher_algorithm *cipher)
void digest_null_init(void *ctx)
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 cipher_encrypt(cipher, ctx, src, dst, len)
static void cipher_auth(struct cipher_algorithm *cipher, void *ctx, void *auth)
int(* setkey)(void *ctx, const void *key, size_t keylen)
Set key.
void(* setiv)(void *ctx, const void *iv, size_t ivlen)
Set initialisation vector.
void(* decrypt)(void *ctx, const void *src, void *dst, size_t len)
Decrypt data.
void(* auth)(void *ctx, void *auth)
Generate authentication tag.
void(* encrypt)(void *ctx, const void *src, void *dst, size_t len)
Encrypt data.
const char * name
Algorithm name.
size_t blocksize
Block size.
size_t ctxsize
Context size.
size_t authsize
Authentication tag size.
size_t alignsize
Alignment size.
A message digest algorithm.
size_t digestsize
Digest size.
size_t blocksize
Block size.
void(* init)(void *ctx)
Initialise digest.
size_t ctxsize
Context size.
const char * name
Algorithm name.
void(* final)(void *ctx, void *out)
Finalise digest.
void(* update)(void *ctx, const void *src, size_t len)
Update digest with new data.
int(* is_infinity)(const void *point)
Check if this is the point at infinity.
const void * order
Order of the generator (if prime)
int(* add)(const void *addend, const void *augend, void *result)
Add curve points (as a one-off operation)
const char * name
Curve name.
size_t keysize
Scalar (and private key) size.
size_t pointsize
Point (and public key) size.
const void * base
Generator base point.
int(* multiply)(const void *base, const void *scalar, void *result)
Multiply scalar by curve point.
int(* sign)(const struct asn1_cursor *key, struct digest_algorithm *digest, const void *value, struct asn1_builder *builder)
Sign digest value.
int(* decrypt)(const struct asn1_cursor *key, const struct asn1_cursor *ciphertext, struct asn1_builder *plaintext)
Decrypt.
int(* match)(const struct asn1_cursor *private_key, const struct asn1_cursor *public_key)
Check that public key matches private key.
int(* verify)(const struct asn1_cursor *key, struct digest_algorithm *digest, const void *value, const struct asn1_cursor *signature)
Verify signed digest value.
int(* encrypt)(const struct asn1_cursor *key, const struct asn1_cursor *plaintext, struct asn1_builder *ciphertext)
Encrypt.
const char * name
Algorithm name.
u8 iv[16]
Initialization vector.