CRYPTO_gcm128_finish

Finalise GCM and optionally verify a received authentication tag.

Synopsis

Declared in <openssl/modes.h>

int
CRYPTO_gcm128_finish(
    GCM128_CONTEXT* ctx,
    unsigned char const* tag,
    size_t len);

Return Value

1 on success (and tag match when verifying), or 0 on failure.

Parameters

NameDescription
ctxGCM context after encrypt/decrypt (and AAD) processing.
tagExpected tag to verify, or NULL to skip verification (encrypt path).
lenLength of tag in bytes when tag is non-NULL.