diff options
Diffstat (limited to 'src/include/skalibs/sha256.h')
| -rw-r--r-- | src/include/skalibs/sha256.h | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/include/skalibs/sha256.h b/src/include/skalibs/sha256.h index 8ef7d0b..77bbdb7 100644 --- a/src/include/skalibs/sha256.h +++ b/src/include/skalibs/sha256.h @@ -1,14 +1,7 @@ /* ISC license. */ -/* SHA256 routines */ -/* Written by David Madore (<URL: http://www.madore.org/~david/ >) */ -/* Adapted by Laurent Bercot. */ -/* This version last modified 2010-01-08 */ - -/* Note: these routines do not depend on endianness. */ - -#ifndef SHA256_H -#define SHA256_H +#ifndef SKALIBS_SHA256_H +#define SKALIBS_SHA256_H #include <sys/types.h> #include <stdint.h> @@ -16,10 +9,10 @@ typedef struct SHA256Schedule_s SHA256Schedule, *SHA256Schedule_ref ; struct SHA256Schedule_s { - uint32_t buf[8] ; /* The eight chaining variables */ - uint32_t bits[2] ; /* Count number of message bits */ - uint32_t in[16] ; /* Data being fed in */ - unsigned int b ; /* Our position within the 512 bits (always between 0 and 63) */ + uint32_t buf[8] ; + uint32_t bits[2] ; + uint32_t in[16] ; + uint32_t b ; } ; #define SHA256_INIT() { .buf = { 0x6a09e667U, 0xbb67ae85U, 0x3c6ef372U, 0xa54ff53aU, 0x510e527fU, 0x9b05688cU, 0x1f83d9abU, 0x5be0cd19U }, .bits = { 0, 0 }, .in = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, .b = 0 } |
