Tor
0.4.9.8
Loading...
Searching...
No Matches
ext
equix
hashx
src
siphash_rng.h
1
/* Copyright (c) 2020 tevador <tevador@gmail.com> */
2
/* See LICENSE for licensing information */
3
4
#ifndef SIPHASH_GENERATOR_H
5
#define SIPHASH_GENERATOR_H
6
7
#include <stdint.h>
8
#include <hashx.h>
9
#include "siphash.h"
10
11
typedef
struct
siphash_rng
{
12
siphash_state
keys;
13
uint64_t counter;
14
uint64_t buffer8, buffer32;
15
unsigned
count8, count32;
16
#ifdef HASHX_RNG_CALLBACK
17
void (*callback)(uint64_t *buffer,
void
*user_data);
18
void
*callback_user_data;
19
#endif
20
}
siphash_rng
;
21
22
#ifdef __cplusplus
23
extern
"C"
{
24
#endif
25
26
HASHX_PRIVATE
void
hashx_siphash_rng_init(
siphash_rng
* gen,
const
siphash_state
* state);
27
HASHX_PRIVATE uint32_t hashx_siphash_rng_u32(
siphash_rng
* gen);
28
HASHX_PRIVATE uint8_t hashx_siphash_rng_u8(
siphash_rng
* gen);
29
30
#ifdef __cplusplus
31
}
32
#endif
33
34
#endif
siphash_rng
Definition
siphash_rng.h:11
siphash_state
Definition
siphash.h:20
Generated by
1.12.0