2018-08-26 08:30:00 +05:30
|
|
|
#ifndef CHACHA_H
|
|
|
|
#define CHACHA_H
|
|
|
|
|
2018-10-04 23:55:16 +05:30
|
|
|
#include "util.h"
|
2018-08-26 08:30:00 +05:30
|
|
|
|
2018-09-11 19:52:28 +05:30
|
|
|
#define CHACHA_KEY_SIZE 32
|
|
|
|
#define CHACHA_IV_SIZE 8
|
|
|
|
|
2018-10-04 13:43:28 +05:30
|
|
|
typedef struct {
|
|
|
|
u32 input[16];
|
2018-08-26 08:30:00 +05:30
|
|
|
} chacha_ctx;
|
|
|
|
|
2018-10-04 13:43:28 +05:30
|
|
|
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);
|
2018-08-26 08:30:00 +05:30
|
|
|
|
|
|
|
#endif
|