Ordo
0.3.4
Symmetric Cryptography Library
|
Abstraction Layer. More...
#include "ordo/primitives/block_ciphers/block_params.h"
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) |
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
.
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.
[in,out] | state | A block cipher state. |
[in] | key | The cryptographic key to use. |
[in] | key_len | The length, in bytes, of the key. |
[in] | primitive | A block cipher primitive. |
[in] | params | Block cipher specific parameters. |
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.
[in] | state | An initialized block cipher state. |
[in,out] | block | A data block to permute. |
ORDO_PUBLIC void block_inverse | ( | const struct BLOCK_STATE * | state, |
void * | block | ||
) |
Applies a block cipher's inverse permutation.
[in] | state | An initialized block cipher state. |
[in,out] | block | A data block to permute. |
ORDO_PUBLIC void block_final | ( | struct BLOCK_STATE * | state | ) |
Finalizes a block cipher state.
[in,out] | state | A block cipher state. |
ORDO_PUBLIC size_t block_query | ( | prim_t | primitive, |
int | query, | ||
size_t | value | ||
) |
Queries a block cipher for suitable parameters.
[in] | primitive | A block cipher primitive. |
[in] | query | A query code. |
[in] | value | A suggested value. |
query
based on value
.ORDO_PUBLIC size_t block_bsize | ( | void | ) |
Gets the size in bytes of a BLOCK_STATE
.