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...
 
int(* setkey )(void *ctx, const void *key, size_t keylen)
 Set key. More...
 
void(* setiv )(void *ctx, const void *iv)
 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...
 

Detailed Description

A cipher algorithm.

Definition at line 48 of file crypto.h.

Field Documentation

◆ name

const char* cipher_algorithm::name

Algorithm name.

Definition at line 50 of file crypto.h.

Referenced by peerblk_parse_header(), and tls_select_cipher().

◆ ctxsize

size_t cipher_algorithm::ctxsize

◆ blocksize

size_t cipher_algorithm::blocksize

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

Referenced by cipher_setkey().

◆ setiv

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

Set initialisation vector.

Parameters
ctxContext
ivInitialisation vector

Definition at line 68 of file crypto.h.

Referenced by cipher_setiv().

◆ 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
lenLength of data
lenis guaranteed to be a multiple of blocksize.

Definition at line 78 of file crypto.h.

Referenced by cipher_encrypt().

◆ 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
lenLength of data
lenis guaranteed to be a multiple of blocksize.

Definition at line 89 of file crypto.h.

Referenced by cipher_decrypt().


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