Software APIs
Data Fields
aes_gcm_context Struct Reference

AES-GCM context object for streaming operations. More...

#include <sw/device/lib/crypto/impl/aes_gcm/aes_gcm.h>

Data Fields

hardened_bool_t is_encrypt
 Whether this is an encryption operation (false indicates decryption).
 
aes_key_t key
 Underlying AES-CTR key.
 
aes_block_t initial_counter_block
 Initial counter block (J0 in the spec).
 
aes_block_t gctr_iv
 Current counter block for the main GCTR operation over the plaintext.
 
size_t aad_len
 Length of the associated data received so far, in bytes.
 
size_t input_len
 Length of the input so far, in bytes.
 
ghash_block_t partial_ghash_block
 Partial GHASH block. More...
 
aes_block_t partial_aes_block
 Partial input block. More...
 
ghash_context_t ghash_ctx
 Current context for the tag's ongoing GHASH computation.
 

Detailed Description

AES-GCM context object for streaming operations.

Definition at line 23 of file aes_gcm.h.

Field Documentation

◆ aad_len

size_t aes_gcm_context::aad_len

Length of the associated data received so far, in bytes.

Definition at line 43 of file aes_gcm.h.

◆ gctr_iv

aes_block_t aes_gcm_context::gctr_iv

Current counter block for the main GCTR operation over the plaintext.

Definition at line 39 of file aes_gcm.h.

◆ ghash_ctx

ghash_context_t aes_gcm_context::ghash_ctx

Current context for the tag's ongoing GHASH computation.

Definition at line 67 of file aes_gcm.h.

◆ initial_counter_block

aes_block_t aes_gcm_context::initial_counter_block

Initial counter block (J0 in the spec).

Definition at line 35 of file aes_gcm.h.

◆ input_len

size_t aes_gcm_context::input_len

Length of the input so far, in bytes.

Definition at line 47 of file aes_gcm.h.

◆ is_encrypt

hardened_bool_t aes_gcm_context::is_encrypt

Whether this is an encryption operation (false indicates decryption).

Definition at line 27 of file aes_gcm.h.

◆ key

aes_key_t aes_gcm_context::key

Underlying AES-CTR key.

Definition at line 31 of file aes_gcm.h.

◆ partial_aes_block

aes_block_t aes_gcm_context::partial_aes_block

Partial input block.

Length is always equal to input_len % kAesBlockNumBytes; the block may be empty, but will never be full.

Definition at line 63 of file aes_gcm.h.

◆ partial_ghash_block

ghash_block_t aes_gcm_context::partial_ghash_block

Partial GHASH block.

Length is always equal to aad_len % kGhashBlockNumBytes if the state is kAesGcmStateUpdateAad, and is always 0 if the state is kAesGcmStateUpdateEncryptedData (since ciphertext gets accumulated in full-block increments). The block may be empty, but will never be full.

Definition at line 56 of file aes_gcm.h.