linux/drivers/crypto/marvell/octeontx2/otx2_cptvf_algs.c

// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (C) 2020 Marvell. */

#include <crypto/aes.h>
#include <crypto/authenc.h>
#include <crypto/cryptd.h>
#include <crypto/des.h>
#include <crypto/internal/aead.h>
#include <crypto/sha1.h>
#include <crypto/sha2.h>
#include <crypto/xts.h>
#include <crypto/gcm.h>
#include <crypto/scatterwalk.h>
#include <linux/sort.h>
#include <linux/module.h>
#include "otx2_cptvf.h"
#include "otx2_cptvf_algs.h"
#include "otx2_cpt_reqmgr.h"
#include "cn10k_cpt.h"

/* Size of salt in AES GCM mode */
#define AES_GCM_SALT_SIZE
/* Size of IV in AES GCM mode */
#define AES_GCM_IV_SIZE
/* Size of ICV (Integrity Check Value) in AES GCM mode */
#define AES_GCM_ICV_SIZE
/* Offset of IV in AES GCM mode */
#define AES_GCM_IV_OFFSET
#define CONTROL_WORD_LEN
#define KEY2_OFFSET
#define DMA_MODE_FLAG(dma_mode)

/* Truncated SHA digest size */
#define SHA1_TRUNC_DIGEST_SIZE
#define SHA256_TRUNC_DIGEST_SIZE
#define SHA384_TRUNC_DIGEST_SIZE
#define SHA512_TRUNC_DIGEST_SIZE

static DEFINE_MUTEX(mutex);
static int is_crypto_registered;

struct cpt_device_desc {};

struct cpt_device_table {};

static struct cpt_device_table se_devices =;

static struct otx2_cpt_sdesc *alloc_sdesc(struct crypto_shash *alg);

static inline int get_se_device(struct pci_dev **pdev, int *cpu_num)
{}

static inline int validate_hmac_cipher_null(struct otx2_cpt_req_info *cpt_req)
{}

static void otx2_cpt_aead_callback(int status, void *arg1, void *arg2)
{}

static void output_iv_copyback(struct crypto_async_request *areq)
{}

static void otx2_cpt_skcipher_callback(int status, void *arg1, void *arg2)
{}

static inline void update_input_data(struct otx2_cpt_req_info *req_info,
				     struct scatterlist *inp_sg,
				     u32 nbytes, u32 *argcnt)
{}

static inline void update_output_data(struct otx2_cpt_req_info *req_info,
				      struct scatterlist *outp_sg,
				      u32 offset, u32 nbytes, u32 *argcnt)
{}

static inline int create_ctx_hdr(struct skcipher_request *req, u32 enc,
				 u32 *argcnt)
{}

static inline int create_input_list(struct skcipher_request *req, u32 enc,
				    u32 enc_iv_len)
{}

static inline void create_output_list(struct skcipher_request *req,
				      u32 enc_iv_len)
{}

static int skcipher_do_fallback(struct skcipher_request *req, bool is_enc)
{}

static inline int cpt_enc_dec(struct skcipher_request *req, u32 enc)
{}

static int otx2_cpt_skcipher_encrypt(struct skcipher_request *req)
{}

static int otx2_cpt_skcipher_decrypt(struct skcipher_request *req)
{}

static int otx2_cpt_skcipher_xts_setkey(struct crypto_skcipher *tfm,
				       const u8 *key, u32 keylen)
{}

static int cpt_des_setkey(struct crypto_skcipher *tfm, const u8 *key,
			  u32 keylen, u8 cipher_type)
{}

static int cpt_aes_setkey(struct crypto_skcipher *tfm, const u8 *key,
			  u32 keylen, u8 cipher_type)
{}

static int otx2_cpt_skcipher_cbc_aes_setkey(struct crypto_skcipher *tfm,
					    const u8 *key, u32 keylen)
{}

static int otx2_cpt_skcipher_ecb_aes_setkey(struct crypto_skcipher *tfm,
					    const u8 *key, u32 keylen)
{}

static int otx2_cpt_skcipher_cbc_des3_setkey(struct crypto_skcipher *tfm,
					     const u8 *key, u32 keylen)
{}

static int otx2_cpt_skcipher_ecb_des3_setkey(struct crypto_skcipher *tfm,
					     const u8 *key, u32 keylen)
{}

static int cpt_skcipher_fallback_init(struct otx2_cpt_enc_ctx *ctx,
				      struct crypto_alg *alg)
{}

static int otx2_cpt_enc_dec_init(struct crypto_skcipher *stfm)
{}

static void otx2_cpt_skcipher_exit(struct crypto_skcipher *tfm)
{}

static int cpt_aead_fallback_init(struct otx2_cpt_aead_ctx *ctx,
				  struct crypto_alg *alg)
{}

static int cpt_aead_init(struct crypto_aead *atfm, u8 cipher_type, u8 mac_type)
{}

static int otx2_cpt_aead_cbc_aes_sha1_init(struct crypto_aead *tfm)
{}

static int otx2_cpt_aead_cbc_aes_sha256_init(struct crypto_aead *tfm)
{}

static int otx2_cpt_aead_cbc_aes_sha384_init(struct crypto_aead *tfm)
{}

static int otx2_cpt_aead_cbc_aes_sha512_init(struct crypto_aead *tfm)
{}

static int otx2_cpt_aead_ecb_null_sha1_init(struct crypto_aead *tfm)
{}

static int otx2_cpt_aead_ecb_null_sha256_init(struct crypto_aead *tfm)
{}

static int otx2_cpt_aead_ecb_null_sha384_init(struct crypto_aead *tfm)
{}

static int otx2_cpt_aead_ecb_null_sha512_init(struct crypto_aead *tfm)
{}

static int otx2_cpt_aead_gcm_aes_init(struct crypto_aead *tfm)
{}

static void otx2_cpt_aead_exit(struct crypto_aead *tfm)
{}

static int otx2_cpt_aead_gcm_set_authsize(struct crypto_aead *tfm,
					  unsigned int authsize)
{}

static int otx2_cpt_aead_set_authsize(struct crypto_aead *tfm,
				      unsigned int authsize)
{}

static int otx2_cpt_aead_null_set_authsize(struct crypto_aead *tfm,
					   unsigned int authsize)
{}

static struct otx2_cpt_sdesc *alloc_sdesc(struct crypto_shash *alg)
{}

static inline void swap_data32(void *buf, u32 len)
{}

static inline void swap_data64(void *buf, u32 len)
{}

static int swap_pad(u8 mac_type, u8 *pad)
{}

static int aead_hmac_init(struct crypto_aead *cipher,
			  struct crypto_authenc_keys *keys)
{}

static int otx2_cpt_aead_cbc_aes_sha_setkey(struct crypto_aead *cipher,
					    const unsigned char *key,
					    unsigned int keylen)
{}

static int otx2_cpt_aead_ecb_null_sha_setkey(struct crypto_aead *cipher,
					     const unsigned char *key,
					     unsigned int keylen)
{}

static int otx2_cpt_aead_gcm_aes_setkey(struct crypto_aead *cipher,
					const unsigned char *key,
					unsigned int keylen)
{}

static inline int create_aead_ctx_hdr(struct aead_request *req, u32 enc,
				      u32 *argcnt)
{}

static inline void create_hmac_ctx_hdr(struct aead_request *req, u32 *argcnt,
				      u32 enc)
{}

static inline int create_aead_input_list(struct aead_request *req, u32 enc)
{}

static inline void create_aead_output_list(struct aead_request *req, u32 enc,
					   u32 mac_len)
{}

static inline void create_aead_null_input_list(struct aead_request *req,
					       u32 enc, u32 mac_len)
{}

static inline int create_aead_null_output_list(struct aead_request *req,
					       u32 enc, u32 mac_len)
{}

static int aead_do_fallback(struct aead_request *req, bool is_enc)
{}

static int cpt_aead_enc_dec(struct aead_request *req, u8 reg_type, u8 enc)
{}

static int otx2_cpt_aead_encrypt(struct aead_request *req)
{}

static int otx2_cpt_aead_decrypt(struct aead_request *req)
{}

static int otx2_cpt_aead_null_encrypt(struct aead_request *req)
{}

static int otx2_cpt_aead_null_decrypt(struct aead_request *req)
{}

static struct skcipher_alg otx2_cpt_skciphers[] =;

static struct aead_alg otx2_cpt_aeads[] =;

static inline int cpt_register_algs(void)
{}

static inline void cpt_unregister_algs(void)
{}

static int compare_func(const void *lptr, const void *rptr)
{}

int otx2_cpt_crypto_init(struct pci_dev *pdev, struct module *mod,
			 int num_queues, int num_devices)
{}

void otx2_cpt_crypto_exit(struct pci_dev *pdev, struct module *mod)
{}