#include "aspeed-hace.h"
#include <crypto/engine.h>
#include <crypto/hmac.h>
#include <crypto/internal/hash.h>
#include <crypto/scatterwalk.h>
#include <crypto/sha1.h>
#include <crypto/sha2.h>
#include <linux/dma-mapping.h>
#include <linux/err.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/string.h>
#ifdef CONFIG_CRYPTO_DEV_ASPEED_DEBUG
#define AHASH_DBG(h, fmt, ...) …
#else
#define AHASH_DBG …
#endif
static const __be32 sha1_iv[8] = …;
static const __be32 sha224_iv[8] = …;
static const __be32 sha256_iv[8] = …;
static const __be64 sha384_iv[8] = …;
static const __be64 sha512_iv[8] = …;
static void aspeed_ahash_fill_padding(struct aspeed_hace_dev *hace_dev,
struct aspeed_sham_reqctx *rctx)
{ … }
static int aspeed_ahash_dma_prepare(struct aspeed_hace_dev *hace_dev)
{ … }
static int aspeed_ahash_dma_prepare_sg(struct aspeed_hace_dev *hace_dev)
{ … }
static int aspeed_ahash_complete(struct aspeed_hace_dev *hace_dev)
{ … }
static int aspeed_ahash_transfer(struct aspeed_hace_dev *hace_dev)
{ … }
static int aspeed_hace_ahash_trigger(struct aspeed_hace_dev *hace_dev,
aspeed_hace_fn_t resume)
{ … }
static int aspeed_ahash_hmac_resume(struct aspeed_hace_dev *hace_dev)
{ … }
static int aspeed_ahash_req_final(struct aspeed_hace_dev *hace_dev)
{ … }
static int aspeed_ahash_update_resume_sg(struct aspeed_hace_dev *hace_dev)
{ … }
static int aspeed_ahash_update_resume(struct aspeed_hace_dev *hace_dev)
{ … }
static int aspeed_ahash_req_update(struct aspeed_hace_dev *hace_dev)
{ … }
static int aspeed_hace_hash_handle_queue(struct aspeed_hace_dev *hace_dev,
struct ahash_request *req)
{ … }
static int aspeed_ahash_do_request(struct crypto_engine *engine, void *areq)
{ … }
static void aspeed_ahash_prepare_request(struct crypto_engine *engine,
void *areq)
{ … }
static int aspeed_ahash_do_one(struct crypto_engine *engine, void *areq)
{ … }
static int aspeed_sham_update(struct ahash_request *req)
{ … }
static int aspeed_sham_shash_digest(struct crypto_shash *tfm, u32 flags,
const u8 *data, unsigned int len, u8 *out)
{ … }
static int aspeed_sham_final(struct ahash_request *req)
{ … }
static int aspeed_sham_finup(struct ahash_request *req)
{ … }
static int aspeed_sham_init(struct ahash_request *req)
{ … }
static int aspeed_sham_digest(struct ahash_request *req)
{ … }
static int aspeed_sham_setkey(struct crypto_ahash *tfm, const u8 *key,
unsigned int keylen)
{ … }
static int aspeed_sham_cra_init(struct crypto_tfm *tfm)
{ … }
static void aspeed_sham_cra_exit(struct crypto_tfm *tfm)
{ … }
static int aspeed_sham_export(struct ahash_request *req, void *out)
{ … }
static int aspeed_sham_import(struct ahash_request *req, const void *in)
{ … }
static struct aspeed_hace_alg aspeed_ahash_algs[] = …;
static struct aspeed_hace_alg aspeed_ahash_algs_g6[] = …;
void aspeed_unregister_hace_hash_algs(struct aspeed_hace_dev *hace_dev)
{ … }
void aspeed_register_hace_hash_algs(struct aspeed_hace_dev *hace_dev)
{ … }