iPXE
|
A cipher algorithm. More...
#include <crypto.h>
Data Fields | |
const char * | name |
Algorithm name. More... | |
size_t | ctxsize |
Context size. More... | |
size_t | blocksize |
Block size. More... | |
size_t | alignsize |
Alignment size. More... | |
size_t | authsize |
Authentication tag size. More... | |
int(* | setkey )(void *ctx, const void *key, size_t keylen) |
Set key. More... | |
void(* | setiv )(void *ctx, const void *iv, size_t ivlen) |
Set initialisation vector. More... | |
void(* | encrypt )(void *ctx, const void *src, void *dst, size_t len) |
Encrypt data. More... | |
void(* | decrypt )(void *ctx, const void *src, void *dst, size_t len) |
Decrypt data. More... | |
void(* | auth )(void *ctx, void *auth) |
Generate authentication tag. More... | |
const char* cipher_algorithm::name |
Algorithm name.
Definition at line 52 of file crypto.h.
Referenced by peerblk_parse_header(), and tls_select_cipher().
size_t cipher_algorithm::ctxsize |
Context size.
Definition at line 54 of file crypto.h.
Referenced by cipher_cost(), cipher_decrypt_okx(), cipher_encrypt_okx(), cms_decrypt(), peerblk_parse_header(), and tls_set_cipher().
size_t cipher_algorithm::blocksize |
Block size.
Every call to encrypt() or decrypt() must be for a multiple of this size.
Definition at line 60 of file crypto.h.
Referenced by asn1_parse_cbc(), cbc_decrypt(), cbc_encrypt(), cbc_setiv(), cipher_cost(), cipher_okx(), cms_decrypt(), cms_verify_padding(), ecb_decrypt(), ecb_encrypt(), is_block_cipher(), is_stream_cipher(), peerblk_decrypt(), peerblk_parse_iv(), peerblk_retrieval_close(), and tls_send_plaintext().
size_t cipher_algorithm::alignsize |
Alignment size.
Every call to encrypt() or decrypt() must begin at a multiple of this offset from the start of the stream. (Equivalently: all but the last call to encrypt() or decrypt() must be for a multiple of this size.)
For ciphers supporting additional data, the main data stream and additional data stream are both considered to begin at offset zero.
Definition at line 72 of file crypto.h.
Referenced by cipher_okx(), and tls_newdata_process_header().
size_t cipher_algorithm::authsize |
Authentication tag size.
Definition at line 74 of file crypto.h.
Referenced by cipher_decrypt_okx(), cipher_encrypt_okx(), cms_decrypt(), cms_parse_enveloped(), is_auth_cipher(), tls_new_ciphertext(), and tls_send_plaintext().
Set key.
ctx | Context |
key | Key |
keylen | Key length |
rc | Return status code |
Definition at line 82 of file crypto.h.
Referenced by cipher_setkey().
Set initialisation vector.
ctx | Context |
iv | Initialisation vector |
ivlen | Initialisation vector length |
Definition at line 89 of file crypto.h.
Referenced by cipher_setiv().
Encrypt data.
ctx | Context |
src | Data to encrypt |
dst | Buffer for encrypted data, or NULL for additional data |
len | Length of data |
len | is guaranteed to be a multiple of blocksize . |
Definition at line 99 of file crypto.h.
Referenced by cipher_encrypt().
Decrypt data.
ctx | Context |
src | Data to decrypt |
dst | Buffer for decrypted data, or NULL for additional data |
len | Length of data |
len | is guaranteed to be a multiple of blocksize . |
Definition at line 110 of file crypto.h.
Referenced by cipher_decrypt().
void( * cipher_algorithm::auth) (void *ctx, void *auth) |
Generate authentication tag.
ctx | Context |
auth | Authentication tag |
Definition at line 117 of file crypto.h.
Referenced by cipher_auth(), cipher_decrypt_okx(), cipher_encrypt_okx(), and cms_decrypt().