Functions |
size_t | cipher_key_len (BlockCipher *c) |
| Return the key length (in bytes).
|
size_t | cipher_block_len (BlockCipher *c) |
| Return the block length (in bytes)
|
void | cipher_set_key (BlockCipher *c, const void *key) |
| Set the current key used by the cipher.
|
void | cipher_set_vkey (BlockCipher *c, const void *key, size_t len) |
| Set the current key (of variable size) used by the cipher.
|
void | cipher_ecb_encrypt (BlockCipher *c, void *block) |
| Encrypt a block (in-place) using the current key in ECB mode.
|
void | cipher_ecb_decrypt (BlockCipher *c, void *block) |
| Decrypt a block (in-place) using the current key in ECB mode.
|
void | cipher_cbc_begin (BlockCipher *c, void *iv) |
| Initialize CBC by setting the IV.
|
void | cipher_cbc_encrypt (BlockCipher *c, void *block) |
| Encrypt a block (in-place) using the current key in CBC mode.
|
void | cipher_cbc_decrypt (BlockCipher *c, void *block) |
| Decrypt a block (in-place) using the current key in CBC mode.
|
void | cipher_ctr_begin (BlockCipher *c, void *counter) |
| Initialize CTR by setting the counter.
|
void | cipher_ctr_encrypt (BlockCipher *c, void *block) |
| Encrypt a block (in-place) using the current key in CTR mode.
|
void | cipher_ctr_decrypt (BlockCipher *c, void *block) |
| Decrypt a block (in-place) using the current key in CTR mode.
|
void | cipher_ctr_step (BlockCipher *c, void *block) |
| Generate the crypted stream block in CTR mode for the current counter, and then bump it.
|
void | cipher_ofb_begin (BlockCipher *c, void *iv) |
| Initialize OFB by setting the IV.
|
void | cipher_ofb_encrypt (BlockCipher *c, void *block) |
| Encrypt a block (in-place) using the current key in OFB mode.
|
void | cipher_ofb_decrypt (BlockCipher *c, void *block) |
| Decrypt a block (in-place) using the current key in OFB mode.
|
Generic interface for symmetric block ciphers.
- Author:
- Giovanni Bajo <rasky@develer.com>
Definition in file cipher.h.
void cipher_ctr_step |
( |
BlockCipher * |
c, |
|
|
void * |
block |
|
) |
| |
Generate the crypted stream block in CTR mode for the current counter, and then bump it.
This function is basically the core CTR operation, without the final XOR pass with the plaintext or ciphertext. For normal CTR usage, you never need to call it.
Definition at line 67 of file cipher.c.