[#CRYPTO_ocb128_setiv]
= CRYPTO&lowbar;ocb128&lowbar;setiv
:mrdocs:

Set the OCB IV &sol; nonce and authentication tag length for an operation&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
CRYPTO&lowbar;ocb128&lowbar;setiv(
    xref:OCB128_CONTEXT-0a.adoc[OCB128&lowbar;CONTEXT]* ctx,
    unsigned char const* iv,
    size&lowbar;t len,
    size&lowbar;t taglen);
----

== Return Value

1 on success, or &hyphen;1 if `len` or `taglen` is out of range&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *ctx*
| OCB context from CRYPTO&lowbar;ocb128&lowbar;new() or CRYPTO&lowbar;ocb128&lowbar;init()&period;
| *iv*
| Nonce octets (1–15 bytes)&period;
| *len*
| Length of `iv` in bytes&period;
| *taglen*
| Desired tag length in bytes (1–16)&period;
|===


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