[#CRYPTO_ccm128_setiv]
= CRYPTO&lowbar;ccm128&lowbar;setiv
:mrdocs:

Set the CCM nonce and message length for a subsequent encrypt or decrypt&period;

== Synopsis

Declared in `&lt;openssl&sol;modes&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
CRYPTO&lowbar;ccm128&lowbar;setiv(
    xref:CCM128_CONTEXT-0c.adoc[CCM128&lowbar;CONTEXT]* ctx,
    unsigned char const* nonce,
    size&lowbar;t nlen,
    size&lowbar;t mlen);
----

== Return Value

0 on success, or &hyphen;1 if `nlen` is too short for the configured L&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *ctx*
| CCM context from CRYPTO&lowbar;ccm128&lowbar;init()&period;
| *nonce*
| Nonce octets&semi; length must be at least 15 &hyphen; L for the configured L&period;
| *nlen*
| Length of `nonce` in bytes&period;
| *mlen*
| Length of the message that will be encrypted or decrypted&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
