The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
blake2s.h
Go to the documentation of this file.
1#pragma once
2
3/**
4 * @file blake2s.h
5 * @brief the BLAKE2s hash (RFC 7693), without a key. the random pool uses
6 * it to mix its input.
7 */
8
9#include "common/stdint.h"
10
11#define BLAKE2S_BLOCK_SIZE 64
12#define BLAKE2S_HASH_SIZE 32
13
14typedef struct
15{
17 uint32_t t[2]; // the bytes hashed so far
21} blake2s_t;
22
23/**
24 * start a hash.
25 * @param out_length the hash size, 1 to BLAKE2S_HASH_SIZE bytes.
26 */
27void blake2s_init(blake2s_t *s, uint32_t out_length);
28
29void blake2s_update(blake2s_t *s, const void *data, uint32_t length);
30
31/**
32 * finish the hash. the state must be started again before more use.
33 */
34void blake2s_final(blake2s_t *s, uint8_t *out);
void blake2s_update(blake2s_t *s, const void *data, uint32_t length)
Definition blake2s.c:107
void blake2s_final(blake2s_t *s, uint8_t *out)
finish the hash.
Definition blake2s.c:131
void blake2s_init(blake2s_t *s, uint32_t out_length)
start a hash.
Definition blake2s.c:96
#define BLAKE2S_BLOCK_SIZE
Definition blake2s.h:11
unsigned int uint32_t
Definition fb.h:17
unsigned char uint8_t
Definition fb.h:18
Definition blake2s.h:15
uint32_t buffered
Definition blake2s.h:19
uint8_t buffer[BLAKE2S_BLOCK_SIZE]
Definition blake2s.h:18
uint32_t t[2]
Definition blake2s.h:17
uint32_t out_length
Definition blake2s.h:20
uint32_t h[8]
Definition blake2s.h:16