Data Accelerator Offload
Loading...
Searching...
No Matches
dao_liquid_crypto.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: Marvell-MIT
2 * Copyright (c) 2025 Marvell.
3 */
4
5#ifndef __DAO_LIQUID_CRYPTO_H__
6#define __DAO_LIQUID_CRYPTO_H__
7
14#include <stdbool.h>
15#include <stdint.h>
16
17#include <dao_eth_trs.h>
18
20#define DAO_LC_VERSION "26.06.0"
22#define DAO_CRYPTO_VERSION_LEN 32
24#define DAO_CRYPTO_MAX_NB_DEV 1
26#define DAO_CMD_QP_IDX_INVALID 0xFFFF
28#define DAO_LC_SESS_ID_INVALID 0
30#define DAO_LC_SESS_ID_HASH 1
32#define DAO_LC_SESS_ID_AES_KEY_WRAP 2
34#define DAO_LC_MAX_DIGEST_LEN 255
36#define DAO_LC_MAX_AUTH_KEY_LEN 1024
38#define DAO_LC_AES_KEY_WRAP_MAX_KEY_DATA_LEN 3072
40#define DAO_LC_AES_MAX_KEY_ENC_KEY_LEN 32
42#define DAO_LC_AES_KEY_WRAP_IV_LEN 8
44#define DAO_LC_RSA_OAEP_MAX_LABEL_LEN 1024
46#define DAO_LC_RSA_OAEP_MAX_MOD_LEN 988
48#define DAO_LC_SHA3_MAX_CUSTOM_STRING_LEN 511
50#define DAO_LC_SHA3_MAX_FUNCTION_NAME_LEN 511
52#define DAO_LC_KMAC_MAX_AUTH_KEY_LEN 511
54#define DAO_LC_COMPRESS_MIN_COMP_LEVEL 1
56#define DAO_LC_COMPRESS_MAX_COMP_LEVEL 9
58#define DAO_LC_COMPRESS_MAX_SEG_SIZE 16384
60#define DAO_LC_MAX_AAD_LEN 1024
62#define DAO_LC_MAX_MOD_LEN 1024
63
76
96
102 void *data;
104 uint32_t total_len;
106 uint32_t frag_len;
109};
110
114/* Structure dao_lc_sym_op 8< */
120 uint64_t op_cookie;
122 uint64_t sess_id;
149 uint32_t cipher_len;
154 uint32_t auth_offset;
159 uint32_t auth_len;
161 uint8_t *cipher_iv;
163 uint8_t *auth_iv;
165 uint8_t *aad;
167 uint16_t aad_len;
169 uint8_t *digest;
183 union {
190 };
191 union {
196 };
197};
198/* >8 End of structure dao_lc_sym_op. */
199
219
290
300
315
329
365
379
390 uint64_t compcode : 7;
392 uint64_t doneint : 1;
397 uint64_t uc_compcode : 8;
399 uint64_t rlen : 16;
401 uint64_t spi : 32;
402
404 uint64_t esn;
405 } cn10k;
406
413 uint64_t compcode : 8;
418 uint64_t uc_compcode : 8;
420 uint64_t doneint : 1;
422 uint64_t reserved_17_63 : 47;
423
426 } cn9k;
427
434 uint8_t compcode;
436 uint8_t op_type;
438 uint8_t alg;
440 uint16_t data_out_len;
441 } pqc;
442
444 uint64_t u64[2];
445};
446
458
466 uint8_t dev_id;
468 uint16_t nb_qp;
474 uint16_t cmd_qp_idx;
475};
476
481 union {
483 struct {
485 uint64_t pqc_en : 1;
487 uint64_t compdev_en : 1;
488 };
491 };
492};
493
521
535
553
559 uint8_t *in_data;
561 uint8_t *out_data;
563 uint32_t in_data_len;
565 uint32_t out_data_len;
566};
567
575 union {
580 };
582 union {
584 struct {
586 uint16_t data_out_len;
587 } rsa;
589 struct {
592 } ecdsa;
593 struct {
596 } key_wrap;
598 uint64_t u64;
599 };
601 uint64_t op_cookie;
602};
603
613
626
634 uint64_t sess_id;
636 uint64_t sess_cookie;
637};
638
646 uint8_t event_type;
647 union {
650 };
651};
652
668
678
690
721
726 /* Encrypt first, then authenticate */
727 DAO_LC_FC_CIPHER_THEN_AUTH = 0,
728 /* Authenticate first, then encrypt */
729 DAO_LC_FC_AUTH_THEN_CIPHER = 1
730};
731
741
751
799
815
820 /* Elliptic curve identifier for P-192 (secp192r1) */
821 DAO_LC_AE_EC_ID_P192 = 0,
822 /* Elliptic curve identifier for P-224 (secpr224r1) */
823 DAO_LC_AE_EC_ID_P224 = 1,
824 /* Elliptic curve identifier for P-256 (secpr256r1) */
825 DAO_LC_AE_EC_ID_P256 = 2,
826 /* Elliptic curve identifier for P-384 (secpr384r1) */
827 DAO_LC_AE_EC_ID_P384 = 3,
828 /* Elliptic curve identifier for P-521 (secpr521r1) */
829 DAO_LC_AE_EC_ID_P521 = 4,
833
844 uint64_t iv_source : 1;
849 uint64_t aes_key_len : 2;
851 uint64_t rsvd_59 : 1;
856 uint64_t enc_cipher : 4;
863 uint64_t auth_input_type : 1;
870 uint64_t auth_key_src : 1;
872 uint64_t rsvd_50_51 : 2;
877 uint64_t hash_type : 4;
879 uint64_t mac_len : 8;
881 uint64_t rsvd_16_39 : 24;
883 uint64_t hmac_key_sz : 16;
885 uint8_t encr_key[32];
887 uint8_t encr_iv[16];
889 uint8_t ipad[64];
894 uint8_t opad[64];
895};
896
911 struct {
924 uint16_t iv_len;
926 uint16_t aad_len;
928 uint16_t digest_len;
932 uint16_t key_wrap_len;
936 uint16_t output_len;
955 struct {
957 uint16_t mod_len;
959 uint16_t exp_len;
961
973 struct {
975 uint16_t mod_len;
977 uint16_t exp_len;
979
985 struct {
987 uint32_t rand_len;
989
998 struct {
1004 uint16_t digest_len;
1006
1020 struct {
1024 uint16_t mod_len;
1026 uint16_t exp_len;
1028 uint16_t label_len;
1032
1033 /* Specifies whether PQC is enabled or not */
1034 struct {
1035 bool is_pqc_enabled;
1036 } pqc;
1037
1038 /* Flag to indicate compress device is enabled or not */
1039 struct {
1040 bool is_compdev_enabled;
1041 } compdev;
1042
1051};
1052
1068
1085
1107
1128
1137 uint8_t *key;
1139 uint8_t *datetime;
1141 uint8_t *seed;
1143 uint8_t *out_seed;
1144};
1145
1146struct dao_lc_random_op {
1148 enum dao_lc_random_type type;
1150 struct dao_lc_buf *out_buf;
1152 uint32_t rand_len;
1154 uint64_t op_cookie;
1155
1156 union {
1158 struct dao_lc_random_op_x9_17 x9_17;
1159 };
1160};
1161
1173
1189
1201
1215
1232
1249
1270int dao_liquid_crypto_qp_configure(uint8_t dev_id, uint16_t qp_id, struct dao_lc_qp_conf *conf);
1271
1286int dao_liquid_crypto_qp_inflight_req_count(uint8_t dev_id, uint16_t qp_id);
1287
1301
1320
1340int dao_liquid_crypto_dev_stop(uint8_t dev_id);
1341
1358
1378int dao_liquid_crypto_enqueue_op_passthrough(uint8_t dev_id, uint16_t qp_id, uint64_t op_cookie);
1379
1417int dao_liquid_crypto_enq_op_pkcs1v15enc(uint8_t dev_id, uint16_t qp_id,
1418 enum dao_liquid_crypto_rsa_key_type key_type,
1419 uint16_t mod_len, uint16_t exp_len, uint16_t msg_len,
1420 const uint8_t *mod, const uint8_t *exp, const uint8_t *msg,
1421 uint8_t *em, uint64_t op_cookie);
1422
1459int dao_liquid_crypto_enq_op_pkcs1v15dec(uint8_t dev_id, uint16_t qp_id,
1460 enum dao_liquid_crypto_rsa_key_type key_type,
1461 uint16_t mod_len, uint16_t exp_len, const uint8_t *mod,
1462 const uint8_t *exp, const uint8_t *em, uint8_t *msg,
1463 uint64_t op_cookie);
1464
1508int dao_liquid_crypto_enq_op_pkcs1v15enc_crt(uint8_t dev_id, uint16_t qp_id, uint16_t mod_len,
1509 uint16_t msg_len, const uint8_t *q, const uint8_t *dQ,
1510 const uint8_t *p, const uint8_t *dP,
1511 const uint8_t *qInv, const uint8_t *msg, uint8_t *em,
1512 uint64_t op_cookie);
1513
1556int dao_liquid_crypto_enq_op_pkcs1v15dec_crt(uint8_t dev_id, uint16_t qp_id, uint16_t mod_len,
1557 const uint8_t *q, const uint8_t *dQ, const uint8_t *p,
1558 const uint8_t *dP, const uint8_t *qInv,
1559 const uint8_t *em, uint8_t *msg, uint64_t op_cookie);
1560
1604int dao_liquid_crypto_enq_op_modex_exp(uint8_t dev_id, uint16_t qp_id, uint16_t mod_len,
1605 uint16_t exp_len, uint16_t msg_len, const uint8_t *mod,
1606 const uint8_t *exp, const uint8_t *msg, uint8_t *result,
1607 uint64_t op_cookie);
1608
1659int dao_liquid_crypto_enq_op_modex_crt(uint8_t dev_id, uint16_t qp_id, uint16_t mod_len,
1660 uint16_t msg_len, const uint8_t *q, const uint8_t *dQ,
1661 const uint8_t *p, const uint8_t *dP, const uint8_t *qInv,
1662 const uint8_t *msg, uint8_t *result, uint64_t op_cookie);
1663
1684
1705
1706#define DAO_LC_ML_KEYPAIR_SEED_LEN (64)
1707#define DAO_LC_ML_KEM_SHARED_SECRET_LEN (32)
1708
1709/* FIPS 204 recommends at most 255. */
1710#define DAO_LC_ML_DSA_CTX_LEN_MAX (255)
1711
1712#define DAO_LC_ML_KEM_512_PUB_KEY_LEN (800)
1713#define DAO_LC_ML_KEM_512_PRIV_KEY_LEN (1632)
1714#define DAO_LC_ML_KEM_512_CIPHERTEXT_LEN (768)
1715
1716#define DAO_LC_ML_KEM_768_PUB_KEY_LEN (1184)
1717#define DAO_LC_ML_KEM_768_PRIV_KEY_LEN (2400)
1718#define DAO_LC_ML_KEM_768_CIPHERTEXT_LEN (1088)
1719
1720#define DAO_LC_ML_KEM_1024_PUB_KEY_LEN (1568)
1721#define DAO_LC_ML_KEM_1024_PRIV_KEY_LEN (3168)
1722#define DAO_LC_ML_KEM_1024_CIPHERTEXT_LEN (1568)
1723
1724#define DAO_LC_ML_DSA_44_PUB_KEY_LEN (1312)
1725#define DAO_LC_ML_DSA_44_PRIV_KEY_LEN (2560)
1726#define DAO_LC_ML_DSA_44_SIGNATURE_LEN (2420)
1727
1728#define DAO_LC_ML_DSA_65_PUB_KEY_LEN (1952)
1729#define DAO_LC_ML_DSA_65_PRIV_KEY_LEN (4032)
1730#define DAO_LC_ML_DSA_65_SIGNATURE_LEN (3309)
1731
1732#define DAO_LC_ML_DSA_87_PUB_KEY_LEN (2592)
1733#define DAO_LC_ML_DSA_87_PRIV_KEY_LEN (4896)
1734#define DAO_LC_ML_DSA_87_SIGNATURE_LEN (4627)
1735
1736/* Maximum supported ML DSA message length in bytes */
1737#define DAO_LC_ML_DSA_MAX_MSG_LEN (10240)
1738
1739static uint16_t pqc_ml_pub_key_len[] = {[DAO_LC_ML_KEM_512] = DAO_LC_ML_KEM_512_PUB_KEY_LEN,
1740 [DAO_LC_ML_KEM_768] = DAO_LC_ML_KEM_768_PUB_KEY_LEN,
1741 [DAO_LC_ML_KEM_1024] = DAO_LC_ML_KEM_1024_PUB_KEY_LEN,
1742 [DAO_LC_ML_DSA_44] = DAO_LC_ML_DSA_44_PUB_KEY_LEN,
1743 [DAO_LC_ML_DSA_65] = DAO_LC_ML_DSA_65_PUB_KEY_LEN,
1744 [DAO_LC_ML_DSA_87] = DAO_LC_ML_DSA_87_PUB_KEY_LEN};
1745
1746static uint16_t pqc_ml_priv_key_len[] = {[DAO_LC_ML_KEM_512] = DAO_LC_ML_KEM_512_PRIV_KEY_LEN,
1747 [DAO_LC_ML_KEM_768] = DAO_LC_ML_KEM_768_PRIV_KEY_LEN,
1748 [DAO_LC_ML_KEM_1024] = DAO_LC_ML_KEM_1024_PRIV_KEY_LEN,
1749 [DAO_LC_ML_DSA_44] = DAO_LC_ML_DSA_44_PRIV_KEY_LEN,
1750 [DAO_LC_ML_DSA_65] = DAO_LC_ML_DSA_65_PRIV_KEY_LEN,
1751 [DAO_LC_ML_DSA_87] = DAO_LC_ML_DSA_87_PRIV_KEY_LEN};
1752
1753static uint16_t pqc_ml_signature_len[] = {
1755 [DAO_LC_ML_KEM_512] = 0,
1756 [DAO_LC_ML_KEM_768] = 0,
1757 [DAO_LC_ML_KEM_1024] = 0,
1758
1759 [DAO_LC_ML_DSA_44] = DAO_LC_ML_DSA_44_SIGNATURE_LEN,
1760 [DAO_LC_ML_DSA_65] = DAO_LC_ML_DSA_65_SIGNATURE_LEN,
1761 [DAO_LC_ML_DSA_87] = DAO_LC_ML_DSA_87_SIGNATURE_LEN};
1762
1763static uint16_t pqc_ml_ciphertext_len[] = {
1764 [DAO_LC_ML_KEM_512] = DAO_LC_ML_KEM_512_CIPHERTEXT_LEN,
1765 [DAO_LC_ML_KEM_768] = DAO_LC_ML_KEM_768_CIPHERTEXT_LEN,
1766 [DAO_LC_ML_KEM_1024] = DAO_LC_ML_KEM_1024_CIPHERTEXT_LEN,
1767 [DAO_LC_ML_DSA_44] = 0, /* DSA does not have ciphertext */
1768 [DAO_LC_ML_DSA_65] = 0, /* DSA does not have ciphertext */
1769 [DAO_LC_ML_DSA_87] = 0 /* DSA does not have ciphertext */
1770};
1771
1772static inline uint16_t
1773dao_lc_pqc_pub_key_len(enum dao_lc_pqc_alg alg)
1774{
1775 return pqc_ml_pub_key_len[alg];
1776}
1777
1778static inline uint16_t
1779dao_lc_pqc_priv_key_len(enum dao_lc_pqc_alg alg)
1780{
1781 return pqc_ml_priv_key_len[alg];
1782}
1783
1784static inline uint16_t
1785dao_lc_pqc_signature_len(enum dao_lc_pqc_alg alg)
1786{
1787 return pqc_ml_signature_len[alg];
1788}
1789
1790static inline uint16_t
1791dao_lc_pqc_ciphertext_len(enum dao_lc_pqc_alg alg)
1792{
1793 return pqc_ml_ciphertext_len[alg];
1794}
1795
1812 union {
1814 struct {
1816 uint8_t *pub_key;
1818 uint8_t *priv_key;
1824 uint8_t *seed;
1827 struct {
1829 const uint8_t *enc_key;
1833 uint8_t *ciphertext;
1836 struct {
1838 const uint8_t *dec_key;
1840 const uint8_t *ciphertext;
1842 uint8_t *shared_secret;
1845 struct {
1847 const uint8_t *msg;
1849 uint16_t msg_len;
1851 const uint8_t *ctx;
1853 uint16_t ctx_len;
1855 const uint8_t *priv_key;
1857 uint8_t *signature;
1860 struct {
1862 const uint8_t *msg;
1864 uint16_t msg_len;
1866 const uint8_t *ctx;
1868 uint16_t ctx_len;
1870 const uint8_t *signature;
1872 const uint8_t *pub_key;
1874 };
1875};
1876
1898int dao_liquid_crypto_pqc_enqueue(uint8_t dev_id, uint16_t qp_id, struct dao_lc_pqc_op *op,
1899 uint64_t op_cookie);
1900
1921int dao_liquid_crypto_enq_op_random(uint8_t dev_id, uint16_t qp_id, struct dao_lc_random_op *op);
1922
1949uint16_t dao_liquid_crypto_sym_enqueue_burst(uint8_t dev_id, uint16_t qp_id,
1950 struct dao_lc_sym_op *op, uint16_t nb_ops);
1951
1974uint16_t dao_liquid_crypto_dequeue_burst(uint8_t dev_id, uint16_t qp_id, struct dao_lc_res *res,
1975 uint16_t nb_ops);
1976
1996int dao_liquid_crypto_sym_sess_create(uint8_t dev_id, const struct dao_lc_sym_ctx *ctx,
1997 uint64_t sess_cookie);
1998
2023int dao_liquid_crypto_sym_sess_destroy(uint8_t dev_id, uint64_t sess_id, uint64_t sess_cookie);
2024
2044uint16_t dao_liquid_crypto_cmd_event_dequeue(uint8_t dev_id, struct dao_lc_cmd_event *events,
2045 uint16_t nb_events);
2046
2109int dao_liquid_crypto_enq_op_ecdsa_sign(uint8_t dev_id, uint16_t qp_id,
2110 enum dao_liquid_crypto_ec_curve_type curve_id,
2111 uint16_t nonce_len, uint16_t pkey_len, uint16_t digest_len,
2112 const uint8_t *nonce, const uint8_t *pkey,
2113 const uint8_t *digest, uint8_t *rs_outdata,
2114 uint64_t op_cookie);
2115
2176int dao_liquid_crypto_enq_op_ecdsa_verify(uint8_t dev_id, uint16_t qp_id,
2177 enum dao_liquid_crypto_ec_curve_type curve_id,
2178 uint16_t r_len, uint16_t s_len, uint16_t digest_len,
2179 uint16_t qx_len, uint16_t qy_len, const uint8_t *r_data,
2180 const uint8_t *s_data, const uint8_t *digest,
2181 const uint8_t *qx_data, const uint8_t *qy_data,
2182 uint64_t op_cookie);
2183
2256int dao_liquid_crypto_enq_op_rsa_oaep_enc(uint8_t dev_id, uint16_t qp_id, uint8_t *label,
2257 uint16_t label_len, enum dao_lc_hash_type hash_type,
2258 uint16_t mod_len, uint16_t exp_len, uint16_t msg_len,
2259 const uint8_t *mod, const uint8_t *exp,
2260 const uint8_t *msg, uint8_t *em, uint64_t op_cookie);
2261
2311int dao_liquid_crypto_enq_op_rsa_oaep_pvt_exp_dec(uint8_t dev_id, uint16_t qp_id,
2312 uint16_t label_len, uint8_t *label,
2313 enum dao_lc_hash_type hash_type, uint16_t mod_len,
2314 const uint8_t *mod, uint16_t exp_len,
2315 const uint8_t *exp, const uint8_t *em,
2316 uint8_t *msg, uint64_t op_cookie);
2317
2375int dao_liquid_crypto_enq_op_rsa_oaep_pvt_crt_dec(uint8_t dev_id, uint16_t qp_id, uint8_t *label,
2376 uint16_t label_len,
2377 enum dao_lc_hash_type hash_type, uint16_t mod_len,
2378 uint8_t *p, uint8_t *dP, uint8_t *q, uint8_t *dQ,
2379 uint8_t *qInv, uint8_t *em, uint8_t *msg,
2380 uint64_t op_cookie);
2381
2401int dao_liquid_crypto_enq_comp_op_deflate(uint8_t dev_id, uint16_t qp_id,
2402 struct dao_lc_comp_req_params *req, uint64_t op_cookie);
2403
2423int dao_liquid_crypto_enq_decomp_op_deflate(uint8_t dev_id, uint16_t qp_id,
2424 struct dao_lc_decomp_req_params *req,
2425 uint64_t op_cookie);
2426#endif /* __DAO_LIQUID_CRYPTO_H__ */
int dao_liquid_crypto_enq_op_pkcs1v15enc_crt(uint8_t dev_id, uint16_t qp_id, uint16_t mod_len, uint16_t msg_len, const uint8_t *q, const uint8_t *dQ, const uint8_t *p, const uint8_t *dP, const uint8_t *qInv, const uint8_t *msg, uint8_t *em, uint64_t op_cookie)
int dao_liquid_crypto_enq_op_rsa_oaep_pvt_crt_dec(uint8_t dev_id, uint16_t qp_id, uint8_t *label, uint16_t label_len, enum dao_lc_hash_type hash_type, uint16_t mod_len, uint8_t *p, uint8_t *dP, uint8_t *q, uint8_t *dQ, uint8_t *qInv, uint8_t *em, uint8_t *msg, uint64_t op_cookie)
dao_lc_pqc_op_type
@ DAO_LC_ML_DSA_OP_VERIFY
@ DAO_LC_ML_DSA_OP_KEYGEN
@ DAO_LC_ML_DSA_OP_SIGN
@ DAO_LC_ML_KEM_OP_DECAP
@ DAO_LC_ML_KEM_OP_ENCAP
@ DAO_LC_ML_KEM_OP_KEYGEN
int dao_liquid_crypto_fini(void)
dao_liquid_crypto_ec_curve_type
@ DAO_LC_AE_EC_ID_PMAX
dao_lc_hash_digest_size
@ DAO_LC_HASH_DIGEST_SIZE_SHA2_SHA512
@ DAO_LC_HASH_DIGEST_SIZE_SHA2_SHA384
@ DAO_LC_HASH_DIGEST_SIZE_SHA1
@ DAO_LC_HASH_DIGEST_SIZE_SHA2_SHA256
@ DAO_LC_HASH_DIGEST_SIZE_SHA2_SHA224
int dao_liquid_crypto_info_get(struct dao_lc_info *info)
dao_pqc_comp_code
@ DAO_PQC_COMP_ERROR
@ DAO_PQC_COMP_GOOD
@ DAO_PQC_COMP_NOT_DONE
@ DAO_PQC_COMP_LIB_ERROR_LIBOQS
int dao_liquid_crypto_enq_op_modex_exp(uint8_t dev_id, uint16_t qp_id, uint16_t mod_len, uint16_t exp_len, uint16_t msg_len, const uint8_t *mod, const uint8_t *exp, const uint8_t *msg, uint8_t *result, uint64_t op_cookie)
@ DAO_LC_ML_KEM_768
@ DAO_LC_ML_KEM_1024
@ DAO_LC_ML_DSA_87
@ DAO_LC_ML_KEM_512
@ DAO_LC_ML_DSA_65
@ DAO_LC_ML_DSA_44
@ DAO_LC_ML_PQC_ALG_END
dao_lc_fc_auth_key_src
@ DAO_LC_FC_AUTH_KEY_SRC_OP
@ DAO_LC_FC_AUTH_KEY_SRC_CTX
dao_lc_comp_algo
@ DAO_LC_COMP_ALGO_MAX
@ DAO_LC_COMP_ALGO_UNSPECIFIED
@ DAO_LC_COMP_ALGO_NULL
@ DAO_LC_COMP_ALGO_DEFLATE
int dao_liquid_crypto_sym_sess_create(uint8_t dev_id, const struct dao_lc_sym_ctx *ctx, uint64_t sess_cookie)
dao_cpt_comp_code
@ DAO_CPT_COMP_NOT_DONE
@ DAO_CPT_COMP_HWERR
@ DAO_CPT_COMP_SWERR
@ DAO_CPT_COMP_INSTERR
@ DAO_CPT_COMP_WARN
@ DAO_CPT_COMP_GOOD
@ DAO_CPT_COMP_FAULT
int dao_liquid_crypto_qp_configure(uint8_t dev_id, uint16_t qp_id, struct dao_lc_qp_conf *conf)
dao_lc_fc_aes_key_len
@ DAO_LC_FC_AES_KEY_LEN_192
@ DAO_LC_FC_AES_KEY_LEN_128
@ DAO_LC_FC_AES_KEY_LEN_256
dao_lc_sym_opcode
@ DAO_LC_SYM_OPCODE_HASH
@ DAO_LC_SYM_OPCODE_AES_KEY_WRAP
@ DAO_LC_SYM_OPCODE_HMAC
@ DAO_LC_SYM_OPCODE_FC
dao_lc_fc_iv_src
@ DAO_LC_FC_IV_SRC_CTX
@ DAO_LC_FC_IV_SRC_OP
dao_lc_aes_key_len_bytes
@ DAO_LC_AES_KEY_LEN_32_BYTES
@ DAO_LC_AES_KEY_LEN_24_BYTES
@ DAO_LC_AES_KEY_LEN_16_BYTES
dao_lc_fc_auth_input_type
@ DAO_LC_FC_AUTH_INPUT_OPAD_IPAD
@ DAO_LC_FC_AUTH_INPUT_KEY
uint16_t dao_liquid_crypto_seg_size_calc(struct dao_lc_feature_params *params)
dao_lc_fc_chain_order
int dao_liquid_crypto_enq_op_modex_crt(uint8_t dev_id, uint16_t qp_id, uint16_t mod_len, uint16_t msg_len, const uint8_t *q, const uint8_t *dQ, const uint8_t *p, const uint8_t *dP, const uint8_t *qInv, const uint8_t *msg, uint8_t *result, uint64_t op_cookie)
int dao_liquid_crypto_enq_op_ecdsa_verify(uint8_t dev_id, uint16_t qp_id, enum dao_liquid_crypto_ec_curve_type curve_id, uint16_t r_len, uint16_t s_len, uint16_t digest_len, uint16_t qx_len, uint16_t qy_len, const uint8_t *r_data, const uint8_t *s_data, const uint8_t *digest, const uint8_t *qx_data, const uint8_t *qy_data, uint64_t op_cookie)
int dao_liquid_crypto_dev_destroy(uint8_t dev_id)
dao_uc_comp_code
@ DAO_UC_ERR_GC_CIPHER_UNSUPPORTED
@ DAO_UC_ERR_GC_ICV_MISCOMPARE
@ DAO_UC_ECC_SIGN_S_INVALID
@ DAO_UC_RSA_MOD_LEN_INVALID
@ DAO_UC_RSA_MOD_LEN_NOT_EVEN
@ DAO_UC_ECC_CURVE_INVALID
@ DAO_UC_RSA_OAEP_DECODING_ERROR
@ DAO_UC_ECC_PUB_KEY_INVALID
@ DAO_UC_SUCCESS
@ DAO_UC_ECC_DATA_LEN_INVALID
@ DAO_UC_RSA_PKCS_DEC_INCORRECT
@ DAO_UC_ECC_SIGN_R_INVALID
@ DAO_UC_ERR_GC_CTX_LEN_INVALID
@ DAO_UC_ERR_GC_DATA_LEN_INVALID
@ DAO_UC_ERR_GC_KEY_DATA_LEN_INVALID
@ DAO_UC_ERR_GC_OFFSET_INVALID
@ DAO_UC_ERR_GC_DATA_UNALIGNED
@ DAO_UC_ERR_GC_KEY_LEN_INVALID
@ DAO_UC_RSA_SG_NOT_SUPPORTED
@ DAO_UC_ECC_PAI
@ DAO_UC_ECC_VERIFY_MISMATCH
@ DAO_UC_ERR_GC_AUTH_UNSUPPORTED
dao_lc_comp_huffman
@ DAO_LC_COMP_HUFFMAN_DYNAMIC
@ DAO_LC_COMP_HUFFMAN_FIXED
@ DAO_LC_COMP_HUFFMAN_MAX
int dao_liquid_crypto_qp_inflight_req_count(uint8_t dev_id, uint16_t qp_id)
int dao_liquid_crypto_enq_op_pkcs1v15dec_crt(uint8_t dev_id, uint16_t qp_id, uint16_t mod_len, const uint8_t *q, const uint8_t *dQ, const uint8_t *p, const uint8_t *dP, const uint8_t *qInv, const uint8_t *em, uint8_t *msg, uint64_t op_cookie)
int dao_liquid_crypto_enq_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, const uint8_t *mod, const uint8_t *exp, const uint8_t *msg, uint8_t *em, uint64_t op_cookie)
int dao_liquid_crypto_dev_start(uint8_t dev_id)
int dao_liquid_crypto_sym_sess_destroy(uint8_t dev_id, uint64_t sess_id, uint64_t sess_cookie)
#define DAO_CRYPTO_VERSION_LEN
dao_lc_comp_op
@ DAO_LC_COMP_OP_DECOMPRESS
@ DAO_LC_COMP_OP_INVALID
@ DAO_LC_COMP_OP_COMPRESS
#define DAO_LC_MAX_AUTH_KEY_LEN
int dao_liquid_crypto_enq_op_rsa_oaep_pvt_exp_dec(uint8_t dev_id, uint16_t qp_id, uint16_t label_len, uint8_t *label, enum dao_lc_hash_type hash_type, uint16_t mod_len, const uint8_t *mod, uint16_t exp_len, const uint8_t *exp, const uint8_t *em, uint8_t *msg, uint64_t op_cookie)
int dao_liquid_crypto_enq_comp_op_deflate(uint8_t dev_id, uint16_t qp_id, struct dao_lc_comp_req_params *req, uint64_t op_cookie)
dao_lc_fc_enc_cipher
@ DAO_LC_FC_ENC_CIPHER_CHACHA
@ DAO_LC_FC_ENC_CIPHER_AES_CCM
@ DAO_LC_FC_ENC_CIPHER_AES_CTR
@ DAO_LC_FC_ENC_CIPHER_3DES_CBC
@ DAO_LC_FC_ENC_CIPHER_AES_CFB
@ DAO_LC_FC_ENC_CIPHER_3DES_ECB
@ DAO_LC_FC_ENC_CIPHER_AES_XTS
@ DAO_LC_FC_ENC_CIPHER_AES_CBC
@ DAO_LC_FC_ENC_CIPHER_AES_GCM
@ DAO_LC_FC_ENC_CIPHER_NULL
@ DAO_LC_FC_ENC_CIPHER_AES_ECB
#define DAO_CRYPTO_MAX_NB_DEV
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)
dao_lc_hash_type
@ DAO_LC_HASH_TYPE_GMAC
@ DAO_LC_HASH_TYPE_SHA3_CSHAKE256
@ DAO_LC_HASH_TYPE_NULL
@ DAO_LC_HASH_TYPE_SHA3_SHAKE128
@ DAO_LC_HASH_TYPE_SHA3_SHA384
@ DAO_LC_HASH_TYPE_SHA2_SHA256
@ DAO_LC_HASH_TYPE_POLY1305
@ DAO_LC_HASH_TYPE_SHA3_SHA256
@ DAO_LC_HASH_TYPE_SHA3_SHAKE256
@ DAO_LC_HASH_TYPE_SHA2_SHA224
@ DAO_LC_HASH_TYPE_SHA3_KMAC128
@ DAO_LC_HASH_TYPE_CMAC
@ DAO_LC_HASH_TYPE_SHA2_SHA512
@ DAO_LC_HASH_TYPE_SM3
@ DAO_LC_HASH_TYPE_SHA3_SHA224
@ DAO_LC_HASH_TYPE_SHA3_CSHAKE128
@ DAO_LC_HASH_TYPE_MD5
@ DAO_LC_HASH_TYPE_SHA2_SHA384
@ DAO_LC_HASH_TYPE_SHA3_KMAC256
@ DAO_LC_HASH_TYPE_SHA1
@ DAO_LC_HASH_TYPE_SHA3_SHA512
int dao_liquid_crypto_pqc_enqueue(uint8_t dev_id, uint16_t qp_id, struct dao_lc_pqc_op *op, uint64_t op_cookie)
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_dev_caps_get(struct dao_lc_dev_caps *lc_caps)
dao_lc_random_type
@ DAO_LC_RANDOM_TYPE_HW
@ DAO_LC_RANDOM_TYPE_X9_17
#define DAO_LC_AES_MAX_KEY_ENC_KEY_LEN
dao_lc_cmd_event_type
@ DAO_LC_CMD_EVENT_SESS_CREATE
@ DAO_LC_CMD_EVENT_SESS_DESTROY
uint16_t dao_liquid_crypto_cmd_event_dequeue(uint8_t dev_id, struct dao_lc_cmd_event *events, uint16_t nb_events)
dao_lc_comp_op_status
@ DAO_LC_COMP_OP_STATUS_DEV_DISABLED
@ DAO_LC_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED
@ DAO_LC_COMP_OP_STATUS_INVALID_ARGS
@ DAO_LC_COMP_OP_STATUS_OUT_OF_SPACE_RECOVERABLE
@ DAO_LC_COMP_OP_STATUS_SUCCESS
@ DAO_LC_COMP_OP_STATUS_ERROR
@ DAO_LC_COMP_OP_STATUS_RESP_BUF_SPACE_ISSUE
@ DAO_LC_COMP_OP_STATUS_INVALID_STATE
@ DAO_LC_COMP_OP_STATUS_NOT_PROCESSED
int dao_liquid_crypto_enq_op_rsa_oaep_enc(uint8_t dev_id, uint16_t qp_id, uint8_t *label, uint16_t label_len, enum dao_lc_hash_type hash_type, uint16_t mod_len, uint16_t exp_len, uint16_t msg_len, const uint8_t *mod, const uint8_t *exp, const uint8_t *msg, uint8_t *em, uint64_t op_cookie)
int dao_liquid_crypto_enq_decomp_op_deflate(uint8_t dev_id, uint16_t qp_id, struct dao_lc_decomp_req_params *req, uint64_t op_cookie)
int dao_liquid_crypto_enq_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, const uint8_t *mod, const uint8_t *exp, const uint8_t *em, uint8_t *msg, uint64_t op_cookie)
int dao_liquid_crypto_enq_op_ecdsa_sign(uint8_t dev_id, uint16_t qp_id, enum dao_liquid_crypto_ec_curve_type curve_id, uint16_t nonce_len, uint16_t pkey_len, uint16_t digest_len, const uint8_t *nonce, const uint8_t *pkey, const uint8_t *digest, uint8_t *rs_outdata, uint64_t op_cookie)
int dao_liquid_crypto_init(void)
int dao_liquid_crypto_enq_op_random(uint8_t dev_id, uint16_t qp_id, struct dao_lc_random_op *op)
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)
int dao_liquid_crypto_dev_create(struct dao_lc_dev_conf *conf)
dao_liquid_crypto_rsa_key_type
@ DAO_LC_RSA_KEY_TYPE_PRIVATE
@ DAO_LC_RSA_KEY_TYPE_PUBLIC
enum dao_lc_comp_op_status status
uint8_t kek[DAO_LC_AES_MAX_KEY_ENC_KEY_LEN]
enum dao_lc_fc_aes_key_len aes_kek_type
struct dao_lc_buf * next
struct dao_lc_cmd_sess_event sess_event
enum dao_lc_comp_huffman huff_enc_type
struct dao_lc_feature_params::@21 ecc
enum dao_liquid_crypto_ec_curve_type curve_id
struct dao_lc_feature_params::@20 rng
struct dao_lc_feature_params::@17 sym
struct dao_lc_feature_params::@18 rsa
struct dao_lc_feature_params::@22 rsa_oaep
enum dao_lc_hash_type hash_type
struct dao_lc_feature_params::@19 modex
enum dao_lc_fc_aes_key_len aes_kek_type
enum dao_lc_hash_type hmac_hash_type
uint8_t hmac_auth_key[DAO_LC_MAX_AUTH_KEY_LEN]
uint16_t nb_qp[DAO_CRYPTO_MAX_NB_DEV]
char version[DAO_CRYPTO_VERSION_LEN]
enum dao_lc_pqc_op_type op_type
const uint8_t * dec_key
struct dao_lc_pqc_op::@29::@31 keygen
const uint8_t * ctx
const uint8_t * signature
const uint8_t * enc_key
struct dao_lc_pqc_op::@29::@34 sign
struct dao_lc_pqc_op::@29::@35 verify
const uint8_t * pub_key
struct dao_lc_pqc_op::@29::@32 encap
const uint8_t * priv_key
struct dao_lc_pqc_op::@29::@33 decap
const uint8_t * msg
const uint8_t * ciphertext
enum dao_lc_pqc_alg alg
uint16_t ecc_rs_out_len
struct dao_compdev_res compdev_res
union dao_cpt_res_s res
uint16_t data_out_len
uint16_t wrap_unwrap_key_len
enum dao_lc_fc_chain_order chain_order
struct dao_lc_sym_fc_ctx fc
struct dao_lc_hmac_hash_ctx hash
struct dao_lc_aes_key_wrap_ctx aes_key_wrap
enum dao_lc_sym_opcode opcode
uint32_t wrap_unwrap_key_len
struct dao_lc_sym_op_kmac_params kmac_params
struct dao_lc_buf * in_buffer
struct dao_lc_sym_op_cshake_params cshake_params
struct dao_lc_buf * out_buffer