1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2021 Intel Corporation
5 #ifndef _PMD_CHACHA_POLY_PRIV_H_
6 #define _PMD_CHACHA_POLY_PRIV_H_
8 #include "ipsec_mb_private.h"
10 #define CHACHA20_POLY1305_IV_LENGTH 12
11 #define CHACHA20_POLY1305_DIGEST_LENGTH 16
12 #define CHACHA20_POLY1305_KEY_SIZE 32
15 struct rte_cryptodev_capabilities chacha20_poly1305_capabilities[] = {
16 {/* CHACHA20-POLY1305 */
17 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
19 .xform_type = RTE_CRYPTO_SYM_XFORM_AEAD,
21 .algo = RTE_CRYPTO_AEAD_CHACHA20_POLY1305,
43 RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
46 uint8_t pmd_driver_id_chacha20_poly1305;
48 /** CHACHA20 POLY1305 private session structure */
49 struct chacha20_poly1305_session {
57 uint16_t req_digest_length;
58 /**< Requested digest length */
59 uint16_t gen_digest_length;
60 /**< Generated digest length */
61 uint8_t key[CHACHA20_POLY1305_KEY_SIZE];
62 enum ipsec_mb_operation op;
63 } __rte_cache_aligned;
65 struct chacha20_poly1305_qp_data {
66 struct chacha20_poly1305_context_data chacha20_poly1305_ctx_data;
67 uint8_t temp_digest[CHACHA20_POLY1305_DIGEST_LENGTH];
68 /**< Buffer used to store the digest generated
69 * by the driver when verifying a digest provided
70 * by the user (using authentication verify operation)
74 #endif /* _PMD_CHACHA_POLY_PRIV_H_ */