BearSSL: br_gcm_context Struct Reference

BearSSL

Loading...
Searching...
No Matches
Data Fields
br_gcm_context Struct Reference

Context structure for GCM. More...

`#include <bearssl_aead.h>`

## Data Fields
const br_aead_class * | vtable
| Pointer to vtable for this context.

## Detailed Description

Context structure for GCM.

GCM is an AEAD mode that combines a block cipher in CTR mode with a MAC based on GHASH, to provide authenticated encryption:

- Any block cipher with 16-byte blocks can be used with GCM.
- The nonce can have any length, from 0 up to 2^64-1 bits; however, 96-bit nonces (12 bytes) are recommended (nonces with a length distinct from 12 bytes are internally hashed, which risks reusing nonce value with a small but not always negligible probability).
- Additional authenticated data may have length up to 2^64-1 bits.
- Message length may range up to 2^39-256 bits at most.
- The authentication tag has length 16 bytes.

The GCM initialisation function receives as parameter an initialised block cipher implementation context, with the secret key already set. A pointer to that context will be kept within the GCM context structure. It is up to the caller to allocate and initialise that block cipher context.

## Field Documentation

## ◆ vtable

const br_aead_class* br_gcm_context::vtable

Pointer to vtable for this context.

The documentation for this struct was generated from the following file:

- bearssl_aead.h