linux/drivers/crypto/ccp/ccp-crypto.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * AMD Cryptographic Coprocessor (CCP) crypto API support
 *
 * Copyright (C) 2013,2017 Advanced Micro Devices, Inc.
 *
 * Author: Tom Lendacky <[email protected]>
 */

#ifndef __CCP_CRYPTO_H__
#define __CCP_CRYPTO_H__

#include <linux/list.h>
#include <linux/wait.h>
#include <linux/ccp.h>
#include <crypto/algapi.h>
#include <crypto/aes.h>
#include <crypto/internal/aead.h>
#include <crypto/aead.h>
#include <crypto/ctr.h>
#include <crypto/hash.h>
#include <crypto/sha1.h>
#include <crypto/sha2.h>
#include <crypto/akcipher.h>
#include <crypto/skcipher.h>
#include <crypto/internal/rsa.h>

/* We want the module name in front of our messages */
#undef pr_fmt
#define pr_fmt(fmt)

#define CCP_LOG_LEVEL

#define CCP_CRA_PRIORITY

struct ccp_crypto_skcipher_alg {};

struct ccp_crypto_aead {};

struct ccp_crypto_ahash_alg {};

struct ccp_crypto_akcipher_alg {};

static inline struct ccp_crypto_skcipher_alg *
	ccp_crypto_skcipher_alg(struct crypto_skcipher *tfm)
{}

static inline struct ccp_crypto_ahash_alg *
	ccp_crypto_ahash_alg(struct crypto_tfm *tfm)
{}

/***** AES related defines *****/
struct ccp_aes_ctx {};

struct ccp_aes_req_ctx {};

struct ccp_aes_cmac_req_ctx {};

struct ccp_aes_cmac_exp_ctx {};

/***** 3DES related defines *****/
struct ccp_des3_ctx {};

struct ccp_des3_req_ctx {};

/* SHA-related defines
 * These values must be large enough to accommodate any variant
 */
#define MAX_SHA_CONTEXT_SIZE
#define MAX_SHA_BLOCK_SIZE

struct ccp_sha_ctx {};

struct ccp_sha_req_ctx {};

struct ccp_sha_exp_ctx {};

/***** RSA related defines *****/

struct ccp_rsa_ctx {};

struct ccp_rsa_req_ctx {};

#define CCP_RSA_MAXMOD
#define CCP5_RSA_MAXMOD

/***** Common Context Structure *****/
struct ccp_ctx {};

int ccp_crypto_enqueue_request(struct crypto_async_request *req,
			       struct ccp_cmd *cmd);
struct scatterlist *ccp_crypto_sg_table_add(struct sg_table *table,
					    struct scatterlist *sg_add);

int ccp_register_aes_algs(struct list_head *head);
int ccp_register_aes_cmac_algs(struct list_head *head);
int ccp_register_aes_xts_algs(struct list_head *head);
int ccp_register_aes_aeads(struct list_head *head);
int ccp_register_sha_algs(struct list_head *head);
int ccp_register_des3_algs(struct list_head *head);
int ccp_register_rsa_algs(struct list_head *head);

#endif