iPXE
crypto.h File Reference

Cryptographic API. More...

#include <stdint.h>
#include <stddef.h>
#include <assert.h>
#include <ipxe/asn1.h>

Go to the source code of this file.

Data Structures

struct  digest_algorithm
 A message digest algorithm. More...
struct  cipher_algorithm
 A cipher algorithm. More...
struct  pubkey_algorithm
 A public key algorithm. More...
struct  exchange_algorithm
 A key exchange algorithm. More...
struct  elliptic_curve
 An elliptic curve. More...

Macros

#define cipher_encrypt(cipher, ctx, src, dst, len)
#define cipher_decrypt(cipher, ctx, src, dst, len)

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 FILE_SECBOOT (PERMITTED)
static void digest_init (struct digest_algorithm *digest, void *ctx)
static void digest_update (struct digest_algorithm *digest, void *ctx, const void *data, size_t len)
static void digest_final (struct digest_algorithm *digest, void *ctx, void *out)
static int cipher_setkey (struct cipher_algorithm *cipher, void *ctx, const void *key, size_t keylen)
static int cipher_setiv (struct cipher_algorithm *cipher, void *ctx, const void *iv, size_t ivlen)
static void cipher_encrypt (struct cipher_algorithm *cipher, void *ctx, const void *src, void *dst, size_t len)
static void cipher_decrypt (struct cipher_algorithm *cipher, void *ctx, const void *src, void *dst, size_t len)
static void cipher_auth (struct cipher_algorithm *cipher, void *ctx, void *auth)
static int is_stream_cipher (struct cipher_algorithm *cipher)
static int is_block_cipher (struct cipher_algorithm *cipher)
static int is_auth_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)
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)
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 pubkey_match (struct pubkey_algorithm *pubkey, const struct asn1_cursor *private_key, const struct asn1_cursor *public_key)
static int exchange_share (struct exchange_algorithm *exchange, const void *private, void *public)
static int exchange_agree (struct exchange_algorithm *exchange, const void *private, const void *partner, void *shared)
static int is_key_transport (struct exchange_algorithm *exchange)
static int elliptic_is_infinity (struct elliptic_curve *curve, const void *point)
static int elliptic_multiply (struct elliptic_curve *curve, const void *base, const void *scalar, void *result)
static int elliptic_add (struct elliptic_curve *curve, const void *addend, const void *augend, void *result)
void digest_null_init (struct digest_algorithm *digest, void *ctx)
void digest_null_update (struct digest_algorithm *digest, void *ctx, const void *src, size_t len)
void digest_null_final (struct digest_algorithm *digest, void *ctx, void *out)
int cipher_null_setkey (struct cipher_algorithm *cipher, void *ctx, const void *key, size_t keylen)
int cipher_null_setiv (struct cipher_algorithm *cipehr, void *ctx, const void *iv, size_t ivlen)
void cipher_null_encrypt (struct cipher_algorithm *cipher, void *ctx, const void *src, void *dst, size_t len)
void cipher_null_decrypt (struct cipher_algorithm *cipher, void *ctx, const void *src, void *dst, size_t len)
void cipher_null_auth (struct cipher_algorithm *cipher, void *ctx, void *auth)
int pubkey_null_encrypt (struct pubkey_algorithm *pubkey, const struct asn1_cursor *key, const struct asn1_cursor *plaintext, struct asn1_builder *ciphertext)
int pubkey_null_decrypt (struct pubkey_algorithm *pubkey, const struct asn1_cursor *key, const struct asn1_cursor *ciphertext, struct asn1_builder *plaintext)
int pubkey_null_sign (struct pubkey_algorithm *pubkey, const struct asn1_cursor *key, struct digest_algorithm *digest, const void *value, struct asn1_builder *signature)
int pubkey_null_verify (struct pubkey_algorithm *pubkey, const struct asn1_cursor *key, struct digest_algorithm *digest, const void *value, const struct asn1_cursor *signature)
int pubkey_null_match (struct pubkey_algorithm *pubkey, const struct asn1_cursor *private_key, const struct asn1_cursor *public_key)
int exchange_null_share (struct exchange_algorithm *exchange, const void *private, void *public)
int exchange_null_agree (struct exchange_algorithm *exchange, const void *private, const void *partner, void *shared)

Variables

struct digest_algorithm digest_null
struct cipher_algorithm cipher_null
struct pubkey_algorithm pubkey_null
struct exchange_algorithm exchange_null

Detailed Description

Cryptographic API.

Definition in file crypto.h.

Macro Definition Documentation

◆ cipher_encrypt

#define cipher_encrypt ( cipher,
ctx,
src,
dst,
len )
Value:
do { \
assert ( ( (len) & ( (cipher)->blocksize - 1 ) ) == 0 ); \
cipher_encrypt ( (cipher), (ctx), (src), (dst), (len) ); \
} while ( 0 )
struct golan_eq_context ctx
Definition CIB_PRM.h:0
static const void * src
Definition string.h:48
ring len
Length.
Definition dwmac.h:226

Definition at line 326 of file crypto.h.

326#define cipher_encrypt( cipher, ctx, src, dst, len ) do { \
327 assert ( ( (len) & ( (cipher)->blocksize - 1 ) ) == 0 ); \
328 cipher_encrypt ( (cipher), (ctx), (src), (dst), (len) ); \
329 } while ( 0 )

Referenced by aes_wrap(), cbc_encrypt(), ccmp_cbc_mac(), ccmp_ctr_xor(), ccmp_feed_cbc_mac(), cipher_cost_encrypt(), cipher_encrypt_okx(), cms_decrypt(), ecb_encrypt(), gcm_auth(), gcm_process(), gcm_setkey(), mschapv2_challenge_response(), tkip_encrypt(), tls_send_record(), and wep_encrypt().

◆ cipher_decrypt

#define cipher_decrypt ( cipher,
ctx,
src,
dst,
len )
Value:
do { \
assert ( ( (len) & ( (cipher)->blocksize - 1 ) ) == 0 ); \
cipher_decrypt ( (cipher), (ctx), (src), (dst), (len) ); \
} while ( 0 )

Definition at line 336 of file crypto.h.

336#define cipher_decrypt( cipher, ctx, src, dst, len ) do { \
337 assert ( ( (len) & ( (cipher)->blocksize - 1 ) ) == 0 ); \
338 cipher_decrypt ( (cipher), (ctx), (src), (dst), (len) ); \
339 } while ( 0 )

Referenced by aes_unwrap(), cbc_decrypt(), cipher_cost_decrypt(), cipher_decrypt_okx(), cms_decrypt(), ecb_decrypt(), peerblk_decrypt(), tkip_decrypt(), tls_new_ciphertext(), and wep_decrypt().

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )

◆ FILE_SECBOOT()

FILE_SECBOOT ( PERMITTED )

◆ digest_init()

◆ digest_update()

◆ digest_final()

◆ cipher_setkey()

int cipher_setkey ( struct cipher_algorithm * cipher,
void * ctx,
const void * key,
size_t keylen )
inlinestatic

Definition at line 310 of file crypto.h.

311 {
312 return cipher->setkey ( cipher, ctx, key, keylen );
313}
union @162305117151260234136356364136041353210355154177 key
int(* setkey)(struct cipher_algorithm *cipher, void *ctx, const void *key, size_t keylen)
Set key.
Definition crypto.h:93

References ctx, key, and cipher_algorithm::setkey.

Referenced by aes_unwrap(), aes_wrap(), cbc_setkey(), ccmp_init(), cipher_cost(), cipher_decrypt_okx(), cipher_encrypt_okx(), cms_cipher_key(), ecb_setkey(), gcm_setkey(), mschapv2_challenge_response(), peerblk_parse_header(), tkip_decrypt(), tkip_encrypt(), tls_generate_keys(), wep_decrypt(), and wep_encrypt().

◆ cipher_setiv()

int cipher_setiv ( struct cipher_algorithm * cipher,
void * ctx,
const void * iv,
size_t ivlen )
inlinestatic

Definition at line 316 of file crypto.h.

317 {
318 return cipher->setiv ( cipher, ctx, iv, ivlen );
319}
int(* setiv)(struct cipher_algorithm *cipher, void *ctx, const void *iv, size_t ivlen)
Set initialisation vector.
Definition crypto.h:103
u8 iv[16]
Initialization vector.
Definition wpa.h:33

References ctx, iv, and cipher_algorithm::setiv.

Referenced by cipher_cost(), cipher_decrypt_okx(), cipher_encrypt_okx(), cms_cipher_key(), peerblk_parse_iv(), tls_new_ciphertext(), and tls_send_record().

◆ cipher_encrypt()

void cipher_encrypt ( struct cipher_algorithm * cipher,
void * ctx,
const void * src,
void * dst,
size_t len )
inlinestatic

Definition at line 322 of file crypto.h.

323 {
324 cipher->encrypt ( cipher, ctx, src, dst, len );
325}
void(* encrypt)(struct cipher_algorithm *cipher, void *ctx, const void *src, void *dst, size_t len)
Encrypt data.
Definition crypto.h:115

References ctx, cipher_algorithm::encrypt, len, and src.

◆ cipher_decrypt()

void cipher_decrypt ( struct cipher_algorithm * cipher,
void * ctx,
const void * src,
void * dst,
size_t len )
inlinestatic

Definition at line 332 of file crypto.h.

333 {
334 cipher->decrypt ( cipher, ctx, src, dst, len );
335}
void(* decrypt)(struct cipher_algorithm *cipher, void *ctx, const void *src, void *dst, size_t len)
Decrypt data.
Definition crypto.h:127

References ctx, cipher_algorithm::decrypt, len, and src.

◆ cipher_auth()

void cipher_auth ( struct cipher_algorithm * cipher,
void * ctx,
void * auth )
inlinestatic

Definition at line 342 of file crypto.h.

342 {
343 cipher->auth ( cipher, ctx, auth );
344}
void(* auth)(struct cipher_algorithm *cipher, void *ctx, void *auth)
Generate authentication tag.
Definition crypto.h:135

References cipher_algorithm::auth, and ctx.

Referenced by cipher_decrypt_okx(), cipher_encrypt_okx(), cms_decrypt(), tls_new_ciphertext(), and tls_send_record().

◆ is_stream_cipher()

int is_stream_cipher ( struct cipher_algorithm * cipher)
inlinestatic

Definition at line 347 of file crypto.h.

347 {
348 return ( cipher->blocksize == 1 );
349}
size_t blocksize
Block size.
Definition crypto.h:68

References cipher_algorithm::blocksize.

◆ is_block_cipher()

int is_block_cipher ( struct cipher_algorithm * cipher)
inlinestatic

Definition at line 352 of file crypto.h.

352 {
353 return ( cipher->blocksize > 1 );
354}

References cipher_algorithm::blocksize.

Referenced by cms_decrypt(), cms_verify_padding(), tls_iob_reserved(), tls_new_ciphertext(), and tls_send_record().

◆ is_auth_cipher()

int is_auth_cipher ( struct cipher_algorithm * cipher)
inlinestatic

Definition at line 357 of file crypto.h.

357 {
358 return cipher->authsize;
359}
size_t authsize
Authentication tag size.
Definition crypto.h:82

References cipher_algorithm::authsize.

Referenced by cipher_decrypt_okx(), cipher_encrypt_okx(), tls_new_ciphertext(), and tls_send_record().

◆ pubkey_encrypt()

int pubkey_encrypt ( struct pubkey_algorithm * pubkey,
const struct asn1_cursor * key,
const struct asn1_cursor * plaintext,
struct asn1_builder * ciphertext )
inlinestatic

Definition at line 362 of file crypto.h.

364 {
365 return pubkey->encrypt ( pubkey, key, plaintext, ciphertext );
366}
int(* encrypt)(struct pubkey_algorithm *pubkey, const struct asn1_cursor *key, const struct asn1_cursor *plaintext, struct asn1_builder *ciphertext)
Encrypt.
Definition crypto.h:153

References pubkey_algorithm::encrypt, and key.

Referenced by pubkey_okx(), and tls_send_client_key_exchange_pubkey().

◆ pubkey_decrypt()

int pubkey_decrypt ( struct pubkey_algorithm * pubkey,
const struct asn1_cursor * key,
const struct asn1_cursor * ciphertext,
struct asn1_builder * plaintext )
inlinestatic

Definition at line 369 of file crypto.h.

371 {
372 return pubkey->decrypt ( pubkey, key, ciphertext, plaintext );
373}
int(* decrypt)(struct pubkey_algorithm *pubkey, const struct asn1_cursor *key, const struct asn1_cursor *ciphertext, struct asn1_builder *plaintext)
Decrypt.
Definition crypto.h:165

References pubkey_algorithm::decrypt, and key.

Referenced by cms_cipher_key(), and pubkey_okx().

◆ pubkey_sign()

int pubkey_sign ( struct pubkey_algorithm * pubkey,
const struct asn1_cursor * key,
struct digest_algorithm * digest,
const void * value,
struct asn1_builder * signature )
inlinestatic

Definition at line 376 of file crypto.h.

378 {
379 return pubkey->sign ( pubkey, key, digest, value, signature );
380}
u8 signature
CPU signature.
Definition CIB_PRM.h:7
pseudo_bit_t value[0x00020]
Definition arbel.h:2
int(* sign)(struct pubkey_algorithm *pubkey, const struct asn1_cursor *key, struct digest_algorithm *digest, const void *value, struct asn1_builder *builder)
Sign digest value.
Definition crypto.h:178

References key, pubkey_algorithm::sign, signature, and value.

Referenced by icert_cert(), pubkey_sign_okx(), and tls_send_certificate_verify().

◆ pubkey_verify()

int pubkey_verify ( struct pubkey_algorithm * pubkey,
const struct asn1_cursor * key,
struct digest_algorithm * digest,
const void * value,
const struct asn1_cursor * signature )
inlinestatic

Definition at line 383 of file crypto.h.

385 {
386 return pubkey->verify ( pubkey, key, digest, value, signature );
387}
int(* verify)(struct pubkey_algorithm *pubkey, const struct asn1_cursor *key, struct digest_algorithm *digest, const void *value, const struct asn1_cursor *signature)
Verify signed digest value.
Definition crypto.h:191

References key, signature, value, and pubkey_algorithm::verify.

Referenced by cms_verify_digest(), ocsp_check_signature(), pubkey_sign_okx(), tls_verify_dh_params(), and x509_check_signature().

◆ pubkey_match()

int pubkey_match ( struct pubkey_algorithm * pubkey,
const struct asn1_cursor * private_key,
const struct asn1_cursor * public_key )
inlinestatic

Definition at line 390 of file crypto.h.

392 {
393 return pubkey->match ( pubkey, private_key, public_key );
394}
A private key.
Definition privkey.h:17
int(* match)(struct pubkey_algorithm *pubkey, const struct asn1_cursor *private_key, const struct asn1_cursor *public_key)
Check that public key matches private key.
Definition crypto.h:202

References pubkey_algorithm::match.

Referenced by pubkey_okx(), pubkey_sign_okx(), and x509_find_key().

◆ exchange_share()

int exchange_share ( struct exchange_algorithm * exchange,
const void * private,
void * public )
inlinestatic

Definition at line 397 of file crypto.h.

398 {
399 return exchange->share ( exchange, private, public );
400}
int(* share)(struct exchange_algorithm *exchange, const void *private, void *public)
Share public key.
Definition crypto.h:227

References exchange_algorithm::share.

Referenced by exchange_okx(), and tls_share_ephemeral().

◆ exchange_agree()

int exchange_agree ( struct exchange_algorithm * exchange,
const void * private,
const void * partner,
void * shared )
inlinestatic

Definition at line 403 of file crypto.h.

404 {
405 return exchange->agree ( exchange, private, partner, shared );
406}
struct eth_slow_lacp_entity_tlv partner
Partner information.
Definition eth_slow.h:5
int(* agree)(struct exchange_algorithm *exchange, const void *private, const void *partner, void *shared)
Agree shared secret.
Definition crypto.h:238

References exchange_algorithm::agree, and partner.

Referenced by exchange_okx(), and tls_agree_ephemeral().

◆ is_key_transport()

int is_key_transport ( struct exchange_algorithm * exchange)
inlinestatic

Definition at line 409 of file crypto.h.

409 {
410 return ( exchange->pubsize == 0 );
411}
size_t pubsize
Public key size.
Definition crypto.h:216

References exchange_algorithm::pubsize.

Referenced by tls_send_client_key_exchange_pubkey().

◆ elliptic_is_infinity()

int elliptic_is_infinity ( struct elliptic_curve * curve,
const void * point )
inlinestatic

Definition at line 414 of file crypto.h.

414 {
415 return curve->is_infinity ( curve, point );
416}
int(* is_infinity)(struct elliptic_curve *curve, const void *point)
Check if this is the point at infinity.
Definition crypto.h:267

References elliptic_curve::is_infinity.

Referenced by ecdsa_parse_key(), ecdsa_verify_rs(), elliptic_agree(), and elliptic_curve_okx().

◆ elliptic_multiply()

int elliptic_multiply ( struct elliptic_curve * curve,
const void * base,
const void * scalar,
void * result )
inlinestatic

Definition at line 419 of file crypto.h.

420 {
421 return curve->multiply ( curve, base, scalar, result );
422}
uint16_t result
Definition hyperv.h:33
uint32_t base
Base.
Definition librm.h:3
int(* multiply)(struct elliptic_curve *curve, const void *base, const void *scalar, void *result)
Multiply scalar by curve point.
Definition crypto.h:277

References base, elliptic_curve::multiply, and result.

Referenced by ecdsa_sign_rs(), ecdsa_verify_rs(), elliptic_agree(), elliptic_curve_okx(), elliptic_multiply_okx(), and elliptic_share().

◆ elliptic_add()

int elliptic_add ( struct elliptic_curve * curve,
const void * addend,
const void * augend,
void * result )
inlinestatic

Definition at line 425 of file crypto.h.

426 {
427 return curve->add ( curve, addend, augend, result );
428}
int(* add)(struct elliptic_curve *curve, const void *addend, const void *augend, void *result)
Add curve points (as a one-off operation).
Definition crypto.h:287

References elliptic_curve::add, and result.

Referenced by ecdsa_verify_rs(), and elliptic_add_okx().

◆ digest_null_init()

void digest_null_init ( struct digest_algorithm * digest,
void * ctx )
extern

References ctx.

◆ digest_null_update()

void digest_null_update ( struct digest_algorithm * digest,
void * ctx,
const void * src,
size_t len )
extern

References ctx, len, and src.

◆ digest_null_final()

void digest_null_final ( struct digest_algorithm * digest,
void * ctx,
void * out )
extern

References ctx, and out.

◆ cipher_null_setkey()

int cipher_null_setkey ( struct cipher_algorithm * cipher,
void * ctx,
const void * key,
size_t keylen )
extern

References ctx, and key.

◆ cipher_null_setiv()

int cipher_null_setiv ( struct cipher_algorithm * cipehr,
void * ctx,
const void * iv,
size_t ivlen )
extern

References ctx, and iv.

◆ cipher_null_encrypt()

void cipher_null_encrypt ( struct cipher_algorithm * cipher,
void * ctx,
const void * src,
void * dst,
size_t len )
extern

References ctx, len, and src.

◆ cipher_null_decrypt()

void cipher_null_decrypt ( struct cipher_algorithm * cipher,
void * ctx,
const void * src,
void * dst,
size_t len )
extern

References ctx, len, and src.

◆ cipher_null_auth()

void cipher_null_auth ( struct cipher_algorithm * cipher,
void * ctx,
void * auth )
extern

References ctx.

◆ pubkey_null_encrypt()

int pubkey_null_encrypt ( struct pubkey_algorithm * pubkey,
const struct asn1_cursor * key,
const struct asn1_cursor * plaintext,
struct asn1_builder * ciphertext )
extern

References key.

◆ pubkey_null_decrypt()

int pubkey_null_decrypt ( struct pubkey_algorithm * pubkey,
const struct asn1_cursor * key,
const struct asn1_cursor * ciphertext,
struct asn1_builder * plaintext )
extern

References key.

◆ pubkey_null_sign()

int pubkey_null_sign ( struct pubkey_algorithm * pubkey,
const struct asn1_cursor * key,
struct digest_algorithm * digest,
const void * value,
struct asn1_builder * signature )
extern

References key, signature, and value.

◆ pubkey_null_verify()

int pubkey_null_verify ( struct pubkey_algorithm * pubkey,
const struct asn1_cursor * key,
struct digest_algorithm * digest,
const void * value,
const struct asn1_cursor * signature )
extern

References key, signature, and value.

◆ pubkey_null_match()

int pubkey_null_match ( struct pubkey_algorithm * pubkey,
const struct asn1_cursor * private_key,
const struct asn1_cursor * public_key )
extern

◆ exchange_null_share()

int exchange_null_share ( struct exchange_algorithm * exchange,
const void * private,
void * public )
extern

◆ exchange_null_agree()

int exchange_null_agree ( struct exchange_algorithm * exchange,
const void * private,
const void * partner,
void * shared )
extern

Variable Documentation

◆ digest_null

struct digest_algorithm digest_null
extern

Definition at line 53 of file crypto_null.c.

53 {
54 .name = "null",
55 .ctxsize = 0,
56 .blocksize = 1,
57 .digestsize = 0,
58 .init = digest_null_init,
59 .update = digest_null_update,
60 .final = digest_null_final,
61};
void digest_null_init(struct digest_algorithm *digest __unused, void *ctx __unused)
Definition crypto_null.c:37
void digest_null_update(struct digest_algorithm *digest __unused, void *ctx __unused, const void *src __unused, size_t len __unused)
Definition crypto_null.c:42
void digest_null_final(struct digest_algorithm *digest __unused, void *ctx __unused, void *out __unused)
Definition crypto_null.c:48

Referenced by cms_parse_participants(), exchange_null_agree(), and tls_clear_digest().

◆ cipher_null

struct cipher_algorithm cipher_null
extern

Definition at line 94 of file crypto_null.c.

94 {
95 .name = "null",
96 .ctxsize = 0,
97 .blocksize = 1,
98 .alignsize = 1,
99 .authsize = 0,
100 .confidential = 0,
101 .setkey = cipher_null_setkey,
102 .setiv = cipher_null_setiv,
103 .encrypt = cipher_null_encrypt,
104 .decrypt = cipher_null_decrypt,
105 .auth = cipher_null_auth,
106};
int cipher_null_setiv(struct cipher_algorithm *cipher __unused, void *ctx __unused, const void *iv __unused, size_t ivlen __unused)
Definition crypto_null.c:70
void cipher_null_auth(struct cipher_algorithm *cipher __unused, void *ctx __unused, void *auth __unused)
Definition crypto_null.c:89
void cipher_null_decrypt(struct cipher_algorithm *cipher __unused, void *ctx __unused, const void *src, void *dst, size_t len)
Definition crypto_null.c:83
int cipher_null_setkey(struct cipher_algorithm *cipher __unused, void *ctx __unused, const void *key __unused, size_t keylen __unused)
Definition crypto_null.c:63
void cipher_null_encrypt(struct cipher_algorithm *cipher __unused, void *ctx __unused, const void *src, void *dst, size_t len)
Definition crypto_null.c:77

Referenced by cms_message(), and exchange_null_agree().

◆ pubkey_null

struct pubkey_algorithm pubkey_null
extern

Definition at line 144 of file crypto_null.c.

144 {
145 .name = "null",
146 .encrypt = pubkey_null_encrypt,
147 .decrypt = pubkey_null_decrypt,
148 .sign = pubkey_null_sign,
149 .verify = pubkey_null_verify,
150 .match = pubkey_null_match,
151};
int pubkey_null_decrypt(struct pubkey_algorithm *pubkey __unused, const struct asn1_cursor *key __unused, const struct asn1_cursor *ciphertext __unused, struct asn1_builder *plaintext __unused)
int pubkey_null_match(struct pubkey_algorithm *pubkey __unused, const struct asn1_cursor *private_key __unused, const struct asn1_cursor *public_key __unused)
int pubkey_null_verify(struct pubkey_algorithm *pubkey __unused, const struct asn1_cursor *key __unused, struct digest_algorithm *digest __unused, const void *value __unused, const struct asn1_cursor *signature __unused)
int pubkey_null_sign(struct pubkey_algorithm *pubkey __unused, const struct asn1_cursor *key __unused, struct digest_algorithm *digest __unused, const void *value __unused, struct asn1_builder *signature __unused)
int pubkey_null_encrypt(struct pubkey_algorithm *pubkey __unused, const struct asn1_cursor *key __unused, const struct asn1_cursor *plaintext __unused, struct asn1_builder *ciphertext __unused)

Referenced by cms_parse_participants(), and exchange_null_agree().

◆ exchange_null

struct exchange_algorithm exchange_null
extern

Definition at line 166 of file crypto_null.c.

166 {
167 .name = "null",
168 .privsize = 0,
169 .pubsize = 0,
170 .sharedsize = 0,
171 .share = exchange_null_share,
172 .agree = exchange_null_agree,
173};
int exchange_null_agree(struct exchange_algorithm *exchange __unused, const void *private __unused, const void *partner __unused, void *shared __unused)
int exchange_null_share(struct exchange_algorithm *exchange __unused, const void *private __unused, void *public __unused)

Referenced by exchange_null_agree().