NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
aes_gcm_common.h File Reference
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <doca_dev.h>
#include <doca_aes_gcm.h>
#include <doca_mmap.h>
#include <doca_error.h>
Include dependency graph for aes_gcm_common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  aes_gcm_cfg
 
struct  aes_gcm_resources
 

Macros

#define USER_MAX_FILE_NAME   255 /* Max file name length */
 
#define MAX_FILE_NAME   (USER_MAX_FILE_NAME + 1) /* Max file name string length */
 
#define AES_GCM_KEY_128_SIZE_IN_BYTES   16 /* AES-GCM 128 bits key size */
 
#define AES_GCM_KEY_256_SIZE_IN_BYTES   32 /* AES-GCM 256 bits key size */
 
#define MAX_AES_GCM_KEY_SIZE   AES_GCM_KEY_256_SIZE_IN_BYTES /* Max AES-GCM key size in bytes */
 
#define AES_GCM_KEY_128_STR_SIZE   (AES_GCM_KEY_128_SIZE_IN_BYTES * 2) /* AES-GCM 128 bits key string size */
 
#define AES_GCM_KEY_256_STR_SIZE   (AES_GCM_KEY_256_SIZE_IN_BYTES * 2) /* AES-GCM 256 bits key string size */
 
#define MAX_AES_GCM_KEY_STR_SIZE   (AES_GCM_KEY_256_STR_SIZE + 1) /* Max AES-GCM key string size */
 
#define AES_GCM_AUTH_TAG_96_SIZE_IN_BYTES   12 /* AES-GCM 96 bits authentication tag size */
 
#define AES_GCM_AUTH_TAG_128_SIZE_IN_BYTES   16 /* AES-GCM 128 bits authentication tag size */
 
#define MAX_AES_GCM_IV_LENGTH   12 /* Max IV length in bytes */
 
#define MAX_AES_GCM_IV_STR_LENGTH   ((MAX_AES_GCM_IV_LENGTH * 2) + 1) /* Max IV string length */
 
#define SLEEP_IN_NANOS   (10 * 1000) /* Sample the task every 10 microseconds */
 
#define NUM_AES_GCM_TASKS   (1) /* Number of AES-GCM tasks */
 

Enumerations

enum  aes_gcm_mode { AES_GCM_MODE_ENCRYPT , AES_GCM_MODE_DECRYPT }
 

Functions

void init_aes_gcm_params (struct aes_gcm_cfg *aes_gcm_cfg)
 
doca_error_t register_aes_gcm_params (void)
 
doca_error_t allocate_aes_gcm_resources (const char *pci_addr, uint32_t max_bufs, struct aes_gcm_resources *resources)
 
doca_error_t destroy_aes_gcm_resources (struct aes_gcm_resources *resources)
 
doca_error_t submit_aes_gcm_encrypt_task (struct aes_gcm_resources *resources, struct doca_buf *src_buf, struct doca_buf *dst_buf, struct doca_aes_gcm_key *key, const uint8_t *iv, uint32_t iv_length, uint32_t tag_size, uint32_t aad_size)
 
doca_error_t submit_aes_gcm_decrypt_task (struct aes_gcm_resources *resources, struct doca_buf *src_buf, struct doca_buf *dst_buf, struct doca_aes_gcm_key *key, const uint8_t *iv, uint32_t iv_length, uint32_t tag_size, uint32_t aad_size)
 
doca_error_t aes_gcm_task_encrypt_is_supported (struct doca_devinfo *devinfo)
 
doca_error_t aes_gcm_task_decrypt_is_supported (struct doca_devinfo *devinfo)
 
void encrypt_completed_callback (struct doca_aes_gcm_task_encrypt *encrypt_task, union doca_data task_user_data, union doca_data ctx_user_data)
 
void encrypt_error_callback (struct doca_aes_gcm_task_encrypt *encrypt_task, union doca_data task_user_data, union doca_data ctx_user_data)
 
void decrypt_completed_callback (struct doca_aes_gcm_task_decrypt *decrypt_task, union doca_data task_user_data, union doca_data ctx_user_data)
 
void decrypt_error_callback (struct doca_aes_gcm_task_decrypt *decrypt_task, union doca_data task_user_data, union doca_data ctx_user_data)
 

Macro Definition Documentation

◆ AES_GCM_AUTH_TAG_128_SIZE_IN_BYTES

#define AES_GCM_AUTH_TAG_128_SIZE_IN_BYTES   16 /* AES-GCM 128 bits authentication tag size */

Definition at line 50 of file aes_gcm_common.h.

◆ AES_GCM_AUTH_TAG_96_SIZE_IN_BYTES

#define AES_GCM_AUTH_TAG_96_SIZE_IN_BYTES   12 /* AES-GCM 96 bits authentication tag size */

Definition at line 49 of file aes_gcm_common.h.

◆ AES_GCM_KEY_128_SIZE_IN_BYTES

#define AES_GCM_KEY_128_SIZE_IN_BYTES   16 /* AES-GCM 128 bits key size */

Definition at line 41 of file aes_gcm_common.h.

◆ AES_GCM_KEY_128_STR_SIZE

#define AES_GCM_KEY_128_STR_SIZE   (AES_GCM_KEY_128_SIZE_IN_BYTES * 2) /* AES-GCM 128 bits key string size */

Definition at line 45 of file aes_gcm_common.h.

◆ AES_GCM_KEY_256_SIZE_IN_BYTES

#define AES_GCM_KEY_256_SIZE_IN_BYTES   32 /* AES-GCM 256 bits key size */

Definition at line 42 of file aes_gcm_common.h.

◆ AES_GCM_KEY_256_STR_SIZE

#define AES_GCM_KEY_256_STR_SIZE   (AES_GCM_KEY_256_SIZE_IN_BYTES * 2) /* AES-GCM 256 bits key string size */

Definition at line 46 of file aes_gcm_common.h.

◆ MAX_AES_GCM_IV_LENGTH

#define MAX_AES_GCM_IV_LENGTH   12 /* Max IV length in bytes */

Definition at line 52 of file aes_gcm_common.h.

◆ MAX_AES_GCM_IV_STR_LENGTH

#define MAX_AES_GCM_IV_STR_LENGTH   ((MAX_AES_GCM_IV_LENGTH * 2) + 1) /* Max IV string length */

Definition at line 53 of file aes_gcm_common.h.

◆ MAX_AES_GCM_KEY_SIZE

#define MAX_AES_GCM_KEY_SIZE   AES_GCM_KEY_256_SIZE_IN_BYTES /* Max AES-GCM key size in bytes */

Definition at line 43 of file aes_gcm_common.h.

◆ MAX_AES_GCM_KEY_STR_SIZE

#define MAX_AES_GCM_KEY_STR_SIZE   (AES_GCM_KEY_256_STR_SIZE + 1) /* Max AES-GCM key string size */

Definition at line 47 of file aes_gcm_common.h.

◆ MAX_FILE_NAME

#define MAX_FILE_NAME   (USER_MAX_FILE_NAME + 1) /* Max file name string length */

Definition at line 39 of file aes_gcm_common.h.

◆ NUM_AES_GCM_TASKS

#define NUM_AES_GCM_TASKS   (1) /* Number of AES-GCM tasks */

Definition at line 56 of file aes_gcm_common.h.

◆ SLEEP_IN_NANOS

#define SLEEP_IN_NANOS   (10 * 1000) /* Sample the task every 10 microseconds */

Definition at line 55 of file aes_gcm_common.h.

◆ USER_MAX_FILE_NAME

#define USER_MAX_FILE_NAME   255 /* Max file name length */

Definition at line 38 of file aes_gcm_common.h.

Enumeration Type Documentation

◆ aes_gcm_mode

Enumerator
AES_GCM_MODE_ENCRYPT 
AES_GCM_MODE_DECRYPT 

Definition at line 59 of file aes_gcm_common.h.

Function Documentation

◆ aes_gcm_task_decrypt_is_supported()

doca_error_t aes_gcm_task_decrypt_is_supported ( struct doca_devinfo *  devinfo)

Definition at line 805 of file aes_gcm_common.c.

◆ aes_gcm_task_encrypt_is_supported()

doca_error_t aes_gcm_task_encrypt_is_supported ( struct doca_devinfo *  devinfo)

Definition at line 800 of file aes_gcm_common.c.

◆ allocate_aes_gcm_resources()

doca_error_t allocate_aes_gcm_resources ( const char *  pci_addr,
uint32_t  max_bufs,
struct aes_gcm_resources resources 
)

Definition at line 520 of file aes_gcm_common.c.

◆ decrypt_completed_callback()

void decrypt_completed_callback ( struct doca_aes_gcm_task_decrypt *  decrypt_task,
union doca_data  task_user_data,
union doca_data  ctx_user_data 
)

Definition at line 850 of file aes_gcm_common.c.

◆ decrypt_error_callback()

void decrypt_error_callback ( struct doca_aes_gcm_task_decrypt *  decrypt_task,
union doca_data  task_user_data,
union doca_data  ctx_user_data 
)

Definition at line 870 of file aes_gcm_common.c.

◆ destroy_aes_gcm_resources()

doca_error_t destroy_aes_gcm_resources ( struct aes_gcm_resources resources)

Definition at line 652 of file aes_gcm_common.c.

◆ encrypt_completed_callback()

void encrypt_completed_callback ( struct doca_aes_gcm_task_encrypt *  encrypt_task,
union doca_data  task_user_data,
union doca_data  ctx_user_data 
)

Definition at line 810 of file aes_gcm_common.c.

◆ encrypt_error_callback()

void encrypt_error_callback ( struct doca_aes_gcm_task_encrypt *  encrypt_task,
union doca_data  task_user_data,
union doca_data  ctx_user_data 
)

Definition at line 830 of file aes_gcm_common.c.

◆ init_aes_gcm_params()

void init_aes_gcm_params ( struct aes_gcm_cfg aes_gcm_cfg)

Definition at line 51 of file aes_gcm_common.c.

◆ register_aes_gcm_params()

doca_error_t register_aes_gcm_params ( void  )

Definition at line 309 of file aes_gcm_common.c.

◆ submit_aes_gcm_decrypt_task()

doca_error_t submit_aes_gcm_decrypt_task ( struct aes_gcm_resources resources,
struct doca_buf *  src_buf,
struct doca_buf *  dst_buf,
struct doca_aes_gcm_key *  key,
const uint8_t *  iv,
uint32_t  iv_length,
uint32_t  tag_size,
uint32_t  aad_size 
)

Definition at line 741 of file aes_gcm_common.c.

◆ submit_aes_gcm_encrypt_task()

doca_error_t submit_aes_gcm_encrypt_task ( struct aes_gcm_resources resources,
struct doca_buf *  src_buf,
struct doca_buf *  dst_buf,
struct doca_aes_gcm_key *  key,
const uint8_t *  iv,
uint32_t  iv_length,
uint32_t  tag_size,
uint32_t  aad_size 
)

Definition at line 682 of file aes_gcm_common.c.