StupidOS/lib/crypto/chacha20/chacha20.h
d0p1 🏳️‍⚧️ 0365dd5da5
Some checks are pending
Build / test (push) Waiting to run
Docs / test (push) Waiting to run
build: define INCDIR,BINDIR,LIBDIR...
2024-03-26 07:48:32 +01:00

21 lines
419 B
C

#ifndef CHACHA20_H
# define CHACHA20_H 1
# include <stdint.h>
# define CHACHA20_KEY_BYTES 32
# define CHACHA20_NONCE_BYTES 12
# define CHACHA20_BLOCK_BYTES 64
typedef struct
{
uint32_t state[4][4];
uint32_t ctr;
} ChaCha20Ctx;
void chacha20_init(ChaCha20Ctx *ctx, const uint8_t *key, uint32_t ctr,
const uint8_t *nonce);
void chacha20_block(ChaCha20Ctx *ctx, uint8_t *out);
#endif /* !CHACHA20_H */