Blame cbits/cryptonite_whirlpool.h
|
Packit |
141393 |
#ifndef CRYPTOHASH_WHIRLPOOL_H
|
|
Packit |
141393 |
#define CRYPTOHASH_WHIRLPOOL_H
|
|
Packit |
141393 |
|
|
Packit |
141393 |
#include <stdint.h>
|
|
Packit |
141393 |
|
|
Packit |
141393 |
/*
|
|
Packit |
141393 |
* Whirlpool-specific definitions.
|
|
Packit |
141393 |
*/
|
|
Packit |
141393 |
|
|
Packit |
141393 |
#define DIGESTBYTES 64
|
|
Packit |
141393 |
#define DIGESTBITS (8*DIGESTBYTES) /* 512 */
|
|
Packit |
141393 |
|
|
Packit |
141393 |
#define WBLOCKBYTES 64
|
|
Packit |
141393 |
#define WBLOCKBITS (8*WBLOCKBYTES) /* 512 */
|
|
Packit |
141393 |
|
|
Packit |
141393 |
#define LENGTHBYTES 32
|
|
Packit |
141393 |
#define LENGTHBITS (8*LENGTHBYTES) /* 256 */
|
|
Packit |
141393 |
|
|
Packit |
141393 |
typedef struct whirlpool_ctx {
|
|
Packit |
141393 |
uint8_t bitLength[LENGTHBYTES]; /* global number of hashed bits (256-bit counter) */
|
|
Packit |
141393 |
uint8_t buffer[WBLOCKBYTES]; /* buffer of data to hash */
|
|
Packit |
141393 |
uint32_t bufferBits; /* current number of bits on the buffer */
|
|
Packit |
141393 |
uint32_t bufferPos; /* current (possibly incomplete) byte slot on the buffer */
|
|
Packit |
141393 |
uint64_t hash[DIGESTBYTES/8]; /* the hashing state */
|
|
Packit |
141393 |
} whirlpool_ctx;
|
|
Packit |
141393 |
|
|
Packit |
141393 |
void cryptonite_whirlpool_init(struct whirlpool_ctx * const ctx);
|
|
Packit |
141393 |
void cryptonite_whirlpool_update(struct whirlpool_ctx * const ctx, const uint8_t * const source, uint32_t len);
|
|
Packit |
141393 |
void cryptonite_whirlpool_finalize(struct whirlpool_ctx * const ctx, uint8_t * const result);
|
|
Packit |
141393 |
|
|
Packit |
141393 |
#endif
|