pub unsafe extern "C" fn ocrypto_chacha20_init(
ctx: *mut ocrypto_chacha20_ctx,
n: *const u8,
n_len: usize,
key: *const u8,
count: u32,
)Expand description
ChaCha20 encoder initialization.
The generator state * ctx - is initialized by this function.
ctx- Encoder state.n- Nonce. 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.
@remark If * 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.
@remark If * n_len - = 24, the XChaCha20 algorithm is used.
@remark When reusing an encryption key * key - for a different message, a
different nonce * n - or initial block counter * count - must be used.