2017-03-03 14:39:32 +01:00
|
|
|
#ifndef CHACHA_H
|
|
|
|
#define CHACHA_H
|
|
|
|
|
2017-03-03 16:42:48 +01:00
|
|
|
#include "machine.h"
|
2017-03-03 14:39:32 +01:00
|
|
|
|
2017-03-03 19:35:48 +01:00
|
|
|
#define CHACHA_BLOCKLENGTH 64
|
|
|
|
|
2017-03-03 16:42:48 +01:00
|
|
|
typedef struct {
|
|
|
|
u32 input[16];
|
2017-03-03 14:39:32 +01:00
|
|
|
} chacha_ctx;
|
|
|
|
|
|
|
|
void chacha_keysetup(chacha_ctx *x,const u8 *k,u32 kbits);
|
|
|
|
void chacha_ivsetup(chacha_ctx *x,const u8 *iv);
|
|
|
|
void chacha_encrypt_bytes(chacha_ctx *x,const u8 *m,u8 *c,u32 bytes);
|
|
|
|
|
|
|
|
#endif /* CHACHA_H */
|