iPXE
|
A public key algorithm. More...
#include <crypto.h>
Data Fields | |
const char * | name |
Algorithm name. More... | |
size_t | ctxsize |
Context size. More... | |
int(* | init )(void *ctx, const void *key, size_t key_len) |
Initialise algorithm. More... | |
size_t(* | max_len )(void *ctx) |
Calculate maximum output length. More... | |
int(* | encrypt )(void *ctx, const void *data, size_t len, void *out) |
Encrypt. More... | |
int(* | decrypt )(void *ctx, const void *data, size_t len, void *out) |
Decrypt. More... | |
int(* | sign )(void *ctx, struct digest_algorithm *digest, const void *value, void *signature) |
Sign digest value. More... | |
int(* | verify )(void *ctx, struct digest_algorithm *digest, const void *value, const void *signature, size_t signature_len) |
Verify signed digest value. More... | |
void(* | final )(void *ctx) |
Finalise algorithm. More... | |
int(* | match )(const void *private_key, size_t private_key_len, const void *public_key, size_t public_key_len) |
Check that public key matches private key. More... | |
const char* pubkey_algorithm::name |
Algorithm name.
Definition at line 122 of file crypto.h.
Referenced by tls_select_cipher(), tls_send_certificate_verify(), and tls_send_client_key_exchange_dhe().
size_t pubkey_algorithm::ctxsize |
Context size.
Definition at line 124 of file crypto.h.
Referenced by cms_verify_digest(), ocsp_check_signature(), tls_send_certificate_verify(), tls_set_cipher(), and x509_check_signature().
Initialise algorithm.
ctx | Context |
key | Key |
key_len | Length of key |
rc | Return status code |
Definition at line 132 of file crypto.h.
Referenced by pubkey_init().
Calculate maximum output length.
ctx | Context |
max_len | Maximum output length |
Definition at line 138 of file crypto.h.
Referenced by pubkey_max_len().
Encrypt.
ctx | Context |
plaintext | Plaintext |
plaintext_len | Length of plaintext |
ciphertext | Ciphertext |
ciphertext_len | Length of ciphertext, or negative error |
Definition at line 147 of file crypto.h.
Referenced by pubkey_encrypt().
Decrypt.
ctx | Context |
ciphertext | Ciphertext |
ciphertext_len | Ciphertext length |
plaintext | Plaintext |
plaintext_len | Plaintext length, or negative error |
Definition at line 157 of file crypto.h.
Referenced by pubkey_decrypt().
int( * pubkey_algorithm::sign) (void *ctx, struct digest_algorithm *digest, const void *value, void *signature) |
Sign digest value.
ctx | Context |
digest | Digest algorithm |
value | Digest value |
signature | Signature |
signature_len | Signature length, or negative error |
Definition at line 167 of file crypto.h.
Referenced by pubkey_sign().
int( * pubkey_algorithm::verify) (void *ctx, struct digest_algorithm *digest, const void *value, const void *signature, size_t signature_len) |
Verify signed digest value.
ctx | Context |
digest | Digest algorithm |
value | Digest value |
signature | Signature |
signature_len | Signature length |
rc | Return status code |
Definition at line 178 of file crypto.h.
Referenced by pubkey_verify().
void( * pubkey_algorithm::final) (void *ctx) |
Finalise algorithm.
ctx | Context |
Definition at line 185 of file crypto.h.
Referenced by pubkey_final().
int( * pubkey_algorithm::match) (const void *private_key, size_t private_key_len, const void *public_key, size_t public_key_len) |
Check that public key matches private key.
private_key | Private key |
private_key_len | Private key length |
public_key | Public key |
public_key_len | Public key length |
rc | Return status code |
Definition at line 194 of file crypto.h.
Referenced by pubkey_match().