#define HMAC_IPAD_VALUE 0x36
#define HMAC_OPAD_VALUE 0x5c
-#ifdef RTE_LIBRTE_PMD_CCP_CPU_AUTH
+/* MD5 */
#define MD5_DIGEST_SIZE 16
#define MD5_BLOCK_SIZE 64
-#endif
/* SHA */
#define SHA_COMMON_DIGEST_SIZE 32
#define SHA224_DIGEST_SIZE 28
#define SHA224_BLOCK_SIZE 64
+#define SHA3_224_BLOCK_SIZE 144
#define SHA256_DIGEST_SIZE 32
#define SHA256_BLOCK_SIZE 64
+#define SHA3_256_BLOCK_SIZE 136
#define SHA384_DIGEST_SIZE 48
#define SHA384_BLOCK_SIZE 128
+#define SHA3_384_BLOCK_SIZE 104
#define SHA512_DIGEST_SIZE 64
#define SHA512_BLOCK_SIZE 128
+#define SHA3_512_BLOCK_SIZE 72
+
+/* Maximum length for digest */
+#define DIGEST_LENGTH_MAX 64
/* SHA LSB intialiazation values */
CCP_AUTH_ALGO_SHA3_512_HMAC,
CCP_AUTH_ALGO_AES_CMAC,
CCP_AUTH_ALGO_AES_GCM,
-#ifdef RTE_LIBRTE_PMD_CCP_CPU_AUTH
CCP_AUTH_ALGO_MD5_HMAC,
-#endif
};
/**
/* CCP crypto private session structure */
struct ccp_session {
+ bool auth_opt;
enum ccp_cmd_order cmd_id;
/**< chain order mode */
struct {
extern uint8_t ccp_cryptodev_driver_id;
struct ccp_qp;
+struct ccp_private;
/**
* Set and validate CCP crypto session parameters
* @return 0 on success otherwise -1
*/
int ccp_set_session_parameters(struct ccp_session *sess,
- const struct rte_crypto_sym_xform *xform);
+ const struct rte_crypto_sym_xform *xform,
+ struct ccp_private *internals);
/**
* Find count of slots
* @param nb_ops No. of ops to be submitted
* @return 0 on success otherwise -1
*/
-int process_ops_to_enqueue(const struct ccp_qp *qp,
+int process_ops_to_enqueue(struct ccp_qp *qp,
struct rte_crypto_op **op,
struct ccp_queue *cmd_q,
uint16_t nb_ops,
- int slots_req);
+ uint16_t total_nb_ops,
+ int slots_req,
+ uint16_t b_idx);
/**
* process crypto ops to be dequeued
*/
int process_ops_to_dequeue(struct ccp_qp *qp,
struct rte_crypto_op **op,
- uint16_t nb_ops);
+ uint16_t nb_ops,
+ uint16_t *total_nb_ops);
+
+
+/**
+ * Apis for SHA3 partial hash generation
+ * @param data_in buffer pointer on which phash is applied
+ * @param data_out phash result in ccp be format is written
+ */
+int partial_hash_sha3_224(uint8_t *data_in,
+ uint8_t *data_out);
+
+int partial_hash_sha3_256(uint8_t *data_in,
+ uint8_t *data_out);
+
+int partial_hash_sha3_384(uint8_t *data_in,
+ uint8_t *data_out);
+
+int partial_hash_sha3_512(uint8_t *data_in,
+ uint8_t *data_out);
#endif /* _CCP_CRYPTO_H_ */