iPXE
|
Electronic codebook (ECB) More...
#include <ipxe/crypto.h>
Go to the source code of this file.
Macros | |
#define | ECB_CIPHER(_ecb_name, _ecb_cipher, _raw_cipher, _raw_context, _blocksize) |
Create a cipher-block chaining mode of behaviour of an existing cipher. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
void | ecb_encrypt (void *ctx, const void *src, void *dst, size_t len, struct cipher_algorithm *raw_cipher) |
Encrypt data. More... | |
void | ecb_decrypt (void *ctx, const void *src, void *dst, size_t len, struct cipher_algorithm *raw_cipher) |
Decrypt data. More... | |
Electronic codebook (ECB)
Definition in file ecb.h.
#define ECB_CIPHER | ( | _ecb_name, | |
_ecb_cipher, | |||
_raw_cipher, | |||
_raw_context, | |||
_blocksize | |||
) |
Create a cipher-block chaining mode of behaviour of an existing cipher.
_ecb_name | Name for the new ECB cipher |
_ecb_cipher | New cipher algorithm |
_raw_cipher | Underlying cipher algorithm |
_raw_context | Context structure for the underlying cipher |
_blocksize | Cipher block size |
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
void ecb_encrypt | ( | void * | ctx, |
const void * | src, | ||
void * | dst, | ||
size_t | len, | ||
struct cipher_algorithm * | raw_cipher | ||
) |
Encrypt data.
ctx | Context |
src | Data to encrypt |
dst | Buffer for encrypted data |
len | Length of data |
raw_cipher | Underlying cipher algorithm |
Definition at line 45 of file ecb.c.
References assert(), cipher_algorithm::blocksize, cipher_encrypt, ctx, len, and src.
void ecb_decrypt | ( | void * | ctx, |
const void * | src, | ||
void * | dst, | ||
size_t | len, | ||
struct cipher_algorithm * | raw_cipher | ||
) |
Decrypt data.
ctx | Context |
src | Data to decrypt |
dst | Buffer for decrypted data |
len | Length of data |
raw_cipher | Underlying cipher algorithm |
Definition at line 68 of file ecb.c.
References assert(), cipher_algorithm::blocksize, cipher_decrypt, ctx, len, and src.