Ordo
0.3.4
Symmetric Cryptography Library
|
Module. More...
#include "ordo/digest/digest.h"
Go to the source code of this file.
Functions | |
ORDO_PUBLIC int | hmac_init (struct HMAC_CTX *ctx, const void *key, size_t key_len, prim_t hash, const void *params) |
ORDO_PUBLIC void | hmac_update (struct HMAC_CTX *ctx, const void *in, size_t in_len) |
ORDO_PUBLIC int | hmac_final (struct HMAC_CTX *ctx, void *fingerprint) |
ORDO_PUBLIC size_t | hmac_bsize (void) |
Module.
Module for computing HMAC's (Hash-based Message Authentication Codes), which combine a hash function with a cryptographic key securely in order to provide both authentication and integrity, as per RFC 2104.
ORDO_PUBLIC int hmac_init | ( | struct HMAC_CTX * | ctx, |
const void * | key, | ||
size_t | key_len, | ||
prim_t | hash, | ||
const void * | params | ||
) |
Initializes an HMAC context, provided optional parameters.
[in] | ctx | An allocated HMAC context. |
[in] | key | The cryptographic key to use. |
[in] | key_len | The size, in bytes, of the key. |
[out] | hash | A hash function primitive to use. |
[out] | params | Hash function specific parameters. |
ORDO_SUCCESS
on success, else an error code.ORDO_PUBLIC void hmac_update | ( | struct HMAC_CTX * | ctx, |
const void * | in, | ||
size_t | in_len | ||
) |
Updates an HMAC context, feeding more data into it.
[in] | ctx | An initialized HMAC context. |
[in] | in | The data to feed into the context. |
[in] | in_len | The length, in bytes, of the data. |
digest_update()
function. ORDO_PUBLIC int hmac_final | ( | struct HMAC_CTX * | ctx, |
void * | fingerprint | ||
) |
Finalizes a HMAC context, returning the final fingerprint.
[in] | ctx | An initialized HMAC context. |
[out] | fingerprint | The output buffer for the fingerprint. |
ORDO_SUCCESS
on success, else an error code.hash_digest_length()
. ORDO_PUBLIC size_t hmac_bsize | ( | void | ) |
Gets the size in bytes of an HMAC_CTX
.