af1b9a407906447274547d9a3b3568e549f7d145
[tinc] / src / chacha-poly1305 / chacha.h
1 /*
2 chacha-merged.c version 20080118
3 D. J. Bernstein
4 Public domain.
5 */
6
7 #ifndef CHACHA_H
8 #define CHACHA_H
9
10 struct chacha_ctx {
11         uint32_t input[16];
12 };
13
14 #define CHACHA_MINKEYLEN        16
15 #define CHACHA_NONCELEN         8
16 #define CHACHA_CTRLEN           8
17 #define CHACHA_STATELEN         (CHACHA_NONCELEN+CHACHA_CTRLEN)
18 #define CHACHA_BLOCKLEN         64
19
20 void chacha_keysetup(struct chacha_ctx *x, const uint8_t *k, uint32_t kbits);
21 void chacha_ivsetup(struct chacha_ctx *x, const uint8_t *iv, const uint8_t *ctr);
22 void chacha_encrypt_bytes(struct chacha_ctx *x, const uint8_t *m, uint8_t * c, uint32_t bytes);
23
24 #endif /* CHACHA_H */