Ordo
0.3.4
Symmetric Cryptography Library
|
Primitive. More...
#include "ordo/primitives/block_modes.h"
Go to the source code of this file.
Functions | |
ORDO_PUBLIC int | ecb_init (struct ECB_STATE *state, struct BLOCK_STATE *cipher_state, const void *iv, size_t iv_len, int dir, const struct ECB_PARAMS *params) |
ORDO_PUBLIC void | ecb_update (struct ECB_STATE *state, struct BLOCK_STATE *cipher_state, const void *in, size_t in_len, void *out, size_t *out_len) |
ORDO_PUBLIC int | ecb_final (struct ECB_STATE *state, struct BLOCK_STATE *cipher_state, void *out, size_t *out_len) |
ORDO_PUBLIC size_t | ecb_query (prim_t cipher, int query, size_t value) |
ORDO_PUBLIC size_t | ecb_bsize (void) |
Primitive.
The ECB mode divides the input message into blocks of the cipher's block size, and encrypts them individually and independently. If the input message's length is not a multiple of the cipher's block size, a padding mechanism is enabled by default which will pad the message to the correct length (and remove the extra data upon decryption). Padding may be disabled via ECB_PARAMS
, putting constraints on the input message.
The ECB mode does not require an initialization vector.
Note that the ECB mode is insecure in almost all situations and is not recommended for general purpose use.
ORDO_PUBLIC int ecb_init | ( | struct ECB_STATE * | state, |
struct BLOCK_STATE * | cipher_state, | ||
const void * | iv, | ||
size_t | iv_len, | ||
int | dir, | ||
const struct ECB_PARAMS * | params | ||
) |
block_mode_init()
ORDO_PUBLIC void ecb_update | ( | struct ECB_STATE * | state, |
struct BLOCK_STATE * | cipher_state, | ||
const void * | in, | ||
size_t | in_len, | ||
void * | out, | ||
size_t * | out_len | ||
) |
block_mode_update()
ORDO_PUBLIC int ecb_final | ( | struct ECB_STATE * | state, |
struct BLOCK_STATE * | cipher_state, | ||
void * | out, | ||
size_t * | out_len | ||
) |
block_mode_final()
ORDO_PUBLIC size_t ecb_query | ( | prim_t | cipher, |
int | query, | ||
size_t | value | ||
) |
block_mode_query()
ORDO_PUBLIC size_t ecb_bsize | ( | void | ) |
Gets the size in bytes of a ECB_STATE
.