CRYPTO_gcm128_setiv

Set the GCM IV / nonce for a subsequent encrypt or decrypt operation.

Synopsis

Declared in <openssl/modes.h>

void
CRYPTO_gcm128_setiv(
    GCM128_CONTEXT* ctx,
    unsigned char const* iv,
    size_t len);

Parameters

NameDescription
ctxGCM context from CRYPTO_gcm128_new() or CRYPTO_gcm128_init().
ivIV octets (commonly 12 bytes for GCM).
lenLength of iv in bytes.