FD.io VPP  v20.01-rc1
Vector Packet Processing
aes_gcm.c File Reference
+ Include dependency graph for aes_gcm.c:

Go to the source code of this file.

Data Structures

struct  aes_gcm_key_data_t
 

Macros

#define foreach_aesni_gcm_handler_type   _(128) _(192) _(256)
 

Functions

static_always_inline __m128i aesni_gcm_bswap (__m128i x)
 
static_always_inline __m128i aesni_gcm_byte_mask (__m128i x, u8 n_bytes)
 
static_always_inline __m128i aesni_gcm_load_partial (__m128i *p, int n_bytes)
 
static_always_inline void aesni_gcm_store_partial (void *p, __m128i r, int n_bytes)
 
static_always_inline void aesni_gcm_load (__m128i *d, __m128i *inv, int n, int n_bytes)
 
static_always_inline void aesni_gcm_store (__m128i *d, __m128i *outv, int n, int n_bytes)
 
static_always_inline void aesni_gcm_enc_first_round (__m128i *r, __m128i *Y, u32 *ctr, __m128i k, int n_blocks)
 
static_always_inline void aesni_gcm_enc_round (__m128i *r, __m128i k, int n_blocks)
 
static_always_inline void aesni_gcm_enc_last_round (__m128i *r, __m128i *d, const __m128i *k, int rounds, int n_blocks)
 
static_always_inline __m128i aesni_gcm_ghash_blocks (__m128i T, aes_gcm_key_data_t *kd, const __m128i *in, int n_blocks)
 
static_always_inline __m128i aesni_gcm_ghash (__m128i T, aes_gcm_key_data_t *kd, const __m128i *in, u32 n_left)
 
static_always_inline __m128i aesni_gcm_calc (__m128i T, aes_gcm_key_data_t *kd, __m128i *d, __m128i *Y, u32 *ctr, __m128i *inv, __m128i *outv, int rounds, int n, int last_block_bytes, int with_ghash, int is_encrypt)
 
static_always_inline __m128i aesni_gcm_calc_double (__m128i T, aes_gcm_key_data_t *kd, __m128i *d, __m128i *Y, u32 *ctr, __m128i *inv, __m128i *outv, int rounds, int is_encrypt)
 
static_always_inline __m128i aesni_gcm_ghash_last (__m128i T, aes_gcm_key_data_t *kd, __m128i *d, int n_blocks, int n_bytes)
 
static_always_inline __m128i aesni_gcm_enc (__m128i T, aes_gcm_key_data_t *kd, __m128i Y, const u8 *in, const u8 *out, u32 n_left, int rounds)
 
static_always_inline __m128i aesni_gcm_dec (__m128i T, aes_gcm_key_data_t *kd, __m128i Y, const u8 *in, const u8 *out, u32 n_left, int rounds)
 
static_always_inline int aes_gcm (const u8 *in, u8 *out, const u8 *addt, const u8 *iv, u8 *tag, u32 data_bytes, u32 aad_bytes, u8 tag_len, aes_gcm_key_data_t *kd, int aes_rounds, int is_encrypt)
 
static_always_inline u32 aesni_ops_enc_aes_gcm (vlib_main_t *vm, vnet_crypto_op_t *ops[], u32 n_ops, aesni_key_size_t ks)
 
static_always_inline u32 aesni_ops_dec_aes_gcm (vlib_main_t *vm, vnet_crypto_op_t *ops[], u32 n_ops, aesni_key_size_t ks)
 
static_always_inline void * aesni_gcm_key_exp (vnet_crypto_key_t *key, aesni_key_size_t ks)
 
clib_error_tcrypto_ia32_aesni_gcm_init_sse42 (vlib_main_t *vm)
 

Variables

static const __m128i last_byte_one = { 0, 1ULL << 56 }
 
static const __m128i zero = { 0, 0 }
 
static const u8x16 bswap_mask
 
static const u8x16 byte_mask_scale
 
 foreach_aesni_gcm_handler_type
 

Macro Definition Documentation

◆ foreach_aesni_gcm_handler_type

#define foreach_aesni_gcm_handler_type   _(128) _(192) _(256)

Definition at line 733 of file aes_gcm.c.

Function Documentation

◆ aes_gcm()

static_always_inline int aes_gcm ( const u8 in,
u8 out,
const u8 addt,
const u8 iv,
u8 tag,
u32  data_bytes,
u32  aad_bytes,
u8  tag_len,
aes_gcm_key_data_t kd,
int  aes_rounds,
int  is_encrypt 
)

Definition at line 575 of file aes_gcm.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ aesni_gcm_bswap()

static_always_inline __m128i aesni_gcm_bswap ( __m128i  x)

Definition at line 50 of file aes_gcm.c.

+ Here is the caller graph for this function:

◆ aesni_gcm_byte_mask()

static_always_inline __m128i aesni_gcm_byte_mask ( __m128i  x,
u8  n_bytes 
)

Definition at line 56 of file aes_gcm.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ aesni_gcm_calc()

static_always_inline __m128i aesni_gcm_calc ( __m128i  T,
aes_gcm_key_data_t kd,
__m128i *  d,
__m128i *  Y,
u32 ctr,
__m128i *  inv,
__m128i *  outv,
int  rounds,
int  n,
int  last_block_bytes,
int  with_ghash,
int  is_encrypt 
)

Definition at line 207 of file aes_gcm.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ aesni_gcm_calc_double()

static_always_inline __m128i aesni_gcm_calc_double ( __m128i  T,
aes_gcm_key_data_t kd,
__m128i *  d,
__m128i *  Y,
u32 ctr,
__m128i *  inv,
__m128i *  outv,
int  rounds,
int  is_encrypt 
)

Definition at line 285 of file aes_gcm.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ aesni_gcm_dec()

static_always_inline __m128i aesni_gcm_dec ( __m128i  T,
aes_gcm_key_data_t kd,
__m128i  Y,
const u8 in,
const u8 out,
u32  n_left,
int  rounds 
)

Definition at line 524 of file aes_gcm.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ aesni_gcm_enc()

static_always_inline __m128i aesni_gcm_enc ( __m128i  T,
aes_gcm_key_data_t kd,
__m128i  Y,
const u8 in,
const u8 out,
u32  n_left,
int  rounds 
)

Definition at line 418 of file aes_gcm.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ aesni_gcm_enc_first_round()

static_always_inline void aesni_gcm_enc_first_round ( __m128i *  r,
__m128i *  Y,
u32 ctr,
__m128i  k,
int  n_blocks 
)

Definition at line 107 of file aes_gcm.c.

+ Here is the caller graph for this function:

◆ aesni_gcm_enc_last_round()

static_always_inline void aesni_gcm_enc_last_round ( __m128i *  r,
__m128i *  d,
const __m128i *  k,
int  rounds,
int  n_blocks 
)

Definition at line 139 of file aes_gcm.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ aesni_gcm_enc_round()

static_always_inline void aesni_gcm_enc_round ( __m128i *  r,
__m128i  k,
int  n_blocks 
)

Definition at line 132 of file aes_gcm.c.

+ Here is the caller graph for this function:

◆ aesni_gcm_ghash()

static_always_inline __m128i aesni_gcm_ghash ( __m128i  T,
aes_gcm_key_data_t kd,
const __m128i *  in,
u32  n_left 
)

Definition at line 166 of file aes_gcm.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ aesni_gcm_ghash_blocks()

static_always_inline __m128i aesni_gcm_ghash_blocks ( __m128i  T,
aes_gcm_key_data_t kd,
const __m128i *  in,
int  n_blocks 
)

Definition at line 152 of file aes_gcm.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ aesni_gcm_ghash_last()

static_always_inline __m128i aesni_gcm_ghash_last ( __m128i  T,
aes_gcm_key_data_t kd,
__m128i *  d,
int  n_blocks,
int  n_bytes 
)

Definition at line 396 of file aes_gcm.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ aesni_gcm_key_exp()

static_always_inline void* aesni_gcm_key_exp ( vnet_crypto_key_t key,
aesni_key_size_t  ks 
)

Definition at line 712 of file aes_gcm.c.

+ Here is the call graph for this function:

◆ aesni_gcm_load()

static_always_inline void aesni_gcm_load ( __m128i *  d,
__m128i *  inv,
int  n,
int  n_bytes 
)

Definition at line 87 of file aes_gcm.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ aesni_gcm_load_partial()

static_always_inline __m128i aesni_gcm_load_partial ( __m128i *  p,
int  n_bytes 
)

Definition at line 64 of file aes_gcm.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ aesni_gcm_store()

static_always_inline void aesni_gcm_store ( __m128i *  d,
__m128i *  outv,
int  n,
int  n_bytes 
)

Definition at line 96 of file aes_gcm.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ aesni_gcm_store_partial()

static_always_inline void aesni_gcm_store_partial ( void *  p,
__m128i  r,
int  n_bytes 
)

Definition at line 76 of file aes_gcm.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ aesni_ops_dec_aes_gcm()

static_always_inline u32 aesni_ops_dec_aes_gcm ( vlib_main_t vm,
vnet_crypto_op_t ops[],
u32  n_ops,
aesni_key_size_t  ks 
)

Definition at line 677 of file aes_gcm.c.

+ Here is the call graph for this function:

◆ aesni_ops_enc_aes_gcm()

static_always_inline u32 aesni_ops_enc_aes_gcm ( vlib_main_t vm,
vnet_crypto_op_t ops[],
u32  n_ops,
aesni_key_size_t  ks 
)

Definition at line 652 of file aes_gcm.c.

+ Here is the call graph for this function:

◆ crypto_ia32_aesni_gcm_init_sse42()

clib_error_t* crypto_ia32_aesni_gcm_init_sse42 ( vlib_main_t vm)

Definition at line 754 of file aes_gcm.c.

+ Here is the caller graph for this function:

Variable Documentation

◆ bswap_mask

const u8x16 bswap_mask
static
Initial value:
= {
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
}

Definition at line 41 of file aes_gcm.c.

◆ byte_mask_scale

const u8x16 byte_mask_scale
static
Initial value:
= {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
}

Definition at line 45 of file aes_gcm.c.

◆ foreach_aesni_gcm_handler_type

foreach_aesni_gcm_handler_type

Definition at line 745 of file aes_gcm.c.

◆ last_byte_one

const __m128i last_byte_one = { 0, 1ULL << 56 }
static

Definition at line 38 of file aes_gcm.c.

◆ zero

const __m128i zero = { 0, 0 }
static

Definition at line 39 of file aes_gcm.c.