Electronic code book mode of operation for block ciphers. More...
Electronic code book mode of operation for block ciphers.
Definition in file ecb.h.
#include "crypto/ciphers.h"
Go to the source code of this file.
int | cipher_encrypt_ecb (const cipher_t *cipher, const uint8_t *input, size_t length, uint8_t *output) |
Encrypt data of arbitrary length in ecb mode. More... | |
int | cipher_decrypt_ecb (const cipher_t *cipher, const uint8_t *input, size_t length, uint8_t *output) |
Decrypts data of arbitrary length in ecb mode. More... | |
int cipher_decrypt_ecb | ( | const cipher_t * | cipher, |
const uint8_t * | input, | ||
size_t | length, | ||
uint8_t * | output | ||
) |
Decrypts data of arbitrary length in ecb mode.
cipher | Already initialized cipher struct |
input | pointer to input data to decrypt |
length | length of the input data |
output | pointer to allocated memory for plaintext data. It has to be of size lengh . |
int cipher_encrypt_ecb | ( | const cipher_t * | cipher, |
const uint8_t * | input, | ||
size_t | length, | ||
uint8_t * | output | ||
) |
Encrypt data of arbitrary length in ecb mode.
Caution each identical block results in an identical encrypted block. Normally you do not want to use ECB.
cipher | Already initialized cipher struct |
input | pointer to input data to encrypt |
length | length of the input data |
output | pointer to allocated memory for encrypted data. It has to be of size data_len + BLOCK_SIZE - data_len % BLOCK_SIZE. |