mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2025-07-29 01:48:43 -04:00
use ChaCha8-based CSPRNG
This commit is contained in:
parent
2b7c9362bb
commit
c41e659383
5 changed files with 235 additions and 7 deletions
18
chacha.h
Normal file
18
chacha.h
Normal file
|
@ -0,0 +1,18 @@
|
|||
#ifndef CHACHA_H
|
||||
#define CHACHA_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef uint8_t u8;
|
||||
typedef uint32_t u32;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u32 input[16];
|
||||
} chacha_ctx;
|
||||
|
||||
void chacha_keysetup(chacha_ctx *x,const u8 *k,u32 kbits);
|
||||
void chacha_ivsetup(chacha_ctx *x,const u8 *iv);
|
||||
void chacha_keystream_bytes(chacha_ctx *x,u8 *c,u32 bytes);
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue