|
iPXE
|
Cipher-block chaining. More...
#include <string.h>#include <assert.h>#include <errno.h>#include <ipxe/crypto.h>#include <ipxe/cbc.h>Go to the source code of this file.
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| FILE_SECBOOT (PERMITTED) | |
| int | cbc_setkey (struct cipher_algorithm *cipher, void *ctx, const void *key, size_t keylen) |
| Set key. | |
| int | cbc_setiv (struct cipher_algorithm *cipher, void *ctx, const void *iv, size_t ivlen) |
| Set initialisation vector. | |
| static void | cbc_xor (const void *src, void *dst, size_t len) |
| XOR data blocks. | |
| void | cbc_encrypt (struct cipher_algorithm *cipher, void *ctx, const void *src, void *dst, size_t len) |
| Encrypt data. | |
| void | cbc_decrypt (struct cipher_algorithm *cipher, void *ctx, const void *src, void *dst, size_t len) |
| Decrypt data. | |
Cipher-block chaining.
Definition in file cbc.c.
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
| FILE_SECBOOT | ( | PERMITTED | ) |
| int cbc_setkey | ( | struct cipher_algorithm * | cipher, |
| void * | ctx, | ||
| const void * | key, | ||
| size_t | keylen ) |
Set key.
| rc | Return status code |
Definition at line 48 of file cbc.c.
References cipher_algorithm::blocksize, cbc_context_t, cipher_setkey(), ctx, cipher_algorithm::ctxsize, key, and cipher_algorithm::priv.
| int cbc_setiv | ( | struct cipher_algorithm * | cipher, |
| void * | ctx, | ||
| const void * | iv, | ||
| size_t | ivlen ) |
Set initialisation vector.
| cipher | Cipher algorithm |
| ctx | Context |
| iv | Initialisation vector |
| ivlen | Initialisation vector length |
| rc | Return status code |
Definition at line 67 of file cbc.c.
References cipher_algorithm::blocksize, cbc_context_t, ctx, cipher_algorithm::ctxsize, ENOTSUP, iv, and memcpy().
|
static |
XOR data blocks.
Definition at line 90 of file cbc.c.
References assert, len, and src.
Referenced by cbc_decrypt(), and cbc_encrypt().
| void cbc_encrypt | ( | struct cipher_algorithm * | cipher, |
| void * | ctx, | ||
| const void * | src, | ||
| void * | dst, | ||
| size_t | len ) |
Encrypt data.
| cipher | Cipher algorithm |
| ctx | Context |
| src | Data to encrypt |
| dst | Buffer for encrypted data |
| len | Length of data |
Definition at line 111 of file cbc.c.
References assert, cipher_algorithm::blocksize, cbc_context_t, cbc_xor(), cipher_encrypt, ctx, cipher_algorithm::ctxsize, len, memcpy(), cipher_algorithm::priv, and src.
| void cbc_decrypt | ( | struct cipher_algorithm * | cipher, |
| void * | ctx, | ||
| const void * | src, | ||
| void * | dst, | ||
| size_t | len ) |
Decrypt data.
| cipher | Cipher algorithm |
| ctx | Context |
| src | Data to decrypt |
| dst | Buffer for decrypted data |
| len | Length of data |
Definition at line 140 of file cbc.c.
References assert, cipher_algorithm::blocksize, cbc_context_t, cbc_xor(), cipher_decrypt, ctx, cipher_algorithm::ctxsize, len, memcpy(), cipher_algorithm::priv, and src.