CRYPTO_ccm128_setiv

Set the CCM nonce and message length for a subsequent encrypt or decrypt.

Synopsis

Declared in <openssl/modes.h>

int
CRYPTO_ccm128_setiv(
    CCM128_CONTEXT* ctx,
    unsigned char const* nonce,
    size_t nlen,
    size_t mlen);

Return Value

0 on success, or -1 if nlen is too short for the configured L.

Parameters

NameDescription
ctxCCM context from CRYPTO_ccm128_init().
nonceNonce octets; length must be at least 15 - L for the configured L.
nlenLength of nonce in bytes.
mlenLength of the message that will be encrypted or decrypted.