![]() |
nrfxlib API 3.3.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/decoder initialization.
The generator state ctx is initialized by this function.
| [out] | ctx | Encoder/decoder state. |
| n | Nonce (or IV). May be NULL. | |
| n_len | Nonce length. n_len = 8, 12, or 24. | |
| 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. n_len = 24, the XChaCha20 algorithm is used. key for a different message, a different nonce n or initial block counter count must be used.