Ordo  0.3.4
Symmetric Cryptography Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Functions
ecb.h File Reference

Primitive. More...

#include "ordo/primitives/block_modes.h"
Include dependency graph for ecb.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)
 

Detailed Description

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.

Function Documentation

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  )

Gets the size in bytes of a ECB_STATE.

Returns
The size in bytes of the structure.
Remarks
Binary compatibility layer.