The manual
ginnOS
The reference: libc, the libraries and the kernel
Toggle main menu visibility
Loading...
Searching...
No Matches
chacha20.h
Go to the documentation of this file.
1
#pragma once
2
3
/**
4
* @file chacha20.h
5
* @brief the ChaCha20 block function (RFC 8439 section 2.3).
6
*/
7
8
#include "
common/stdint.h
"
9
10
#define CHACHA20_KEY_SIZE 32
11
#define CHACHA20_BLOCK_SIZE 64
12
13
/**
14
* make one 64-byte block of key stream.
15
* @param key 32 bytes.
16
* @param counter the block counter.
17
* @param nonce 12 bytes.
18
* @param out receives 64 bytes.
19
*/
20
void
chacha20_block
(
const
uint8_t
key[
CHACHA20_KEY_SIZE
],
uint32_t
counter,
21
const
uint8_t
nonce[12],
uint8_t
out[
CHACHA20_BLOCK_SIZE
]);
chacha20_block
void chacha20_block(const uint8_t key[CHACHA20_KEY_SIZE], uint32_t counter, const uint8_t nonce[12], uint8_t out[CHACHA20_BLOCK_SIZE])
make one 64-byte block of key stream.
Definition
chacha20.c:38
CHACHA20_BLOCK_SIZE
#define CHACHA20_BLOCK_SIZE
Definition
chacha20.h:11
CHACHA20_KEY_SIZE
#define CHACHA20_KEY_SIZE
Definition
chacha20.h:10
stdint.h
uint32_t
unsigned int uint32_t
Definition
fb.h:17
uint8_t
unsigned char uint8_t
Definition
fb.h:18
src
kernel
random
chacha20.h
Generated by
1.18.0