c4e_sha.h File Reference

(Version 521)

Secure Hash Algorithm (SHA). More...

#include "c4e_sys.h"
#include "c4e_algo32.h"
#include "c4e_hash.h"
Include dependency graph for c4e_sha.h:

Go to the source code of this file.

Defines

#define C4E_SHA12_BLOCK_LOG2LEN
#define C4E_SHA1_DIGEST_LEN
#define C4E_SHA1_BLOCK_LEN
#define C4E_SHA1_CTX_WORDS
#define C4E_SHA1_TMP_WORDS
#define C4E_SHA1_MEM_WORDS
#define C4E_SHA224_DIGEST_LEN
#define C4E_SHA256_DIGEST_LEN
#define C4E_SHA2_BLOCK_LEN
#define C4E_SHA2_CTX_WORDS
#define C4E_SHA2_TMP_WORDS
#define C4E_SHA2_MEM_WORDS

Functions

void c4e_sha1_start (C4eAlgo32Uint ctx[C4E_SHA1_CTX_WORDS])
 Start of SHA-1.
void c4e_sha1_next (C4eAlgo32Uint ctx[C4E_RESTRICT C4E_SHA1_CTX_WORDS], C4eAlgo32Uint wtmp[C4E_RESTRICT C4E_SHA1_TMP_WORDS], C4E_CONST void *C4E_RESTRICT next)
 Processes the next data block of 64 bytes (C4E_SHA1_BLOCK_LEN) with SHA-1.
void c4e_sha1_stop (C4eAlgo32Uint ctx[C4E_RESTRICT C4E_SHA1_CTX_WORDS], C4eAlgo32Uint wtmp[C4E_RESTRICT C4E_SHA1_TMP_WORDS], C4E_CONST void *C4E_RESTRICT last, C4eArchUint len, C4eArchUint8 digest[C4E_RESTRICT C4E_SHA1_DIGEST_LEN])
 Processes the last SHA-1 data block (possibly of length zero) and returns the SHA-1 digest.
void c4e_sha1_mem (C4eAlgo32Uint tmp[C4E_RESTRICT C4E_SHA1_MEM_WORDS], C4E_CONST void *C4E_RESTRICT mem, C4eArchSize len, C4eArchUint8 digest[C4E_RESTRICT C4E_SHA1_DIGEST_LEN])
 This is an all-in-one function for the sandwich c4e_sha1_start(), c4e_sha1_next() and c4e_sha1_stop(), which computes the SHA-1 digest over a memory area.
void c4e_sha2_start (C4eAlgo32Uint ctx[C4E_SHA2_CTX_WORDS], C4eHashId hid)
 Start of SHA-224 or SHA-256.
void c4e_sha2_next (C4eAlgo32Uint ctx[C4E_RESTRICT C4E_SHA2_CTX_WORDS], C4eAlgo32Uint wtmp[C4E_RESTRICT C4E_SHA2_TMP_WORDS], C4E_CONST void *C4E_RESTRICT next)
 Processes the next data block of 64 bytes (C4E_SHA2_BLOCK_LEN) with SHA-256 or SHA224.
void c4e_sha2_stop (C4eAlgo32Uint ctx[C4E_RESTRICT C4E_SHA2_CTX_WORDS], C4eAlgo32Uint wtmp[C4E_RESTRICT C4E_SHA2_TMP_WORDS], C4E_CONST void *C4E_RESTRICT last, C4eArchUint len, C4eArchUint8 digest[C4E_RESTRICT C4E_SHA256_DIGEST_LEN])
 Processes the last SHA-224 or SHA-256 data block (possibly of length zero) and returns the digest.
void c4e_sha2_mem (C4eAlgo32Uint tmp[C4E_RESTRICT C4E_SHA2_MEM_WORDS], C4eHashId hid, C4E_CONST void *C4E_RESTRICT mem, C4eArchSize len, C4eArchUint8 digest[C4E_RESTRICT C4E_SHA256_DIGEST_LEN])
 This is an all-in-one function for the sandwich c4e_sha2_start(), c4e_sha2_next() and c4e_sha2_stop(), which computes the SHA-256/224 digest over a memory area.

Detailed Description

Secure Hash Algorithm (SHA).

Author:
Copyright (C) 2010, 2014, 2015 Ralf Hoppe <ralf.hoppe@ieee.org>
Version:
Id
c4e_sha.h 521 2015-01-27 19:59:40Z ralf

Definition in file c4e_sha.h.


Define Documentation

#define C4E_SHA12_BLOCK_LOG2LEN

log2 of of SHA-1, SHA-224 and SHA-256 block length.

Definition at line 35 of file c4e_sha.h.