mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2024-10-01 01:36:01 -04:00
dcd969ae04
The stdint.h types don't cover 128-bit integers and the underscore makes them ill suited to usage in function suffixes. Instead, use the common naming style in the Linux kernel and elsewhere including the ChaCha8 implementation included here.
18 lines
328 B
C
18 lines
328 B
C
#ifndef CHACHA_H
|
|
#define CHACHA_H
|
|
|
|
#include "util.h"
|
|
|
|
#define CHACHA_KEY_SIZE 32
|
|
#define CHACHA_IV_SIZE 8
|
|
|
|
typedef struct {
|
|
u32 input[16];
|
|
} chacha_ctx;
|
|
|
|
void chacha_keysetup(chacha_ctx *x, const u8 *k);
|
|
void chacha_ivsetup(chacha_ctx *x, const u8 *iv);
|
|
void chacha_keystream_bytes(chacha_ctx *x, u8 *c, u32 bytes);
|
|
|
|
#endif
|