![]() |
CRYPTO-C v1.1.3
C/C++ Documentation
|
Go to the source code of this file.
#include "utildev.h"
SHA1 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 Steve Reid's SHA1 implementation...
... both of which were released into the Public Domain.
Macros | |
#define | SHA1LEN 20 |
SHA1 message digest length, in bytes. | |
Data Structures | |
struct | SHA1_CTX |
Functions | |
void | sha1_init (SHA1_CTX *ctx) |
Initialize a SHA1 context. More... | |
void | sha1_update (SHA1_CTX *ctx, const void *in, size_t inlen) |
Add inlen bytes from in to a SHA1 context for hashing. More... | |
void | sha1_final (SHA1_CTX *ctx, void *out) |
Finalize a SHA1 message digest. More... | |
void | sha1 (const void *in, size_t inlen, void *out) |
Convenient all-in-one SHA1 computation. More... | |
void sha1 | ( | const void * | in, |
size_t | inlen, | ||
void * | out | ||
) |
Convenient all-in-one SHA1 computation.
Performs sha1_init(), sha1_update() and sha1_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 sha1_final | ( | SHA1_CTX * | ctx, |
void * | out | ||
) |
Finalize a SHA1 message digest.
Generate the SHA1 message digest and place in out.
ctx | Pointer to SHA1 context |
out | Pointer to location to place the message digest |
void sha1_init | ( | SHA1_CTX * | ctx | ) |
Initialize a SHA1 context.
ctx | Pointer to SHA1 context |
void sha1_update | ( | SHA1_CTX * | ctx, |
const void * | in, | ||
size_t | inlen | ||
) |
Add inlen bytes from in to a SHA1 context for hashing.
ctx | Pointer to SHA1 context |
in | Pointer to data to hash |
inlen | Length of in data, in bytes |