iPXE
Data Fields
cipher_algorithm Struct Reference

A cipher algorithm. More...

#include <crypto.h>

Data Fields

const char * name
 Algorithm name.
size_t ctxsize
 Context size.
size_t blocksize
 Block size.
int(* setkey )(void *ctx, const void *key, size_t keylen)
 Set key.
void(* setiv )(void *ctx, const void *iv)
 Set initialisation vector.
void(* encrypt )(void *ctx, const void *src, void *dst, size_t len)
 Encrypt data.
void(* decrypt )(void *ctx, const void *src, void *dst, size_t len)
 Decrypt data.

Detailed Description

A cipher algorithm.

Definition at line 48 of file crypto.h.


Field Documentation

Algorithm name.

Definition at line 50 of file crypto.h.

Referenced by peerblk_parse_header(), and tls_select_cipher().

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

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

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

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: