Classes | Macros | Functions | Variables
e_aesctrhmac.c File Reference
#include <openssl/aead.h>
#include <openssl/cipher.h>
#include <openssl/crypto.h>
#include <openssl/err.h>
#include <openssl/sha.h>
#include "../fipsmodule/cipher/internal.h"
Include dependency graph for e_aesctrhmac.c:

Go to the source code of this file.

Classes

struct  aead_aes_ctr_hmac_sha256_ctx
 

Macros

#define EVP_AEAD_AES_CTR_HMAC_SHA256_NONCE_LEN   12
 
#define EVP_AEAD_AES_CTR_HMAC_SHA256_TAG_LEN   SHA256_DIGEST_LENGTH
 

Functions

static void aead_aes_ctr_hmac_sha256_cleanup (EVP_AEAD_CTX *ctx)
 
static void aead_aes_ctr_hmac_sha256_crypt (const struct aead_aes_ctr_hmac_sha256_ctx *aes_ctx, uint8_t *out, const uint8_t *in, size_t len, const uint8_t *nonce)
 
static int aead_aes_ctr_hmac_sha256_init (EVP_AEAD_CTX *ctx, const uint8_t *key, size_t key_len, size_t tag_len)
 
static int aead_aes_ctr_hmac_sha256_open_gather (const EVP_AEAD_CTX *ctx, uint8_t *out, const uint8_t *nonce, size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *in_tag, size_t in_tag_len, const uint8_t *ad, size_t ad_len)
 
static int aead_aes_ctr_hmac_sha256_seal_scatter (const EVP_AEAD_CTX *ctx, uint8_t *out, uint8_t *out_tag, size_t *out_tag_len, size_t max_out_tag_len, const uint8_t *nonce, size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *extra_in, size_t extra_in_len, const uint8_t *ad, size_t ad_len)
 
const EVP_AEADEVP_aead_aes_128_ctr_hmac_sha256 (void)
 
const EVP_AEADEVP_aead_aes_256_ctr_hmac_sha256 (void)
 
static void hmac_calculate (uint8_t out[SHA256_DIGEST_LENGTH], const SHA256_CTX *inner_init_state, const SHA256_CTX *outer_init_state, const uint8_t *ad, size_t ad_len, const uint8_t *nonce, const uint8_t *ciphertext, size_t ciphertext_len)
 
static void hmac_init (SHA256_CTX *out_inner, SHA256_CTX *out_outer, const uint8_t hmac_key[32])
 
static void hmac_update_uint64 (SHA256_CTX *sha256, uint64_t value)
 
 OPENSSL_STATIC_ASSERT (sizeof(((EVP_AEAD_CTX *) NULL) ->state) >=sizeof(struct aead_aes_ctr_hmac_sha256_ctx), "AEAD state is too small")
 

Variables

static const EVP_AEAD aead_aes_128_ctr_hmac_sha256
 
static const EVP_AEAD aead_aes_256_ctr_hmac_sha256
 

Macro Definition Documentation

◆ EVP_AEAD_AES_CTR_HMAC_SHA256_NONCE_LEN

#define EVP_AEAD_AES_CTR_HMAC_SHA256_NONCE_LEN   12

Definition at line 25 of file e_aesctrhmac.c.

◆ EVP_AEAD_AES_CTR_HMAC_SHA256_TAG_LEN

#define EVP_AEAD_AES_CTR_HMAC_SHA256_TAG_LEN   SHA256_DIGEST_LENGTH

Definition at line 24 of file e_aesctrhmac.c.

Function Documentation

◆ aead_aes_ctr_hmac_sha256_cleanup()

static void aead_aes_ctr_hmac_sha256_cleanup ( EVP_AEAD_CTX ctx)
static

Definition at line 106 of file e_aesctrhmac.c.

◆ aead_aes_ctr_hmac_sha256_crypt()

static void aead_aes_ctr_hmac_sha256_crypt ( const struct aead_aes_ctr_hmac_sha256_ctx aes_ctx,
uint8_t out,
const uint8_t in,
size_t  len,
const uint8_t nonce 
)
static

Definition at line 152 of file e_aesctrhmac.c.

◆ aead_aes_ctr_hmac_sha256_init()

static int aead_aes_ctr_hmac_sha256_init ( EVP_AEAD_CTX ctx,
const uint8_t key,
size_t  key_len,
size_t  tag_len 
)
static

Definition at line 71 of file e_aesctrhmac.c.

◆ aead_aes_ctr_hmac_sha256_open_gather()

static int aead_aes_ctr_hmac_sha256_open_gather ( const EVP_AEAD_CTX ctx,
uint8_t out,
const uint8_t nonce,
size_t  nonce_len,
const uint8_t in,
size_t  in_len,
const uint8_t in_tag,
size_t  in_tag_len,
const uint8_t ad,
size_t  ad_len 
)
static

Definition at line 212 of file e_aesctrhmac.c.

◆ aead_aes_ctr_hmac_sha256_seal_scatter()

static int aead_aes_ctr_hmac_sha256_seal_scatter ( const EVP_AEAD_CTX ctx,
uint8_t out,
uint8_t out_tag,
size_t *  out_tag_len,
size_t  max_out_tag_len,
const uint8_t nonce,
size_t  nonce_len,
const uint8_t in,
size_t  in_len,
const uint8_t extra_in,
size_t  extra_in_len,
const uint8_t ad,
size_t  ad_len 
)
static

Definition at line 176 of file e_aesctrhmac.c.

◆ EVP_aead_aes_128_ctr_hmac_sha256()

const EVP_AEAD* EVP_aead_aes_128_ctr_hmac_sha256 ( void  )

Definition at line 277 of file e_aesctrhmac.c.

◆ EVP_aead_aes_256_ctr_hmac_sha256()

const EVP_AEAD* EVP_aead_aes_256_ctr_hmac_sha256 ( void  )

Definition at line 281 of file e_aesctrhmac.c.

◆ hmac_calculate()

static void hmac_calculate ( uint8_t  out[SHA256_DIGEST_LENGTH],
const SHA256_CTX inner_init_state,
const SHA256_CTX outer_init_state,
const uint8_t ad,
size_t  ad_len,
const uint8_t nonce,
const uint8_t ciphertext,
size_t  ciphertext_len 
)
static

Definition at line 119 of file e_aesctrhmac.c.

◆ hmac_init()

static void hmac_init ( SHA256_CTX out_inner,
SHA256_CTX out_outer,
const uint8_t  hmac_key[32] 
)
static

Definition at line 47 of file e_aesctrhmac.c.

◆ hmac_update_uint64()

static void hmac_update_uint64 ( SHA256_CTX sha256,
uint64_t  value 
)
static

Definition at line 108 of file e_aesctrhmac.c.

◆ OPENSSL_STATIC_ASSERT()

OPENSSL_STATIC_ASSERT ( sizeof(((EVP_AEAD_CTX *) NULL) ->state) >=sizeof(struct aead_aes_ctr_hmac_sha256_ctx ,
"AEAD state is too small"   
)

Variable Documentation

◆ aead_aes_128_ctr_hmac_sha256

const EVP_AEAD aead_aes_128_ctr_hmac_sha256
static

◆ aead_aes_256_ctr_hmac_sha256

const EVP_AEAD aead_aes_256_ctr_hmac_sha256
static
EVP_AEAD_AES_CTR_HMAC_SHA256_TAG_LEN
#define EVP_AEAD_AES_CTR_HMAC_SHA256_TAG_LEN
Definition: e_aesctrhmac.c:24
aead_aes_ctr_hmac_sha256_init
static int aead_aes_ctr_hmac_sha256_init(EVP_AEAD_CTX *ctx, const uint8_t *key, size_t key_len, size_t tag_len)
Definition: e_aesctrhmac.c:71
aead_aes_ctr_hmac_sha256_seal_scatter
static int aead_aes_ctr_hmac_sha256_seal_scatter(const EVP_AEAD_CTX *ctx, uint8_t *out, uint8_t *out_tag, size_t *out_tag_len, size_t max_out_tag_len, const uint8_t *nonce, size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *extra_in, size_t extra_in_len, const uint8_t *ad, size_t ad_len)
Definition: e_aesctrhmac.c:176
aead_aes_ctr_hmac_sha256_open_gather
static int aead_aes_ctr_hmac_sha256_open_gather(const EVP_AEAD_CTX *ctx, uint8_t *out, const uint8_t *nonce, size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *in_tag, size_t in_tag_len, const uint8_t *ad, size_t ad_len)
Definition: e_aesctrhmac.c:212
aead_aes_ctr_hmac_sha256_cleanup
static void aead_aes_ctr_hmac_sha256_cleanup(EVP_AEAD_CTX *ctx)
Definition: e_aesctrhmac.c:106


grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:11