nrfxlib API 2.8.99
|
void ocrypto_chacha20_init | ( | ocrypto_chacha20_ctx * | ctx, |
const uint8_t * | n, | ||
size_t | n_len, | ||
const uint8_t | key[(32)], | ||
uint32_t | count ) |
#include <crypto/nrf_oberon/include/ocrypto_chacha20.h>
ChaCha20 encoder initialization.
The generator state ctx
is initialized by this function.
[out] | ctx | Encoder state. |
n | Nonce. May be NULL. | |
n_len | Nonce length. 0 <= n_len <= ocrypto_chacha20_NONCE_BYTES_MAX . | |
key | Authentication key. May be NULL. | |
count | Initial block counter, usually 0 or 1. |
key
is NULL only n
and count
are set. If n
is NULL only key
is set. Both key
and n
must be set before update is called. key
for a different message, a different nonce n
or initial block counter count
must be used.