![]() |
CRYPTO-C v1.1.3
C/C++ Documentation
|
#include "blake2b.h"Blake2b CUDA 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.
Functions | |
| __device__ void | cu_blake2b_compress (BLAKE2B_CTX *ctx, int last) |
| Blake2b compression rounds. More... | |
| __device__ int | cu_blake2b_init (BLAKE2B_CTX *ctx, const void *key, int keylen, int outlen) |
| Initialize a Blake2b context with optional key. More... | |
| __device__ void | cu_blake2b_update (BLAKE2B_CTX *ctx, const void *in, size_t inlen) |
| Add inlen bytes from in to a Blake2b context for hashing. More... | |
| __device__ void | cu_blake2b_final (BLAKE2B_CTX *ctx, void *out) |
| Finalize a Blake2b message digest. More... | |
| __device__ int | cu_blake2b (const void *in, size_t inlen, const void *key, int keylen, void *out, int outlen) |
| Convenient all-in-one Blake2b computation. More... | |
| __device__ int cu_blake2b | ( | const void * | in, |
| size_t | inlen, | ||
| const void * | key, | ||
| int | keylen, | ||
| void * | out, | ||
| int | outlen | ||
| ) |
Convenient all-in-one Blake2b computation.
Performs cu_blake2b_init(), cu_blake2b_update() and cu_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 |
| __device__ void cu_blake2b_compress | ( | BLAKE2B_CTX * | ctx, |
| int | last | ||
| ) |
Blake2b compression rounds.
| ctx | Pointer to Blake2b context |
| last | Flag indicating the final compression |
Blake2b compression Sigma. Used in compression rounds.
| __device__ void cu_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 |
| __device__ int cu_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 |
| __device__ void cu_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 |