linux/drivers/crypto/intel/qat/qat_common/qat_asym_algs.c

// SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only)
/* Copyright(c) 2014 - 2020 Intel Corporation */
#include <linux/module.h>
#include <crypto/internal/rsa.h>
#include <crypto/internal/akcipher.h>
#include <crypto/akcipher.h>
#include <crypto/kpp.h>
#include <crypto/internal/kpp.h>
#include <crypto/dh.h>
#include <linux/dma-mapping.h>
#include <linux/fips.h>
#include <crypto/scatterwalk.h>
#include "icp_qat_fw_pke.h"
#include "adf_accel_devices.h"
#include "qat_algs_send.h"
#include "adf_transport.h"
#include "adf_common_drv.h"
#include "qat_crypto.h"

static DEFINE_MUTEX(algs_lock);
static unsigned int active_devs;

struct qat_rsa_input_params {} __packed __aligned();

struct qat_rsa_output_params {} __packed __aligned();

struct qat_rsa_ctx {} __packed __aligned();

struct qat_dh_input_params {} __packed __aligned();

struct qat_dh_output_params {} __packed __aligned();

struct qat_dh_ctx {} __packed __aligned();

struct qat_asym_request {} __aligned();

static int qat_alg_send_asym_message(struct qat_asym_request *qat_req,
				     struct qat_crypto_instance *inst,
				     struct crypto_async_request *base)
{}

static void qat_dh_cb(struct icp_qat_fw_pke_resp *resp)
{}

#define PKE_DH_1536
#define PKE_DH_G2_1536
#define PKE_DH_2048
#define PKE_DH_G2_2048
#define PKE_DH_3072
#define PKE_DH_G2_3072
#define PKE_DH_4096
#define PKE_DH_G2_4096

static unsigned long qat_dh_fn_id(unsigned int len, bool g2)
{}

static int qat_dh_compute_value(struct kpp_request *req)
{}

static int qat_dh_generate_public_key(struct kpp_request *req)
{}

static int qat_dh_compute_shared_secret(struct kpp_request *req)
{}

static int qat_dh_check_params_length(unsigned int p_len)
{}

static int qat_dh_set_params(struct qat_dh_ctx *ctx, struct dh *params)
{}

static void qat_dh_clear_ctx(struct device *dev, struct qat_dh_ctx *ctx)
{}

static int qat_dh_set_secret(struct crypto_kpp *tfm, const void *buf,
			     unsigned int len)
{}

static unsigned int qat_dh_max_size(struct crypto_kpp *tfm)
{}

static int qat_dh_init_tfm(struct crypto_kpp *tfm)
{}

static void qat_dh_exit_tfm(struct crypto_kpp *tfm)
{}

static void qat_rsa_cb(struct icp_qat_fw_pke_resp *resp)
{}

void qat_alg_asym_callback(void *_resp)
{}

#define PKE_RSA_EP_512
#define PKE_RSA_EP_1024
#define PKE_RSA_EP_1536
#define PKE_RSA_EP_2048
#define PKE_RSA_EP_3072
#define PKE_RSA_EP_4096

static unsigned long qat_rsa_enc_fn_id(unsigned int len)
{}

#define PKE_RSA_DP1_512
#define PKE_RSA_DP1_1024
#define PKE_RSA_DP1_1536
#define PKE_RSA_DP1_2048
#define PKE_RSA_DP1_3072
#define PKE_RSA_DP1_4096

static unsigned long qat_rsa_dec_fn_id(unsigned int len)
{}

#define PKE_RSA_DP2_512
#define PKE_RSA_DP2_1024
#define PKE_RSA_DP2_1536
#define PKE_RSA_DP2_2048
#define PKE_RSA_DP2_3072
#define PKE_RSA_DP2_4096

static unsigned long qat_rsa_dec_fn_id_crt(unsigned int len)
{}

static int qat_rsa_enc(struct akcipher_request *req)
{}

static int qat_rsa_dec(struct akcipher_request *req)
{}

static int qat_rsa_set_n(struct qat_rsa_ctx *ctx, const char *value,
			 size_t vlen)
{}

static int qat_rsa_set_e(struct qat_rsa_ctx *ctx, const char *value,
			 size_t vlen)
{}

static int qat_rsa_set_d(struct qat_rsa_ctx *ctx, const char *value,
			 size_t vlen)
{}

static void qat_rsa_drop_leading_zeros(const char **ptr, unsigned int *len)
{}

static void qat_rsa_setkey_crt(struct qat_rsa_ctx *ctx, struct rsa_key *rsa_key)
{}

static void qat_rsa_clear_ctx(struct device *dev, struct qat_rsa_ctx *ctx)
{}

static int qat_rsa_setkey(struct crypto_akcipher *tfm, const void *key,
			  unsigned int keylen, bool private)
{}

static int qat_rsa_setpubkey(struct crypto_akcipher *tfm, const void *key,
			     unsigned int keylen)
{}

static int qat_rsa_setprivkey(struct crypto_akcipher *tfm, const void *key,
			      unsigned int keylen)
{}

static unsigned int qat_rsa_max_size(struct crypto_akcipher *tfm)
{}

static int qat_rsa_init_tfm(struct crypto_akcipher *tfm)
{}

static void qat_rsa_exit_tfm(struct crypto_akcipher *tfm)
{}

static struct akcipher_alg rsa =;

static struct kpp_alg dh =;

int qat_asym_algs_register(void)
{}

void qat_asym_algs_unregister(void)
{}