|
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 an electronic codebook mode of behaviour of an existing cipher. | |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| FILE_SECBOOT (PERMITTED) | |
| int | ecb_setkey (struct cipher_algorithm *cipher, void *ctx, const void *key, size_t keylen) |
| Set key. | |
| void | ecb_encrypt (struct cipher_algorithm *cipher, void *ctx, const void *src, void *dst, size_t len) |
| Encrypt data. | |
| void | ecb_decrypt (struct cipher_algorithm *cipher, void *ctx, const void *src, void *dst, size_t len) |
| Decrypt data. | |
Electronic codebook (ECB).
Definition in file ecb.h.
| #define ECB_CIPHER | ( | _ecb_name, | |
| _ecb_cipher, | |||
| _raw_cipher, | |||
| _raw_context, | |||
| _blocksize ) |
Create an electronic codebook 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 | ) |
|
extern |
Set key.
| rc | Return status code |
Definition at line 46 of file ecb.c.
References cipher_setkey(), ctx, key, and cipher_algorithm::priv.
|
extern |
Encrypt data.
| cipher | Cipher algorithm |
| ctx | Context |
| src | Data to encrypt |
| dst | Buffer for encrypted data |
| len | Length of data |
Definition at line 62 of file ecb.c.
References assert, cipher_algorithm::blocksize, cipher_encrypt, ctx, len, cipher_algorithm::priv, and src.
|
extern |
Decrypt data.
| cipher | Cipher algorithm |
| ctx | Context |
| src | Data to decrypt |
| dst | Buffer for decrypted data |
| len | Length of data |
Definition at line 86 of file ecb.c.
References assert, cipher_algorithm::blocksize, cipher_decrypt, ctx, len, cipher_algorithm::priv, and src.