iPXE
Data Fields
cipher_algorithm Struct Reference

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...
 

Detailed Description

A cipher algorithm.

Definition at line 49 of file crypto.h.

Field Documentation

◆ name

const char* cipher_algorithm::name

Algorithm name.

Definition at line 51 of file crypto.h.

Referenced by peerblk_parse_header(), and tls_select_cipher().

◆ ctxsize

size_t cipher_algorithm::ctxsize

Context size.

Definition at line 53 of file crypto.h.

Referenced by cipher_cost(), cipher_decrypt_okx(), cipher_encrypt_okx(), peerblk_parse_header(), and tls_set_cipher().

◆ blocksize

size_t cipher_algorithm::blocksize

Block size.

Every call to encrypt() or decrypt() must be for a multiple of this size.

Definition at line 59 of file crypto.h.

Referenced by __attribute__(), cbc_decrypt(), cbc_encrypt(), cbc_setiv(), cipher_cost(), cipher_okx(), ecb_decrypt(), ecb_encrypt(), peerblk_decrypt(), peerblk_parse_iv(), peerblk_retrieval_close(), and tls_send_plaintext().

◆ alignsize

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 71 of file crypto.h.

Referenced by cipher_okx(), and tls_newdata_process_header().

◆ authsize

size_t cipher_algorithm::authsize

Authentication tag size.

Definition at line 73 of file crypto.h.

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

◆ setkey

int( * cipher_algorithm::setkey) (void *ctx, const void *key, size_t keylen)

Set key.

Parameters
ctxContext
keyKey
keylenKey length
Return values
rcReturn status code

Definition at line 81 of file crypto.h.

◆ setiv

void( * cipher_algorithm::setiv) (void *ctx, const void *iv, size_t ivlen)

Set initialisation vector.

Parameters
ctxContext
ivInitialisation vector
ivlenInitialisation vector length

Definition at line 88 of file crypto.h.

◆ encrypt

void( * cipher_algorithm::encrypt) (void *ctx, const void *src, void *dst, size_t len)

Encrypt data.

Parameters
ctxContext
srcData to encrypt
dstBuffer for encrypted data, or NULL for additional data
lenLength of data
lenis guaranteed to be a multiple of blocksize.

Definition at line 98 of file crypto.h.

◆ decrypt

void( * cipher_algorithm::decrypt) (void *ctx, const void *src, void *dst, size_t len)

Decrypt data.

Parameters
ctxContext
srcData to decrypt
dstBuffer for decrypted data, or NULL for additional data
lenLength of data
lenis guaranteed to be a multiple of blocksize.

Definition at line 109 of file crypto.h.

◆ auth

void( * cipher_algorithm::auth) (void *ctx, void *auth)

Generate authentication tag.

Parameters
ctxContext
authAuthentication tag

Definition at line 116 of file crypto.h.


The documentation for this struct was generated from the following file: