![]() |
CRYPTO-C v1.1.3
C/C++ Documentation
|
Go to the source code of this file.
#include "utildev.h"Blake2b hash function support.
This file is based on Dr. Markku-Juhani O. Saarinen's "somewhat smaller" BLAKE2 implemetation...
... which was released into the Public Domain under the Creative Commons Zero v1.0 Universal license.
Macros | |
| #define | BLAKE2BLEN256 32 |
| 256-bit Blake2b digest length in bytes | |
| #define | BLAKE2BLEN384 48 |
| 384-bit Blake2b digest length in bytes | |
| #define | BLAKE2BLEN512 64 |
| 512-bit Blake2b digest length in bytes | |
Data Structures | |
| struct | BLAKE2B_CTX |
Functions | |
| int | blake2b_init (BLAKE2B_CTX *ctx, const void *key, int keylen, int outlen) |
| Initialize a Blake2b context with optional key. More... | |
| void | blake2b_update (BLAKE2B_CTX *ctx, const void *in, size_t inlen) |
| Add inlen bytes from in to a Blake2b context for hashing. More... | |
| void | blake2b_final (BLAKE2B_CTX *ctx, void *out) |
| Finalize a Blake2b message digest. More... | |
| int | blake2b (const void *in, size_t inlen, const void *key, int keylen, void *out, int outlen) |
| Convenient all-in-one Blake2b computation. More... | |
| int blake2b | ( | const void * | in, |
| size_t | inlen, | ||
| const void * | key, | ||
| int | keylen, | ||
| void * | out, | ||
| int | outlen | ||
| ) |
Convenient all-in-one Blake2b computation.
Performs blake2b_init(), blake2b_update() and blake2b_final(), and places the resulting hash in out.
| in | Pointer to data to hash |
| inlen | Length of in data, in bytes |
| key | Pointer to optional "key" input |
| keylen | Length of optional key input, in bytes |
| out | Pointer to location to place the message digest |
| outlen | Length* of desired message digest, in bytes *compatible message digest lengths are 32, 48 and 64 |
| void blake2b_final | ( | BLAKE2B_CTX * | ctx, |
| void * | out | ||
| ) |
Finalize a Blake2b message digest.
Generate the Blake2b message digest and place in out.
| ctx | Pointer to Blake2b context |
| out | Pointer to location to place the message digest |
| int blake2b_init | ( | BLAKE2B_CTX * | ctx, |
| const void * | key, | ||
| int | keylen, | ||
| int | outlen | ||
| ) |
Initialize a Blake2b context with optional key.
To hash without a key, specify NULL and 0 for key and keylen, respectively.
| ctx | Pointer to Blake2b context |
| key | Pointer to optional "key" input |
| keylen | Length of optional key input, in bytes |
| outlen | Byte length of desired digest |
| void blake2b_update | ( | BLAKE2B_CTX * | ctx, |
| const void * | in, | ||
| size_t | inlen | ||
| ) |
Add inlen bytes from in to a Blake2b context for hashing.
| ctx | Pointer to Blake2b context |
| in | Pointer to data to hash |
| inlen | Length of in data, in bytes |