cipher.h File Reference
Generic interface for symmetric block ciphers. More...
Go to the source code of this file.
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. | |
Detailed Description
Generic interface for symmetric block ciphers.
Definition in file cipher.h.
Function Documentation
| void cipher_cbc_begin | ( | BlockCipher * | c, |
| void * | iv | ||
| ) | [inline] |
| void cipher_ctr_begin | ( | BlockCipher * | c, |
| void * | counter | ||
| ) | [inline] |
| void cipher_ctr_step | ( | BlockCipher * | c, |
| void * | block | ||
| ) |
| size_t cipher_key_len | ( | BlockCipher * | c | ) | [inline] |
| void cipher_ofb_begin | ( | BlockCipher * | c, |
| void * | iv | ||
| ) | [inline] |
| void cipher_set_key | ( | BlockCipher * | c, |
| const void * | key | ||
| ) | [inline] |
Set the current key used by the cipher.
- Note:
- the buffer pointed by key is not modified and it is not needed anymore after this call returns. Its lenght must match the value returned by cipher_key_len().
| void cipher_set_vkey | ( | BlockCipher * | c, |
| const void * | key, | ||
| size_t | len | ||
| ) | [inline] |
Set the current key (of variable size) used by the cipher.
This function is useful for ciphers that allow a variable size for the key (even with a fixed state). For all the other ciphers, the length must match the value returned by cipher_key_len().
- Note:
- the buffer pointed by key is not modified and it is not needed anymore after this call returns.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/bertos_logo.png)