[#CRYPTO_ocb128_finish]
= CRYPTO&lowbar;ocb128&lowbar;finish
:mrdocs:

Finalise OCB and verify a received authentication tag&period;

== Synopsis

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

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

== Return Value

0 if `tag` matches, a non&hyphen;zero value if it does not, or &hyphen;1 if `len` is invalid&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *ctx*
| OCB context after encrypt&sol;decrypt (and AAD) processing&period;
| *tag*
| Expected authentication tag to compare&period;
| *len*
| Length of `tag` in bytes (1–16)&period;
|===


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