| 1 |
. |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
#ifndef RIST_CRYPTO_PRIVATE_H |
| 9 |
#define RIST_CRYPTO_PRIVATE_H |
| 10 |
|
| 11 |
#include "common/attributes.h" |
| 12 |
#include <stdint.h> |
| 13 |
#include <stddef.h> |
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
static inline void _librist_crypto_secure_zero(void *p, size_t n) |
| 18 |
{ |
| 19 |
volatile unsigned char *v = (volatile unsigned char *)p; |
| 20 |
while (n--) |
| 21 |
*v++ = 0; |
| 22 |
} |
| 23 |
|
| 24 |
RIST_PRIV uint64_t rist_siphash(uint64_t birthtime, uint32_t seq, const char *phrase); |
| 25 |
|
| 26 |
|
| 27 |
RIST_PRIV uint32_t prand_u32(void); |
| 28 |
|
| 29 |
|
| 30 |
RIST_PRIV int _librist_crypto_random_u32(uint32_t *out); |
| 31 |
|
| 32 |
#endif |