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/* Flag indicating the final stage of an operation is done */
64#define DAO_FLAG_FINAL_STAGE_DONE (1U << 0)
66#define DAO_LC_RSA_PSS_MAX_SALT_LEN 945
68#define DAO_LC_RSA_PSS_MAX_MOD_LEN 988
70#define DAO_LC_RSA_PSS_MAX_MSG_LEN 986
72#define DAO_LC_FEAT_PQC_EN (1ULL << 0)
74#define DAO_LC_FEAT_COMPDEV_EN (1ULL << 1)
76#define DAO_LC_FEAT_ASYM_RSP_STATUS_EN (1ULL << 2)
78#define DAO_LC_OPTIONAL_FEATURES (DAO_LC_FEAT_PQC_EN | DAO_LC_FEAT_COMPDEV_EN)
79
92
112
118 void *data;
120 uint32_t total_len;
122 uint32_t frag_len;
125};
126
130/* Structure dao_lc_sym_op 8< */
136 uint64_t op_cookie;
138 uint64_t sess_id;
165 uint32_t cipher_len;
170 uint32_t auth_offset;
175 uint32_t auth_len;
177 uint8_t *cipher_iv;
179 uint8_t *auth_iv;
181 uint8_t *aad;
183 uint16_t aad_len;
185 uint8_t *digest;
199 union {
206 };
207 union {
212 };
213};
214/* >8 End of structure dao_lc_sym_op. */
215
235
315
325
340
354
390
404
415 uint64_t compcode : 7;
417 uint64_t doneint : 1;
422 uint64_t uc_compcode : 8;
424 uint64_t rlen : 16;
426 uint64_t spi : 32;
427
429 uint64_t esn;
430 } cn10k;
431
438 uint64_t compcode : 8;
443 uint64_t uc_compcode : 8;
445 uint64_t doneint : 1;
447 uint64_t reserved_17_63 : 47;
448
451 } cn9k;
452
459 uint8_t compcode;
461 uint8_t op_type;
463 uint8_t alg;
465 uint16_t data_out_len;
466 } pqc;
467
469 uint64_t u64[2];
470};
471
483
491 uint8_t dev_id;
493 uint16_t nb_qp;
499 uint16_t cmd_qp_idx;
500};
501
506 union {
508 struct {
510 uint64_t pqc_en : 1;
512 uint64_t compdev_en : 1;
514 uint64_t asym_rsp_status_en : 1;
515 };
518 };
519};
520
548
562
580
586 uint8_t *in_data;
588 uint8_t *out_data;
590 uint32_t in_data_len;
592 uint32_t out_data_len;
593};
594
602 union {
607 };
609 union {
611 struct {
613 uint16_t data_out_len;
614 } rsa;
616 struct {
619 } ecdsa;
620 struct {
623 } key_wrap;
625 uint64_t u64;
626 };
628 uint64_t op_cookie;
629};
630
640
653
661 uint64_t sess_id;
663 uint64_t sess_cookie;
664};
665
673 uint8_t event_type;
674 union {
677 };
678};
679
695
705
717
748
753 /* Encrypt first, then authenticate */
754 DAO_LC_FC_CIPHER_THEN_AUTH = 0,
755 /* Authenticate first, then encrypt */
756 DAO_LC_FC_AUTH_THEN_CIPHER = 1
757};
758
768
778
826
842
847 /* Elliptic curve identifier for P-192 (secp192r1) */
848 DAO_LC_AE_EC_ID_P192 = 0,
849 /* Elliptic curve identifier for P-224 (secpr224r1) */
850 DAO_LC_AE_EC_ID_P224 = 1,
851 /* Elliptic curve identifier for P-256 (secpr256r1) */
852 DAO_LC_AE_EC_ID_P256 = 2,
853 /* Elliptic curve identifier for P-384 (secpr384r1) */
854 DAO_LC_AE_EC_ID_P384 = 3,
855 /* Elliptic curve identifier for P-521 (secpr521r1) */
856 DAO_LC_AE_EC_ID_P521 = 4,
860
871 uint64_t iv_source : 1;
876 uint64_t aes_key_len : 2;
878 uint64_t rsvd_59 : 1;
883 uint64_t enc_cipher : 4;
890 uint64_t auth_input_type : 1;
897 uint64_t auth_key_src : 1;
899 uint64_t rsvd_50_51 : 2;
904 uint64_t hash_type : 4;
906 uint64_t mac_len : 8;
908 uint64_t rsvd_16_39 : 24;
910 uint64_t hmac_key_sz : 16;
912 uint8_t encr_key[32];
914 uint8_t encr_iv[16];
916 uint8_t ipad[64];
921 uint8_t opad[64];
922};
923
938 struct {
951 uint16_t iv_len;
953 uint16_t aad_len;
955 uint16_t digest_len;
959 uint16_t key_wrap_len;
963 uint16_t output_len;
982 struct {
984 uint16_t mod_len;
986 uint16_t exp_len;
988
1000 struct {
1002 uint16_t mod_len;
1004 uint16_t exp_len;
1006
1012 struct {
1014 uint32_t rand_len;
1016
1025 struct {
1031 uint16_t digest_len;
1033
1048 struct {
1052 uint16_t mod_len;
1054 uint16_t exp_len;
1056 uint16_t label_len;
1060
1075 struct {
1079 uint16_t mod_len;
1081 uint16_t exp_len;
1083 uint16_t salt_len;
1087
1088 /* Specifies whether PQC is enabled or not */
1089 struct {
1090 bool is_pqc_enabled;
1091 } pqc;
1092
1093 /* Flag to indicate compress device is enabled or not */
1094 struct {
1095 bool is_compdev_enabled;
1096 } compdev;
1097
1106};
1107
1123
1140
1162
1183
1192 uint8_t *key;
1194 uint8_t *datetime;
1196 uint8_t *seed;
1198 uint8_t *out_seed;
1199};
1200
1201struct dao_lc_random_op {
1203 enum dao_lc_random_type type;
1205 struct dao_lc_buf *out_buf;
1207 uint32_t rand_len;
1209 uint64_t op_cookie;
1210
1211 union {
1213 struct dao_lc_random_op_x9_17 x9_17;
1214 };
1215};
1216
1228
1244
1256
1270
1287
1304
1325int dao_liquid_crypto_qp_configure(uint8_t dev_id, uint16_t qp_id, struct dao_lc_qp_conf *conf);
1326
1341int dao_liquid_crypto_qp_inflight_req_count(uint8_t dev_id, uint16_t qp_id);
1342
1356
1375
1395int dao_liquid_crypto_dev_stop(uint8_t dev_id);
1396
1413
1433int dao_liquid_crypto_enqueue_op_passthrough(uint8_t dev_id, uint16_t qp_id, uint64_t op_cookie);
1434
1472int dao_liquid_crypto_enq_op_pkcs1v15enc(uint8_t dev_id, uint16_t qp_id,
1473 enum dao_liquid_crypto_rsa_key_type key_type,
1474 uint16_t mod_len, uint16_t exp_len, uint16_t msg_len,
1475 const uint8_t *mod, const uint8_t *exp, const uint8_t *msg,
1476 uint8_t *em, uint64_t op_cookie);
1477
1514int dao_liquid_crypto_enq_op_pkcs1v15dec(uint8_t dev_id, uint16_t qp_id,
1515 enum dao_liquid_crypto_rsa_key_type key_type,
1516 uint16_t mod_len, uint16_t exp_len, const uint8_t *mod,
1517 const uint8_t *exp, const uint8_t *em, uint8_t *msg,
1518 uint64_t op_cookie);
1519
1563int dao_liquid_crypto_enq_op_pkcs1v15enc_crt(uint8_t dev_id, uint16_t qp_id, uint16_t mod_len,
1564 uint16_t msg_len, const uint8_t *q, const uint8_t *dQ,
1565 const uint8_t *p, const uint8_t *dP,
1566 const uint8_t *qInv, const uint8_t *msg, uint8_t *em,
1567 uint64_t op_cookie);
1568
1611int dao_liquid_crypto_enq_op_pkcs1v15dec_crt(uint8_t dev_id, uint16_t qp_id, uint16_t mod_len,
1612 const uint8_t *q, const uint8_t *dQ, const uint8_t *p,
1613 const uint8_t *dP, const uint8_t *qInv,
1614 const uint8_t *em, uint8_t *msg, uint64_t op_cookie);
1615
1659int dao_liquid_crypto_enq_op_modex_exp(uint8_t dev_id, uint16_t qp_id, uint16_t mod_len,
1660 uint16_t exp_len, uint16_t msg_len, const uint8_t *mod,
1661 const uint8_t *exp, const uint8_t *msg, uint8_t *result,
1662 uint64_t op_cookie);
1663
1714int dao_liquid_crypto_enq_op_modex_crt(uint8_t dev_id, uint16_t qp_id, uint16_t mod_len,
1715 uint16_t msg_len, const uint8_t *q, const uint8_t *dQ,
1716 const uint8_t *p, const uint8_t *dP, const uint8_t *qInv,
1717 const uint8_t *msg, uint8_t *result, uint64_t op_cookie);
1718
1739
1760
1761#define DAO_LC_ML_KEYPAIR_SEED_LEN (64)
1762#define DAO_LC_ML_KEM_SHARED_SECRET_LEN (32)
1763
1764/* FIPS 204 recommends at most 255. */
1765#define DAO_LC_ML_DSA_CTX_LEN_MAX (255)
1766
1767#define DAO_LC_ML_KEM_512_PUB_KEY_LEN (800)
1768#define DAO_LC_ML_KEM_512_PRIV_KEY_LEN (1632)
1769#define DAO_LC_ML_KEM_512_CIPHERTEXT_LEN (768)
1770
1771#define DAO_LC_ML_KEM_768_PUB_KEY_LEN (1184)
1772#define DAO_LC_ML_KEM_768_PRIV_KEY_LEN (2400)
1773#define DAO_LC_ML_KEM_768_CIPHERTEXT_LEN (1088)
1774
1775#define DAO_LC_ML_KEM_1024_PUB_KEY_LEN (1568)
1776#define DAO_LC_ML_KEM_1024_PRIV_KEY_LEN (3168)
1777#define DAO_LC_ML_KEM_1024_CIPHERTEXT_LEN (1568)
1778
1779#define DAO_LC_ML_DSA_44_PUB_KEY_LEN (1312)
1780#define DAO_LC_ML_DSA_44_PRIV_KEY_LEN (2560)
1781#define DAO_LC_ML_DSA_44_SIGNATURE_LEN (2420)
1782
1783#define DAO_LC_ML_DSA_65_PUB_KEY_LEN (1952)
1784#define DAO_LC_ML_DSA_65_PRIV_KEY_LEN (4032)
1785#define DAO_LC_ML_DSA_65_SIGNATURE_LEN (3309)
1786
1787#define DAO_LC_ML_DSA_87_PUB_KEY_LEN (2592)
1788#define DAO_LC_ML_DSA_87_PRIV_KEY_LEN (4896)
1789#define DAO_LC_ML_DSA_87_SIGNATURE_LEN (4627)
1790
1791/* Maximum supported ML DSA message length in bytes */
1792#define DAO_LC_ML_DSA_MAX_MSG_LEN (10240)
1793
1794static uint16_t pqc_ml_pub_key_len[] = {[DAO_LC_ML_KEM_512] = DAO_LC_ML_KEM_512_PUB_KEY_LEN,
1795 [DAO_LC_ML_KEM_768] = DAO_LC_ML_KEM_768_PUB_KEY_LEN,
1796 [DAO_LC_ML_KEM_1024] = DAO_LC_ML_KEM_1024_PUB_KEY_LEN,
1797 [DAO_LC_ML_DSA_44] = DAO_LC_ML_DSA_44_PUB_KEY_LEN,
1798 [DAO_LC_ML_DSA_65] = DAO_LC_ML_DSA_65_PUB_KEY_LEN,
1799 [DAO_LC_ML_DSA_87] = DAO_LC_ML_DSA_87_PUB_KEY_LEN};
1800
1801static uint16_t pqc_ml_priv_key_len[] = {[DAO_LC_ML_KEM_512] = DAO_LC_ML_KEM_512_PRIV_KEY_LEN,
1802 [DAO_LC_ML_KEM_768] = DAO_LC_ML_KEM_768_PRIV_KEY_LEN,
1803 [DAO_LC_ML_KEM_1024] = DAO_LC_ML_KEM_1024_PRIV_KEY_LEN,
1804 [DAO_LC_ML_DSA_44] = DAO_LC_ML_DSA_44_PRIV_KEY_LEN,
1805 [DAO_LC_ML_DSA_65] = DAO_LC_ML_DSA_65_PRIV_KEY_LEN,
1806 [DAO_LC_ML_DSA_87] = DAO_LC_ML_DSA_87_PRIV_KEY_LEN};
1807
1808static uint16_t pqc_ml_signature_len[] = {
1810 [DAO_LC_ML_KEM_512] = 0,
1811 [DAO_LC_ML_KEM_768] = 0,
1812 [DAO_LC_ML_KEM_1024] = 0,
1813
1814 [DAO_LC_ML_DSA_44] = DAO_LC_ML_DSA_44_SIGNATURE_LEN,
1815 [DAO_LC_ML_DSA_65] = DAO_LC_ML_DSA_65_SIGNATURE_LEN,
1816 [DAO_LC_ML_DSA_87] = DAO_LC_ML_DSA_87_SIGNATURE_LEN};
1817
1818static uint16_t pqc_ml_ciphertext_len[] = {
1819 [DAO_LC_ML_KEM_512] = DAO_LC_ML_KEM_512_CIPHERTEXT_LEN,
1820 [DAO_LC_ML_KEM_768] = DAO_LC_ML_KEM_768_CIPHERTEXT_LEN,
1821 [DAO_LC_ML_KEM_1024] = DAO_LC_ML_KEM_1024_CIPHERTEXT_LEN,
1822 [DAO_LC_ML_DSA_44] = 0, /* DSA does not have ciphertext */
1823 [DAO_LC_ML_DSA_65] = 0, /* DSA does not have ciphertext */
1824 [DAO_LC_ML_DSA_87] = 0 /* DSA does not have ciphertext */
1825};
1826
1827static inline uint16_t
1828dao_lc_pqc_pub_key_len(enum dao_lc_pqc_alg alg)
1829{
1830 return pqc_ml_pub_key_len[alg];
1831}
1832
1833static inline uint16_t
1834dao_lc_pqc_priv_key_len(enum dao_lc_pqc_alg alg)
1835{
1836 return pqc_ml_priv_key_len[alg];
1837}
1838
1839static inline uint16_t
1840dao_lc_pqc_signature_len(enum dao_lc_pqc_alg alg)
1841{
1842 return pqc_ml_signature_len[alg];
1843}
1844
1845static inline uint16_t
1846dao_lc_pqc_ciphertext_len(enum dao_lc_pqc_alg alg)
1847{
1848 return pqc_ml_ciphertext_len[alg];
1849}
1850
1867 union {
1869 struct {
1871 uint8_t *pub_key;
1873 uint8_t *priv_key;
1879 uint8_t *seed;
1882 struct {
1884 const uint8_t *enc_key;
1888 uint8_t *ciphertext;
1891 struct {
1893 const uint8_t *dec_key;
1895 const uint8_t *ciphertext;
1897 uint8_t *shared_secret;
1900 struct {
1902 const uint8_t *msg;
1904 uint16_t msg_len;
1906 const uint8_t *ctx;
1908 uint16_t ctx_len;
1910 const uint8_t *priv_key;
1912 uint8_t *signature;
1915 struct {
1917 const uint8_t *msg;
1919 uint16_t msg_len;
1921 const uint8_t *ctx;
1923 uint16_t ctx_len;
1925 const uint8_t *signature;
1927 const uint8_t *pub_key;
1929 };
1930};
1931
1953int dao_liquid_crypto_pqc_enqueue(uint8_t dev_id, uint16_t qp_id, struct dao_lc_pqc_op *op,
1954 uint64_t op_cookie);
1955
1976int dao_liquid_crypto_enq_op_random(uint8_t dev_id, uint16_t qp_id, struct dao_lc_random_op *op);
1977
2004uint16_t dao_liquid_crypto_sym_enqueue_burst(uint8_t dev_id, uint16_t qp_id,
2005 struct dao_lc_sym_op *op, uint16_t nb_ops);
2006
2029uint16_t dao_liquid_crypto_dequeue_burst(uint8_t dev_id, uint16_t qp_id, struct dao_lc_res *res,
2030 uint16_t nb_ops);
2031
2051int dao_liquid_crypto_sym_sess_create(uint8_t dev_id, const struct dao_lc_sym_ctx *ctx,
2052 uint64_t sess_cookie);
2053
2078int dao_liquid_crypto_sym_sess_destroy(uint8_t dev_id, uint64_t sess_id, uint64_t sess_cookie);
2079
2099uint16_t dao_liquid_crypto_cmd_event_dequeue(uint8_t dev_id, struct dao_lc_cmd_event *events,
2100 uint16_t nb_events);
2101
2164int dao_liquid_crypto_enq_op_ecdsa_sign(uint8_t dev_id, uint16_t qp_id,
2165 enum dao_liquid_crypto_ec_curve_type curve_id,
2166 uint16_t nonce_len, uint16_t pkey_len, uint16_t digest_len,
2167 const uint8_t *nonce, const uint8_t *pkey,
2168 const uint8_t *digest, uint8_t *rs_outdata,
2169 uint64_t op_cookie);
2170
2231int dao_liquid_crypto_enq_op_ecdsa_verify(uint8_t dev_id, uint16_t qp_id,
2232 enum dao_liquid_crypto_ec_curve_type curve_id,
2233 uint16_t r_len, uint16_t s_len, uint16_t digest_len,
2234 uint16_t qx_len, uint16_t qy_len, const uint8_t *r_data,
2235 const uint8_t *s_data, const uint8_t *digest,
2236 const uint8_t *qx_data, const uint8_t *qy_data,
2237 uint64_t op_cookie);
2238
2311int dao_liquid_crypto_enq_op_rsa_oaep_enc(uint8_t dev_id, uint16_t qp_id, uint8_t *label,
2312 uint16_t label_len, enum dao_lc_hash_type hash_type,
2313 uint16_t mod_len, uint16_t exp_len, uint16_t msg_len,
2314 const uint8_t *mod, const uint8_t *exp,
2315 const uint8_t *msg, uint8_t *em, uint64_t op_cookie);
2316
2366int dao_liquid_crypto_enq_op_rsa_oaep_pvt_exp_dec(uint8_t dev_id, uint16_t qp_id,
2367 uint16_t label_len, uint8_t *label,
2368 enum dao_lc_hash_type hash_type, uint16_t mod_len,
2369 const uint8_t *mod, uint16_t exp_len,
2370 const uint8_t *exp, const uint8_t *em,
2371 uint8_t *msg, uint64_t op_cookie);
2372
2430int dao_liquid_crypto_enq_op_rsa_oaep_pvt_crt_dec(uint8_t dev_id, uint16_t qp_id, uint8_t *label,
2431 uint16_t label_len,
2432 enum dao_lc_hash_type hash_type, uint16_t mod_len,
2433 uint8_t *p, uint8_t *dP, uint8_t *q, uint8_t *dQ,
2434 uint8_t *qInv, uint8_t *em, uint8_t *msg,
2435 uint64_t op_cookie);
2436
2456int dao_liquid_crypto_enq_comp_op_deflate(uint8_t dev_id, uint16_t qp_id,
2457 struct dao_lc_comp_req_params *req, uint64_t op_cookie);
2458
2478int dao_liquid_crypto_enq_decomp_op_deflate(uint8_t dev_id, uint16_t qp_id,
2479 struct dao_lc_decomp_req_params *req,
2480 uint64_t op_cookie);
2481
2541int dao_liquid_crypto_enq_op_rsa_pss_pvt_exp_enc(uint8_t dev_id, uint16_t qp_id,
2542 enum dao_lc_hash_type hash_type, uint16_t mod_len,
2543 const uint8_t *mod, uint16_t exp_len,
2544 const uint8_t *exp, uint16_t msg_len,
2545 const uint8_t *msg, uint16_t salt_len,
2546 const uint8_t *salt, uint8_t *em,
2547 uint64_t op_cookie);
2548
2617 uint8_t dev_id, uint16_t qp_id, enum dao_lc_hash_type hash_type, uint16_t mod_len,
2618 uint16_t msg_len, const uint8_t *msg, uint16_t salt_len, const uint8_t *salt,
2619 const uint8_t *p, const uint8_t *dP, const uint8_t *q, const uint8_t *dQ,
2620 const uint8_t *qInv, uint8_t *em, uint64_t op_cookie);
2621
2676int dao_liquid_crypto_enq_op_rsa_pss_pub_dec(uint8_t dev_id, uint16_t qp_id,
2677 enum dao_lc_hash_type hash_type, uint16_t salt_len,
2678 uint16_t mod_len, const uint8_t *mod, uint16_t exp_len,
2679 const uint8_t *exp, uint16_t msg_len,
2680 const uint8_t *msg, const uint8_t *em,
2681 uint64_t op_cookie);
2682
2683#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_RSA_PSS_DECODING_ERROR
@ 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_enq_op_rsa_pss_pub_dec(uint8_t dev_id, uint16_t qp_id, enum dao_lc_hash_type hash_type, uint16_t salt_len, uint16_t mod_len, const uint8_t *mod, uint16_t exp_len, const uint8_t *exp, uint16_t msg_len, const uint8_t *msg, const uint8_t *em, uint64_t op_cookie)
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_pss_pvt_crt_enc(uint8_t dev_id, uint16_t qp_id, enum dao_lc_hash_type hash_type, uint16_t mod_len, uint16_t msg_len, const uint8_t *msg, uint16_t salt_len, const uint8_t *salt, const uint8_t *p, const uint8_t *dP, const uint8_t *q, const uint8_t *dQ, const uint8_t *qInv, uint8_t *em, uint64_t op_cookie)
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_rsa_pss_pvt_exp_enc(uint8_t dev_id, uint16_t qp_id, enum dao_lc_hash_type hash_type, uint16_t mod_len, const uint8_t *mod, uint16_t exp_len, const uint8_t *exp, uint16_t msg_len, const uint8_t *msg, uint16_t salt_len, const uint8_t *salt, uint8_t *em, 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::@19 sym
enum dao_liquid_crypto_ec_curve_type curve_id
struct dao_lc_feature_params::@21 modex
struct dao_lc_feature_params::@25 rsa_pss
struct dao_lc_feature_params::@24 rsa_oaep
struct dao_lc_feature_params::@22 rng
enum dao_lc_hash_type hash_type
struct dao_lc_feature_params::@20 rsa
struct dao_lc_feature_params::@23 ecc
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
const uint8_t * ctx
const uint8_t * signature
struct dao_lc_pqc_op::@32::@34 keygen
const uint8_t * enc_key
struct dao_lc_pqc_op::@32::@38 verify
const uint8_t * pub_key
const uint8_t * priv_key
const uint8_t * msg
struct dao_lc_pqc_op::@32::@36 decap
struct dao_lc_pqc_op::@32::@37 sign
const uint8_t * ciphertext
struct dao_lc_pqc_op::@32::@35 encap
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