Ordo
0.3.4
Symmetric Cryptography Library
|
Abstraction Layer. More...
Go to the source code of this file.
Functions | |
ORDO_PUBLIC int | stream_init (struct STREAM_STATE *state, const void *key, size_t key_len, prim_t primitive, const void *params) |
ORDO_PUBLIC void | stream_update (struct STREAM_STATE *state, void *buffer, size_t len) |
ORDO_PUBLIC void | stream_final (struct STREAM_STATE *state) |
ORDO_PUBLIC size_t | stream_query (prim_t primitive, int query, size_t value) |
ORDO_PUBLIC size_t | stream_bsize (void) |
Abstraction Layer.
This abstraction layer declares all the stream ciphers and also makes them available to higher level modules. This does not actually do encryption at all but simply abstracts the stream cipher primitives - encryption modules are in the enc
folder: enc_stream.h
.
ORDO_PUBLIC int stream_init | ( | struct STREAM_STATE * | state, |
const void * | key, | ||
size_t | key_len, | ||
prim_t | primitive, | ||
const void * | params | ||
) |
Initializes a stream cipher state.
[in,out] | state | A stream cipher state. |
[in] | key | The cryptographic key to use. |
[in] | key_len | The length, in bytes, of the key. |
[in] | primitive | A stream cipher primitive. |
[in] | params | Stream cipher specific parameters. |
ORDO_SUCCESS
on success, else an error code. ORDO_PUBLIC void stream_update | ( | struct STREAM_STATE * | state, |
void * | buffer, | ||
size_t | len | ||
) |
Encrypts or decrypts a buffer using a stream cipher state.
[in,out] | state | An initialized stream cipher state. |
[in,out] | buffer | The buffer to encrypt or decrypt. |
[in] | len | The length, in bytes, of the buffer. |
ORDO_PUBLIC void stream_final | ( | struct STREAM_STATE * | state | ) |
Finalizes a stream cipher state.
[in,out] | state | An initialized stream cipher state. |
ORDO_PUBLIC size_t stream_query | ( | prim_t | primitive, |
int | query, | ||
size_t | value | ||
) |
Queries a stream cipher for suitable parameters.
[in] | primitive | A stream cipher primitive. |
[in] | query | A query code. |
[in] | value | A suggested value. |
query
based on value
.ORDO_PUBLIC size_t stream_bsize | ( | void | ) |
Gets the size in bytes of a STREAM_STATE
.