[#CRYPTO_gcm128_finish]
= CRYPTO&lowbar;gcm128&lowbar;finish
:mrdocs:

Finalise GCM and optionally 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;gcm128&lowbar;finish(
    xref:GCM128_CONTEXT-04.adoc[GCM128&lowbar;CONTEXT]* ctx,
    unsigned char const* tag,
    size&lowbar;t len);
----

== Return Value

1 on success (and tag match when verifying), or 0 on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *ctx*
| GCM context after encrypt&sol;decrypt (and AAD) processing&period;
| *tag*
| Expected tag to verify, or NULL to skip verification (encrypt path)&period;
| *len*
| Length of `tag` in bytes when `tag` is non&hyphen;NULL&period;
|===


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