![]() |
CRYPTO-C v1.1.3
C/C++ Documentation
|
Go to the source code of this file.
#include "utildev.h"
SHA256 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.
Macros | |
#define | SHA256LEN 32 |
SHA256 message digest length, in bytes. | |
Data Structures | |
struct | SHA256_CTX |
Functions | |
void | sha256_init (SHA256_CTX *ctx) |
Initialize a SHA256 context. More... | |
void | sha256_update (SHA256_CTX *ctx, const void *in, size_t inlen) |
Add inlen bytes from in to a SHA256 context for hashing. More... | |
void | sha256_final (SHA256_CTX *ctx, void *out) |
Finalize a SHA256 message digest. More... | |
void | sha256 (const void *in, size_t inlen, void *out) |
Convenient all-in-one SHA256 computation. More... | |
void sha256 | ( | const void * | in, |
size_t | inlen, | ||
void * | out | ||
) |
Convenient all-in-one SHA256 computation.
Performs sha256_init(), sha256_update() and 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 |
void 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 |
void sha256_init | ( | SHA256_CTX * | ctx | ) |
Initialize a SHA256 context.
ctx | Pointer to SHA256 context |
void 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 |