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

Abstraction Layer. More...

#include "ordo/primitives/block_ciphers/block_params.h"
Include dependency graph for block_ciphers.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

ORDO_PUBLIC int block_init (struct BLOCK_STATE *state, const void *key, size_t key_len, prim_t primitive, const void *params)
 
ORDO_PUBLIC void block_forward (const struct BLOCK_STATE *state, void *block)
 
ORDO_PUBLIC void block_inverse (const struct BLOCK_STATE *state, void *block)
 
ORDO_PUBLIC void block_final (struct BLOCK_STATE *state)
 
ORDO_PUBLIC size_t block_query (prim_t primitive, int query, size_t value)
 
ORDO_PUBLIC size_t block_bsize (void)
 

Detailed Description

Abstraction Layer.

This abstraction layer declares all the block ciphers, and also makes them available to higher level modules. This does not actually do encryption at all but simply abstracts block cipher permutations, the encryption modules are in the enc folder: enc_block.h.

Function Documentation

ORDO_PUBLIC int block_init ( struct BLOCK_STATE *  state,
const void *  key,
size_t  key_len,
prim_t  primitive,
const void *  params 
)

Initializes a block cipher state.

Parameters
[in,out]stateA block cipher state.
[in]keyThe cryptographic key to use.
[in]key_lenThe length, in bytes, of the key.
[in]primitiveA block cipher primitive.
[in]paramsBlock cipher specific parameters.
Returns
ORDO_SUCCESS on success, else an error code.
ORDO_PUBLIC void block_forward ( const struct BLOCK_STATE *  state,
void *  block 
)

Applies a block cipher's forward permutation.

Parameters
[in]stateAn initialized block cipher state.
[in,out]blockA data block to permute.
Remarks
The block should be the size of the block cipher's block size.
ORDO_PUBLIC void block_inverse ( const struct BLOCK_STATE *  state,
void *  block 
)

Applies a block cipher's inverse permutation.

Parameters
[in]stateAn initialized block cipher state.
[in,out]blockA data block to permute.
Remarks
The block should be the size of the block cipher's block size.
ORDO_PUBLIC void block_final ( struct BLOCK_STATE *  state)

Finalizes a block cipher state.

Parameters
[in,out]stateA block cipher state.
ORDO_PUBLIC size_t block_query ( prim_t  primitive,
int  query,
size_t  value 
)

Queries a block cipher for suitable parameters.

Parameters
[in]primitiveA block cipher primitive.
[in]queryA query code.
[in]valueA suggested value.
Returns
A suitable parameter of type query based on value.
See Also
query.h
ORDO_PUBLIC size_t block_bsize ( void  )

Gets the size in bytes of a BLOCK_STATE.

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