![]() |
CRYPTO-C v1.1.3
C/C++ Documentation
|
#include "sha256.h"
SHA256 CUDA hash function support.
This file is based on Brad Conte's basic implementations of cryptography algorithms...
... and alterations to the transform function were based on Igor Pavlov's SHA256 implementation...
... both of which were released into the Public Domain.
Functions | |
__device__ void | cu_sha256_transform (SHA256_CTX *ctx, const uint8_t data[]) |
SHA256 transformation rounds. More... | |
__device__ void | cu_sha256_init (SHA256_CTX *ctx) |
Initialize a SHA256 context. More... | |
__device__ void | cu_sha256_update (SHA256_CTX *ctx, const void *in, size_t inlen) |
Add inlen bytes from in to a SHA256 context for hashing. More... | |
__device__ void | cu_sha256_final (SHA256_CTX *ctx, void *out) |
Finalize a SHA256 message digest. More... | |
__device__ void | cu_sha256 (const void *in, size_t inlen, void *out) |
Convenient all-in-one SHA256 computation. More... | |
__device__ void cu_sha256 | ( | const void * | in, |
size_t | inlen, | ||
void * | out | ||
) |
Convenient all-in-one SHA256 computation.
Performs cu_sha256_init(), cu_sha256_update() and cu_sha256_final(), and places the resulting hash in out.
in | Pointer to data to hash |
inlen | Length of in data, in bytes |
out | Pointer to location to place the message digest |
__device__ void cu_sha256_final | ( | SHA256_CTX * | ctx, |
void * | out | ||
) |
Finalize a SHA256 message digest.
Generate the SHA256 message digest and place in out.
ctx | Pointer to SHA256 context |
out | Pointer to location to place the message digest |
__device__ void cu_sha256_init | ( | SHA256_CTX * | ctx | ) |
Initialize a SHA256 context.
ctx | Pointer to SHA256 context |
__device__ void cu_sha256_transform | ( | SHA256_CTX * | ctx, |
const uint8_t | data[] | ||
) |
SHA256 transformation rounds.
ctx | Pointer to SHA256 context |
data | Pointer to input to be transformed |
SHA256 transformation constan
__device__ void cu_sha256_update | ( | SHA256_CTX * | ctx, |
const void * | in, | ||
size_t | inlen | ||
) |
Add inlen bytes from in to a SHA256 context for hashing.
ctx | Pointer to SHA256 context |
in | Pointer to data to hash |
inlen | Length of in data, in bytes |