The manual
ginnOS
The reference: libc, the libraries and the kernel
Toggle main menu visibility
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
14
typedef
struct
15
{
16
uint32_t
h
[8];
17
uint32_t
t
[2];
// the bytes hashed so far
18
uint8_t
buffer
[
BLAKE2S_BLOCK_SIZE
];
19
uint32_t
buffered
;
20
uint32_t
out_length
;
21
}
blake2s_t
;
22
23
/**
24
* start a hash.
25
* @param out_length the hash size, 1 to BLAKE2S_HASH_SIZE bytes.
26
*/
27
void
blake2s_init
(
blake2s_t
*s,
uint32_t
out_length);
28
29
void
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
*/
34
void
blake2s_final
(
blake2s_t
*s,
uint8_t
*out);
blake2s_update
void blake2s_update(blake2s_t *s, const void *data, uint32_t length)
Definition
blake2s.c:107
blake2s_final
void blake2s_final(blake2s_t *s, uint8_t *out)
finish the hash.
Definition
blake2s.c:131
blake2s_init
void blake2s_init(blake2s_t *s, uint32_t out_length)
start a hash.
Definition
blake2s.c:96
BLAKE2S_BLOCK_SIZE
#define BLAKE2S_BLOCK_SIZE
Definition
blake2s.h:11
stdint.h
uint32_t
unsigned int uint32_t
Definition
fb.h:17
uint8_t
unsigned char uint8_t
Definition
fb.h:18
blake2s_t
Definition
blake2s.h:15
blake2s_t::buffered
uint32_t buffered
Definition
blake2s.h:19
blake2s_t::buffer
uint8_t buffer[BLAKE2S_BLOCK_SIZE]
Definition
blake2s.h:18
blake2s_t::t
uint32_t t[2]
Definition
blake2s.h:17
blake2s_t::out_length
uint32_t out_length
Definition
blake2s.h:20
blake2s_t::h
uint32_t h[8]
Definition
blake2s.h:16
src
kernel
random
blake2s.h
Generated by
1.18.0