Data Accelerator Offload
Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions
dao_liquid_crypto.h File Reference
#include <stdbool.h>
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  dao_lc_buf
 
struct  dao_lc_sym_op
 
union  dao_cpt_res_s
 
struct  dao_cpt_res_s::cpt_cn10k_res_s
 
struct  dao_cpt_res_s::cpt_cn9k_res_s
 
struct  dao_lc_info
 
struct  dao_lc_dev_conf
 
struct  dao_lc_qp_conf
 
struct  dao_lc_res
 
struct  dao_lc_cmd_sess_event
 
struct  dao_lc_cmd_event
 
struct  dao_lc_sym_fc_ctx
 
struct  dao_lc_sym_ctx
 

Macros

#define DAO_CRYPTO_VERSION_LEN   32
 
#define DAO_CRYPTO_MAX_NB_DEV   1
 
#define DAO_CMD_QP_IDX_INVALID   0xFFFF
 
#define DAO_LC_SESS_ID_INVALID   0
 

Enumerations

enum  dao_cpt_comp_code {
  DAO_CPT_COMP_NOT_DONE = 0 , DAO_CPT_COMP_GOOD , DAO_CPT_COMP_FAULT , DAO_CPT_COMP_SWERR ,
  DAO_CPT_COMP_HWERR , DAO_CPT_COMP_INSTERR , DAO_CPT_COMP_WARN
}
 
enum  dao_uc_rsa_comp_code {
  DAO_UC_RSA_SUCCESS = 0x00 , DAO_UC_RSA_SG_NOT_SUPPORTED = 0x04 , DAO_UC_RSA_MOD_LEN_INVALID = 0x06 , DAO_UC_RSA_MOD_LEN_NOT_EVEN = 0x09 ,
  DAO_UC_RSA_PKCS_DEC_INCORRECT = 0x0A
}
 
enum  dao_liquid_crypto_rsa_key_type { DAO_LC_RSA_KEY_TYPE_PUBLIC , DAO_LC_RSA_KEY_TYPE_PRIVATE }
 
enum  dao_lc_cmd_event_type { DAO_LC_CMD_EVENT_SESS_CREATE = 0 , DAO_LC_CMD_EVENT_SESS_DESTROY = 1 }
 
enum  dao_lc_sym_opcode { DAO_LC_SYM_OPCODE_FC = 0x33 }
 
enum  dao_lc_fc_iv_src { DAO_LC_FC_IV_SRC_CTX = 0 , DAO_LC_FC_IV_SRC_OP = 1 }
 
enum  dao_lc_fc_aes_key_len { DAO_LC_FC_AES_KEY_LEN_128 = 1 , DAO_LC_FC_AES_KEY_LEN_192 = 2 , DAO_LC_FC_AES_KEY_LEN_256 = 3 }
 
enum  dao_lc_fc_enc_cipher {
  DAO_LC_FC_ENC_CIPHER_NULL = 0 , DAO_LC_FC_ENC_CIPHER_3DES_CBC = 1 , DAO_LC_FC_ENC_CIPHER_3DES_ECB = 2 , DAO_LC_FC_ENC_CIPHER_AES_CBC = 3 ,
  DAO_LC_FC_ENC_CIPHER_AES_ECB = 4 , DAO_LC_FC_ENC_CIPHER_AES_CFB = 5 , DAO_LC_FC_ENC_CIPHER_AES_CTR = 6 , DAO_LC_FC_ENC_CIPHER_AES_GCM = 7 ,
  DAO_LC_FC_ENC_CIPHER_AES_XTS = 8 , DAO_LC_FC_ENC_CIPHER_CHACHA = 9 , DAO_LC_FC_ENC_CIPHER_AES_CCM = 10
}
 
enum  dao_lc_fc_auth_input_type { DAO_LC_FC_AUTH_INPUT_OPAD_IPAD = 0 , DAO_LC_FC_AUTH_INPUT_KEY = 1 }
 
enum  dao_lc_fc_auth_key_src { DAO_LC_FC_AUTH_KEY_SRC_CTX = 0 , DAO_LC_FC_AUTH_KEY_SRC_OP = 1 }
 
enum  dao_lc_fc_hash_type {
  DAO_LC_FC_HASH_TYPE_NULL = 0 , DAO_LC_FC_HASH_TYPE_MD5 = 1 , DAO_LC_FC_HASH_TYPE_SHA1 = 2 , DAO_LC_FC_HASH_TYPE_SHA2_SHA224 = 3 ,
  DAO_LC_FC_HASH_TYPE_SHA2_SHA256 = 4 , DAO_LC_FC_HASH_TYPE_SHA2_SHA384 = 5 , DAO_LC_FC_HASH_TYPE_SHA2_SHA512 = 6 , DAO_LC_FC_HASH_TYPE_GMAC = 7 ,
  DAO_LC_FC_HASH_TYPE_POLY1305 = 8
}
 

Functions

int dao_liquid_crypto_init (void)
 
int dao_liquid_crypto_fini (void)
 
int dao_liquid_crypto_info_get (struct dao_lc_info *info)
 
int dao_liquid_crypto_dev_create (struct dao_lc_dev_conf *conf)
 
int dao_liquid_crypto_dev_destroy (uint8_t dev_id)
 
int dao_liquid_crypto_qp_configure (uint8_t dev_id, uint16_t qp_id, struct dao_lc_qp_conf *conf)
 
int dao_liquid_crypto_dev_start (uint8_t dev_id)
 
int dao_liquid_crypto_dev_stop (uint8_t dev_id)
 
int dao_liquid_crypto_enqueue_op_passthrough (uint8_t dev_id, uint16_t qp_id, uint64_t op_cookie)
 
int dao_crypto_enqueue_op_pkcs1v15enc (uint8_t dev_id, uint16_t qp_id, enum dao_liquid_crypto_rsa_key_type key_type, uint16_t mod_len, uint16_t exp_len, uint16_t msg_len, uint8_t *mod, uint8_t *exp, uint8_t *msg, uint8_t *em, uint64_t op_cookie)
 
int dao_crypto_enqueue_op_pkcs1v15dec (uint8_t dev_id, uint16_t qp_id, enum dao_liquid_crypto_rsa_key_type key_type, uint16_t mod_len, uint16_t exp_len, uint8_t *mod, uint8_t *exp, uint8_t *em, uint8_t *msg, uint64_t op_cookie)
 
int dao_crypto_enqueue_op_pkcs1v15enc_crt (uint8_t dev_id, uint16_t qp_id, uint16_t mod_len, uint16_t msg_len, uint8_t *q, uint8_t *dQ, uint8_t *p, uint8_t *dP, uint8_t *qInv, uint8_t *msg, uint8_t *em, uint64_t op_cookie)
 
int dao_crypto_enqueue_op_pkcs1v15dec_crt (uint8_t dev_id, uint16_t qp_id, uint16_t mod_len, uint8_t *q, uint8_t *dQ, uint8_t *p, uint8_t *dP, uint8_t *qInv, uint8_t *em, uint8_t *msg, uint64_t op_cookie)
 
uint16_t dao_liquid_crypto_sym_enqueue_burst (uint8_t dev_id, uint16_t qp_id, struct dao_lc_sym_op *op, uint16_t nb_ops)
 
uint16_t dao_liquid_crypto_dequeue_burst (uint8_t dev_id, uint16_t qp_id, struct dao_lc_res *res, uint16_t nb_ops)
 
int dao_liquid_crypto_sym_sess_create (uint8_t dev_id, const struct dao_lc_sym_ctx *ctx, uint64_t sess_cookie)
 
int dao_liquid_crypto_sym_sess_destroy (uint8_t dev_id, uint64_t sess_id, uint64_t sess_cookie)
 
uint16_t dao_liquid_crypto_cmd_event_dequeue (uint8_t dev_id, struct dao_lc_cmd_event *events, uint16_t nb_events)
 

Detailed Description

This file contains the API for liquid crypto.

Definition in file dao_liquid_crypto.h.

Macro Definition Documentation

◆ DAO_CRYPTO_VERSION_LEN

#define DAO_CRYPTO_VERSION_LEN   32

The maximum length of the version string.

Definition at line 18 of file dao_liquid_crypto.h.

◆ DAO_CRYPTO_MAX_NB_DEV

#define DAO_CRYPTO_MAX_NB_DEV   1

The maximum number of devices supported by the liquid crypto library.

Definition at line 20 of file dao_liquid_crypto.h.

◆ DAO_CMD_QP_IDX_INVALID

#define DAO_CMD_QP_IDX_INVALID   0xFFFF

Use DAO_CMD_QP_IDX_INVALID as cmd_qp_idx value to disable command queue altogether.

Definition at line 22 of file dao_liquid_crypto.h.

◆ DAO_LC_SESS_ID_INVALID

#define DAO_LC_SESS_ID_INVALID   0

Session ID returned as response if the session create request fails

Definition at line 24 of file dao_liquid_crypto.h.

Enumeration Type Documentation

◆ dao_cpt_comp_code

CPT hardware completion codes.

Enumerator
DAO_CPT_COMP_NOT_DONE 

Request not completed.

DAO_CPT_COMP_GOOD 

Request completed successfully.

DAO_CPT_COMP_FAULT 

CPT detected a memory fault.

DAO_CPT_COMP_SWERR 

Microcode detected an illegal instruction.

DAO_CPT_COMP_HWERR 

CPT detected an uncorrectable error.

DAO_CPT_COMP_INSTERR 

CPT detected an illegal instruction.

DAO_CPT_COMP_WARN 

Request completed with a warning.

Definition at line 88 of file dao_liquid_crypto.h.

◆ dao_uc_rsa_comp_code

CPT microcode completion codes.

Enumerator
DAO_UC_RSA_SUCCESS 

Request completed.

DAO_UC_RSA_SG_NOT_SUPPORTED 

Scatter/Gather not supported.

DAO_UC_RSA_MOD_LEN_INVALID 

Invalid mod length.

DAO_UC_RSA_MOD_LEN_NOT_EVEN 

Mod length not even.

DAO_UC_RSA_PKCS_DEC_INCORRECT 

PKCS decrypt incorrect.

Definition at line 108 of file dao_liquid_crypto.h.

◆ dao_liquid_crypto_rsa_key_type

The liquid crypto RSA key type.

Enumerator
DAO_LC_RSA_KEY_TYPE_PUBLIC 

Public key

DAO_LC_RSA_KEY_TYPE_PRIVATE 

Private key

Definition at line 246 of file dao_liquid_crypto.h.

◆ dao_lc_cmd_event_type

The liquid crypto command event type.

This enumeration defines the command event types supported by liquid crypto. The command event type is used to indicate the type of command event.

Enumerator
DAO_LC_CMD_EVENT_SESS_CREATE 

Event type for session create

DAO_LC_CMD_EVENT_SESS_DESTROY 

Event type for session destroy

Definition at line 259 of file dao_liquid_crypto.h.

◆ dao_lc_sym_opcode

The liquid crypto symmetric op code.

This enumeration defines the symmetric operation codes supported by the microcode.

Enumerator
DAO_LC_SYM_OPCODE_FC 

Opcode for Flexi Crypto

Definition at line 297 of file dao_liquid_crypto.h.

◆ dao_lc_fc_iv_src

The liquid crypto flexi crypto IV source.

Enumerator
DAO_LC_FC_IV_SRC_CTX 

Flexi Crypto IV Source = CTX

DAO_LC_FC_IV_SRC_OP 

Flexi Crypto IV Source = OP

Definition at line 305 of file dao_liquid_crypto.h.

◆ dao_lc_fc_aes_key_len

The liquid crypto flexi crypto AES key length.

Enumerator
DAO_LC_FC_AES_KEY_LEN_128 

Flexi Crypto AES Key Length = 128

DAO_LC_FC_AES_KEY_LEN_192 

Flexi Crypto AES Key Length = 192

DAO_LC_FC_AES_KEY_LEN_256 

Flexi Crypto AES Key Length = 256

Definition at line 315 of file dao_liquid_crypto.h.

◆ dao_lc_fc_enc_cipher

The liquid crypto flexi crypto encryption cipher.

Enumerator
DAO_LC_FC_ENC_CIPHER_NULL 

Flexi Crypto Encryption Cipher Type = NULL

DAO_LC_FC_ENC_CIPHER_3DES_CBC 

Flexi Crypto Encryption Cipher Type = 3DES-CBC

DAO_LC_FC_ENC_CIPHER_3DES_ECB 

Flexi Crypto Encryption Cipher Type = 3DES-ECB

DAO_LC_FC_ENC_CIPHER_AES_CBC 

Flexi Crypto Encryption Cipher Type = AES-CBC

DAO_LC_FC_ENC_CIPHER_AES_ECB 

Flexi Crypto Encryption Cipher Type = AES-ECB

DAO_LC_FC_ENC_CIPHER_AES_CFB 

Flexi Crypto Encryption Cipher Type = AES-CFB

DAO_LC_FC_ENC_CIPHER_AES_CTR 

Flexi Crypto Encryption Cipher Type = AES-CTR

DAO_LC_FC_ENC_CIPHER_AES_GCM 

Flexi Crypto Encryption Cipher Type = AES-GCM

DAO_LC_FC_ENC_CIPHER_AES_XTS 

Flexi Crypto Encryption Cipher Type = AES-XTS

DAO_LC_FC_ENC_CIPHER_CHACHA 

Flexi Crypto Encryption Cipher Type = ChaCha

DAO_LC_FC_ENC_CIPHER_AES_CCM 

Flexi Crypto Encryption Cipher Type = AES-CCM

Definition at line 327 of file dao_liquid_crypto.h.

◆ dao_lc_fc_auth_input_type

The liquid crypto flexi crypto authentication input type.

Enumerator
DAO_LC_FC_AUTH_INPUT_OPAD_IPAD 

Flexi Crypto Authentication Input Type = OPAD/IPAD

DAO_LC_FC_AUTH_INPUT_KEY 

Flexi Crypto Authentication Input Type = Key

Definition at line 355 of file dao_liquid_crypto.h.

◆ dao_lc_fc_auth_key_src

The liquid crypto flexi crypto authentication key source.

Enumerator
DAO_LC_FC_AUTH_KEY_SRC_CTX 

Flexi Crypto Authentication Key Source = CTX

DAO_LC_FC_AUTH_KEY_SRC_OP 

Flexi Crypto Authentication Key Source = OP

Definition at line 365 of file dao_liquid_crypto.h.

◆ dao_lc_fc_hash_type

The liquid crypto flexi crypto hash type.

Enumerator
DAO_LC_FC_HASH_TYPE_NULL 

Flexi Crypto Hash Type = NULL

DAO_LC_FC_HASH_TYPE_MD5 

Flexi Crypto Hash Type = MD5

DAO_LC_FC_HASH_TYPE_SHA1 

Flexi Crypto Hash Type = SHA1

DAO_LC_FC_HASH_TYPE_SHA2_SHA224 

Flexi Crypto Hash Type = SHA2-SHA224

DAO_LC_FC_HASH_TYPE_SHA2_SHA256 

Flexi Crypto Hash Type = SHA2-SHA256

DAO_LC_FC_HASH_TYPE_SHA2_SHA384 

Flexi Crypto Hash Type = SHA2-SHA384

DAO_LC_FC_HASH_TYPE_SHA2_SHA512 

Flexi Crypto Hash Type = SHA2-SHA512

DAO_LC_FC_HASH_TYPE_GMAC 

Flexi Crypto Hash Type = GMAC

DAO_LC_FC_HASH_TYPE_POLY1305 

Flexi Crypto Hash Type = POLY1305

Definition at line 375 of file dao_liquid_crypto.h.

Function Documentation

◆ dao_liquid_crypto_init()

int dao_liquid_crypto_init ( void  )

Initialize liquid crypto.

This function initializes the liquid crypto library. This API must be called before any other liquid crypto API and must be called after calling rte_eal_init().

Returns
  • On success, 0 is returned.
  • On failure, a negative value is returned indicating the cause

◆ dao_liquid_crypto_fini()

int dao_liquid_crypto_fini ( void  )

Cleanup liquid crypto.

This function cleans up the liquid crypto library.

Returns
  • On success, 0 is returned.
  • On failure, a negative value is returned indicating the cause

◆ dao_liquid_crypto_info_get()

int dao_liquid_crypto_info_get ( struct dao_lc_info info)

Get liquid crypto information.

This function retrieves the liquid crypto information.

Parameters
info[out] A pointer to the liquid crypto information structure.
Returns
  • On success, 0 is returned.
  • On failure, a negative value is returned indicating the cause

◆ dao_liquid_crypto_dev_create()

int dao_liquid_crypto_dev_create ( struct dao_lc_dev_conf conf)

Create a liquid crypto device.

This function creates a liquid crypto device.

Parameters
confA pointer to the liquid crypto device configuration structure.
Returns
  • On success, 0 is returned.
  • On failure, a negative value is returned indicating the cause

◆ dao_liquid_crypto_dev_destroy()

int dao_liquid_crypto_dev_destroy ( uint8_t  dev_id)

Destroy a liquid crypto device.

This function destroys a liquid crypto device. The device must be stopped before it can be destroyed.

Parameters
dev_idThe device identifier.
Returns
  • On success, 0 is returned.
  • On failure, a negative value is returned indicating the cause

◆ dao_liquid_crypto_qp_configure()

int dao_liquid_crypto_qp_configure ( uint8_t  dev_id,
uint16_t  qp_id,
struct dao_lc_qp_conf conf 
)

Configure a liquid crypto queue pair.

This function configures a liquid crypto queue pair. Queue pairs can be configured only when the device is stopped.

Parameters
dev_idThe device identifier. Value must between 0 and dao_lc_info.nb_dev - 1.
qp_idThe queue pair identifier. Value must between 0 and dao_lc_info.nb_qp[dev_id] - 1.
confA pointer to the liquid crypto queue pair configuration structure.
Returns
  • On success, 0 is returned.
  • On failure, a negative value is returned indicating the cause

◆ dao_liquid_crypto_dev_start()

int dao_liquid_crypto_dev_start ( uint8_t  dev_id)

Start a liquid crypto device.

This function starts a liquid crypto device. The device must be created before it can be started.

Parameters
dev_idThe device identifier.
Returns
  • On success, 0 is returned.
  • On failure, a negative value is returned indicating the cause

◆ dao_liquid_crypto_dev_stop()

int dao_liquid_crypto_dev_stop ( uint8_t  dev_id)

Stop a liquid crypto device.

This function stops a liquid crypto device.

Parameters
dev_idThe device identifier.
Returns
  • On success, 0 is returned.
  • On failure, a negative value is returned indicating the cause

◆ dao_liquid_crypto_enqueue_op_passthrough()

int dao_liquid_crypto_enqueue_op_passthrough ( uint8_t  dev_id,
uint16_t  qp_id,
uint64_t  op_cookie 
)

Enqueue passthrough operation to the liquid crypto device.

Parameters
dev_idThe identifier of the device.
qp_idThe index of the queue pair on which the operation is to be enqueued.
op_cookieThe cookie to be associated with the operation. This cookie is returned in the dao_lc_res structure when the operation is dequeued.

◆ dao_crypto_enqueue_op_pkcs1v15enc()

int dao_crypto_enqueue_op_pkcs1v15enc ( uint8_t  dev_id,
uint16_t  qp_id,
enum dao_liquid_crypto_rsa_key_type  key_type,
uint16_t  mod_len,
uint16_t  exp_len,
uint16_t  msg_len,
uint8_t *  mod,
uint8_t *  exp,
uint8_t *  msg,
uint8_t *  em,
uint64_t  op_cookie 
)

Enqueue request to perform RSA encrypt operation on the crypto device.

Parameters
dev_idThe identifier of the device.
qp_idThe index of the queue pair on which the operation is to be enqueued.
key_typeThe type of RSA key to be used.
mod_lenThe length of the modulus.
exp_lenThe length of the exponent.
msg_lenThe length of the message.
modThe address of the buffer containing the modulus.
expThe address of the buffer containing the exponent.
msgThe address of the buffer containing the message.
emThe address of the buffer where the encrypted message is to be stored.
op_cookieThe cookie to be associated with the operation. This cookie is returned in the dao_crypto_res structure when the operation is dequeued.
Returns
0 on success, negative value on failure.

◆ dao_crypto_enqueue_op_pkcs1v15dec()

int dao_crypto_enqueue_op_pkcs1v15dec ( uint8_t  dev_id,
uint16_t  qp_id,
enum dao_liquid_crypto_rsa_key_type  key_type,
uint16_t  mod_len,
uint16_t  exp_len,
uint8_t *  mod,
uint8_t *  exp,
uint8_t *  em,
uint8_t *  msg,
uint64_t  op_cookie 
)

Enqueue request to perform RSA decrypt operation on the crypto device.

Parameters
dev_idThe identifier of the device.
qp_idThe index of the queue pair on which the operation is to be enqueued.
key_typeThe type of RSA key to be used.
mod_lenThe length of the modulus.
exp_lenThe length of the exponent.
modThe address of the buffer containing the modulus.
expThe address of the buffer containing the exponent.
emThe address of the buffer containing the encrypted message. Length of this buffer must be at least mod_len bytes.
msgThe address of the buffer where the decrypted message is to be stored.
op_cookieThe cookie to be associated with the operation. This cookie is returned in the dao_crypto_res structure when the operation is dequeued.
Returns
0 on success, negative value on failure.

◆ dao_crypto_enqueue_op_pkcs1v15enc_crt()

int dao_crypto_enqueue_op_pkcs1v15enc_crt ( uint8_t  dev_id,
uint16_t  qp_id,
uint16_t  mod_len,
uint16_t  msg_len,
uint8_t *  q,
uint8_t *  dQ,
uint8_t *  p,
uint8_t *  dP,
uint8_t *  qInv,
uint8_t *  msg,
uint8_t *  em,
uint64_t  op_cookie 
)

Enqueue request to perform RSA CRT encrypt operation on the crypto device.

Parameters
dev_idThe identifier of the device.
qp_idThe index of the queue pair on which the operation is to be enqueued.
mod_lenThe length of the modulus. Value must be even and should be at least 34 bytes and at most 1024 bytes.
msg_lenThe length of the message in bytes. Value must be at most mod_len - 11.
qThe address of the buffer containing the first factor. Length of this buffer must be mod_len/2 bytes and the value must be odd.
dQThe address of the buffer containing the first factor's CRT exponent. Length of this buffer must be mod_len/2 bytes.
pThe address of the buffer containing the second factor. Length of this buffer must be mod_len/2 bytes and the value must be odd.
dPThe address of the buffer containing the second factor's CRT exponent. Length of this buffer must be mod_len/2 bytes.
qInvThe address of the buffer containing the CRT coefficient. Length of this buffer must be mod_len/2 bytes.
msgThe address of the buffer containing the message.
emThe address of the buffer where the encrypted message is to be stored.
op_cookieThe cookie to be associated with the operation. This cookie is returned in the dao_crypto_res structure when the operation is dequeued.
Returns
0 on success, negative value on failure.

◆ dao_crypto_enqueue_op_pkcs1v15dec_crt()

int dao_crypto_enqueue_op_pkcs1v15dec_crt ( uint8_t  dev_id,
uint16_t  qp_id,
uint16_t  mod_len,
uint8_t *  q,
uint8_t *  dQ,
uint8_t *  p,
uint8_t *  dP,
uint8_t *  qInv,
uint8_t *  em,
uint8_t *  msg,
uint64_t  op_cookie 
)

Enqueue request to perform RSA CRT decrypt operation on the crypto device.

Parameters
dev_idThe identifier of the device.
qp_idThe index of the queue pair on which the operation is to be enqueued.
mod_lenThe length of the modulus in bytes. Value must be even and should be at least 34 bytes and at most 1024 bytes.
qThe address of the buffer containing the first factor. Length of this buffer must be mod_len/2 bytes and the value must be odd.
dQThe address of the buffer containing the first factor's CRT exponent. Length of this buffer must be mod_len/2 bytes.
pThe address of the buffer containing the second factor. Length of this buffer must be mod_len/2 bytes and the value must be odd.
dPThe address of the buffer containing the second factor's CRT exponent. Length of this buffer must be mod_len/2 bytes.
qInvThe address of the buffer containing the CRT coefficient. Length of this buffer must be mod_len/2 bytes.
emThe address of the buffer containing the encrypted message.
msgThe address of the buffer where the decrypted message is to be stored.
op_cookieThe cookie to be associated with the operation. This cookie is returned in the dao_crypto_res structure when the operation is dequeued.
Returns
0 on success, negative value on failure.

◆ dao_liquid_crypto_sym_enqueue_burst()

uint16_t dao_liquid_crypto_sym_enqueue_burst ( uint8_t  dev_id,
uint16_t  qp_id,
struct dao_lc_sym_op op,
uint16_t  nb_ops 
)

Enqueue a burst of requests to perform symmetric crypto operations on the crypto device.

Parameters
dev_idThe identifier of the device.
qp_idThe index of the queue pair on which the operations are to be enqueued.
opThe array of pointers to dao_lc_sym_op structures containing the operations to be enqueued.
nb_opsThe number of operations to enqueue.
Returns
The number of operations enqueued.

◆ dao_liquid_crypto_dequeue_burst()

uint16_t dao_liquid_crypto_dequeue_burst ( uint8_t  dev_id,
uint16_t  qp_id,
struct dao_lc_res res,
uint16_t  nb_ops 
)

Dequeue burst of crypto operations from the crypto device.

Parameters
dev_idThe identifier of the device.
qp_idThe index of the queue pair on which ops are to be dequeued.
res[out] The array of pointers to dao_lc_res structures where the results of the operations are stored.
nb_opsThe maximum number of operations to dequeue.
Returns
The number of operations dequeued.

◆ dao_liquid_crypto_sym_sess_create()

int dao_liquid_crypto_sym_sess_create ( uint8_t  dev_id,
const struct dao_lc_sym_ctx ctx,
uint64_t  sess_cookie 
)

Create a symmetric session on the liquid crypto device.

The session create request would be submitted via the command queue designated by cmd_qp_idx of the device.

Parameters
dev_idThe identifier of the device.
ctxThe symmetric context.
sess_cookieThe cookie to be associated with the operation. This cookie is returned in the dao_lc_cmd_sess_event structure when the operation is dequeued. The session ID of the session created would be returned in the dao_lc_cmd_sess_event structure.
Returns
  • On success, 0 is returned.
  • On failure, a negative value is returned indicating the cause

◆ dao_liquid_crypto_sym_sess_destroy()

int dao_liquid_crypto_sym_sess_destroy ( uint8_t  dev_id,
uint64_t  sess_id,
uint64_t  sess_cookie 
)

Destroy a symmetric session on the liquid crypto device.

The session destroy request would be submitted via the command queue designated by cmd_qp_idx of the device.

Parameters
dev_idThe identifier of the device.
sess_idThe session identifier.
sess_cookieThe cookie to be associated with the operation. This cookie is returned in the dao_lc_sess_event structure when the operation is dequeued.
Returns
  • On success, 0 is returned.
  • On failure, a negative value is returned indicating the cause

◆ dao_liquid_crypto_cmd_event_dequeue()

uint16_t dao_liquid_crypto_cmd_event_dequeue ( uint8_t  dev_id,
struct dao_lc_cmd_event events,
uint16_t  nb_events 
)

Dequeue burst of command events from the command queue.

Parameters
dev_idThe identifier of the device.
eventsThe array of pointers to dao_lc_cmd_event structures where the command events can be stored.
nb_eventsThe maximum number of command events to dequeue.
Returns
The number of command events dequeued.