#include <crypto/aes.h>
#include <crypto/hmac.h>
#include <crypto/md5.h>
#include <crypto/sha1.h>
#include <crypto/sha2.h>
#include <crypto/sha3.h>
#include <crypto/skcipher.h>
#include <crypto/sm3.h>
#include <crypto/internal/cipher.h>
#include <linux/device.h>
#include <linux/dma-mapping.h>
#include <linux/dmapool.h>
#include "safexcel.h"
struct safexcel_ahash_ctx { … };
struct safexcel_ahash_req { … };
static inline u64 safexcel_queued_len(struct safexcel_ahash_req *req)
{ … }
static void safexcel_hash_token(struct safexcel_command_desc *cdesc,
u32 input_length, u32 result_length,
bool cbcmac)
{ … }
static void safexcel_context_control(struct safexcel_ahash_ctx *ctx,
struct safexcel_ahash_req *req,
struct safexcel_command_desc *cdesc)
{ … }
static int safexcel_ahash_enqueue(struct ahash_request *areq);
static int safexcel_handle_req_result(struct safexcel_crypto_priv *priv,
int ring,
struct crypto_async_request *async,
bool *should_complete, int *ret)
{ … }
static int safexcel_ahash_send_req(struct crypto_async_request *async, int ring,
int *commands, int *results)
{ … }
static int safexcel_handle_inv_result(struct safexcel_crypto_priv *priv,
int ring,
struct crypto_async_request *async,
bool *should_complete, int *ret)
{ … }
static int safexcel_handle_result(struct safexcel_crypto_priv *priv, int ring,
struct crypto_async_request *async,
bool *should_complete, int *ret)
{ … }
static int safexcel_ahash_send_inv(struct crypto_async_request *async,
int ring, int *commands, int *results)
{ … }
static int safexcel_ahash_send(struct crypto_async_request *async,
int ring, int *commands, int *results)
{ … }
static int safexcel_ahash_exit_inv(struct crypto_tfm *tfm)
{ … }
static int safexcel_ahash_cache(struct ahash_request *areq)
{ … }
static int safexcel_ahash_enqueue(struct ahash_request *areq)
{ … }
static int safexcel_ahash_update(struct ahash_request *areq)
{ … }
static int safexcel_ahash_final(struct ahash_request *areq)
{ … }
static int safexcel_ahash_finup(struct ahash_request *areq)
{ … }
static int safexcel_ahash_export(struct ahash_request *areq, void *out)
{ … }
static int safexcel_ahash_import(struct ahash_request *areq, const void *in)
{ … }
static int safexcel_ahash_cra_init(struct crypto_tfm *tfm)
{ … }
static int safexcel_sha1_init(struct ahash_request *areq)
{ … }
static int safexcel_sha1_digest(struct ahash_request *areq)
{ … }
static void safexcel_ahash_cra_exit(struct crypto_tfm *tfm)
{ … }
struct safexcel_alg_template safexcel_alg_sha1 = …;
static int safexcel_hmac_sha1_init(struct ahash_request *areq)
{ … }
static int safexcel_hmac_sha1_digest(struct ahash_request *areq)
{ … }
static int safexcel_hmac_init_pad(struct ahash_request *areq,
unsigned int blocksize, const u8 *key,
unsigned int keylen, u8 *ipad, u8 *opad)
{ … }
static int safexcel_hmac_init_iv(struct ahash_request *areq,
unsigned int blocksize, u8 *pad, void *state)
{ … }
static int __safexcel_hmac_setkey(const char *alg, const u8 *key,
unsigned int keylen,
void *istate, void *ostate)
{ … }
int safexcel_hmac_setkey(struct safexcel_context *base, const u8 *key,
unsigned int keylen, const char *alg,
unsigned int state_sz)
{ … }
static int safexcel_hmac_alg_setkey(struct crypto_ahash *tfm, const u8 *key,
unsigned int keylen, const char *alg,
unsigned int state_sz)
{ … }
static int safexcel_hmac_sha1_setkey(struct crypto_ahash *tfm, const u8 *key,
unsigned int keylen)
{ … }
struct safexcel_alg_template safexcel_alg_hmac_sha1 = …;
static int safexcel_sha256_init(struct ahash_request *areq)
{ … }
static int safexcel_sha256_digest(struct ahash_request *areq)
{ … }
struct safexcel_alg_template safexcel_alg_sha256 = …;
static int safexcel_sha224_init(struct ahash_request *areq)
{ … }
static int safexcel_sha224_digest(struct ahash_request *areq)
{ … }
struct safexcel_alg_template safexcel_alg_sha224 = …;
static int safexcel_hmac_sha224_setkey(struct crypto_ahash *tfm, const u8 *key,
unsigned int keylen)
{ … }
static int safexcel_hmac_sha224_init(struct ahash_request *areq)
{ … }
static int safexcel_hmac_sha224_digest(struct ahash_request *areq)
{ … }
struct safexcel_alg_template safexcel_alg_hmac_sha224 = …;
static int safexcel_hmac_sha256_setkey(struct crypto_ahash *tfm, const u8 *key,
unsigned int keylen)
{ … }
static int safexcel_hmac_sha256_init(struct ahash_request *areq)
{ … }
static int safexcel_hmac_sha256_digest(struct ahash_request *areq)
{ … }
struct safexcel_alg_template safexcel_alg_hmac_sha256 = …;
static int safexcel_sha512_init(struct ahash_request *areq)
{ … }
static int safexcel_sha512_digest(struct ahash_request *areq)
{ … }
struct safexcel_alg_template safexcel_alg_sha512 = …;
static int safexcel_sha384_init(struct ahash_request *areq)
{ … }
static int safexcel_sha384_digest(struct ahash_request *areq)
{ … }
struct safexcel_alg_template safexcel_alg_sha384 = …;
static int safexcel_hmac_sha512_setkey(struct crypto_ahash *tfm, const u8 *key,
unsigned int keylen)
{ … }
static int safexcel_hmac_sha512_init(struct ahash_request *areq)
{ … }
static int safexcel_hmac_sha512_digest(struct ahash_request *areq)
{ … }
struct safexcel_alg_template safexcel_alg_hmac_sha512 = …;
static int safexcel_hmac_sha384_setkey(struct crypto_ahash *tfm, const u8 *key,
unsigned int keylen)
{ … }
static int safexcel_hmac_sha384_init(struct ahash_request *areq)
{ … }
static int safexcel_hmac_sha384_digest(struct ahash_request *areq)
{ … }
struct safexcel_alg_template safexcel_alg_hmac_sha384 = …;
static int safexcel_md5_init(struct ahash_request *areq)
{ … }
static int safexcel_md5_digest(struct ahash_request *areq)
{ … }
struct safexcel_alg_template safexcel_alg_md5 = …;
static int safexcel_hmac_md5_init(struct ahash_request *areq)
{ … }
static int safexcel_hmac_md5_setkey(struct crypto_ahash *tfm, const u8 *key,
unsigned int keylen)
{ … }
static int safexcel_hmac_md5_digest(struct ahash_request *areq)
{ … }
struct safexcel_alg_template safexcel_alg_hmac_md5 = …;
static int safexcel_crc32_cra_init(struct crypto_tfm *tfm)
{ … }
static int safexcel_crc32_init(struct ahash_request *areq)
{ … }
static int safexcel_crc32_setkey(struct crypto_ahash *tfm, const u8 *key,
unsigned int keylen)
{ … }
static int safexcel_crc32_digest(struct ahash_request *areq)
{ … }
struct safexcel_alg_template safexcel_alg_crc32 = …;
static int safexcel_cbcmac_init(struct ahash_request *areq)
{ … }
static int safexcel_cbcmac_setkey(struct crypto_ahash *tfm, const u8 *key,
unsigned int len)
{ … }
static int safexcel_cbcmac_digest(struct ahash_request *areq)
{ … }
struct safexcel_alg_template safexcel_alg_cbcmac = …;
static int safexcel_xcbcmac_setkey(struct crypto_ahash *tfm, const u8 *key,
unsigned int len)
{ … }
static int safexcel_xcbcmac_cra_init(struct crypto_tfm *tfm)
{ … }
static void safexcel_xcbcmac_cra_exit(struct crypto_tfm *tfm)
{ … }
struct safexcel_alg_template safexcel_alg_xcbcmac = …;
static int safexcel_cmac_setkey(struct crypto_ahash *tfm, const u8 *key,
unsigned int len)
{ … }
struct safexcel_alg_template safexcel_alg_cmac = …;
static int safexcel_sm3_init(struct ahash_request *areq)
{ … }
static int safexcel_sm3_digest(struct ahash_request *areq)
{ … }
struct safexcel_alg_template safexcel_alg_sm3 = …;
static int safexcel_hmac_sm3_setkey(struct crypto_ahash *tfm, const u8 *key,
unsigned int keylen)
{ … }
static int safexcel_hmac_sm3_init(struct ahash_request *areq)
{ … }
static int safexcel_hmac_sm3_digest(struct ahash_request *areq)
{ … }
struct safexcel_alg_template safexcel_alg_hmac_sm3 = …;
static int safexcel_sha3_224_init(struct ahash_request *areq)
{ … }
static int safexcel_sha3_fbcheck(struct ahash_request *req)
{ … }
static int safexcel_sha3_update(struct ahash_request *req)
{ … }
static int safexcel_sha3_final(struct ahash_request *req)
{ … }
static int safexcel_sha3_finup(struct ahash_request *req)
{ … }
static int safexcel_sha3_digest_fallback(struct ahash_request *req)
{ … }
static int safexcel_sha3_224_digest(struct ahash_request *req)
{ … }
static int safexcel_sha3_export(struct ahash_request *req, void *out)
{ … }
static int safexcel_sha3_import(struct ahash_request *req, const void *in)
{ … }
static int safexcel_sha3_cra_init(struct crypto_tfm *tfm)
{ … }
static void safexcel_sha3_cra_exit(struct crypto_tfm *tfm)
{ … }
struct safexcel_alg_template safexcel_alg_sha3_224 = …;
static int safexcel_sha3_256_init(struct ahash_request *areq)
{ … }
static int safexcel_sha3_256_digest(struct ahash_request *req)
{ … }
struct safexcel_alg_template safexcel_alg_sha3_256 = …;
static int safexcel_sha3_384_init(struct ahash_request *areq)
{ … }
static int safexcel_sha3_384_digest(struct ahash_request *req)
{ … }
struct safexcel_alg_template safexcel_alg_sha3_384 = …;
static int safexcel_sha3_512_init(struct ahash_request *areq)
{ … }
static int safexcel_sha3_512_digest(struct ahash_request *req)
{ … }
struct safexcel_alg_template safexcel_alg_sha3_512 = …;
static int safexcel_hmac_sha3_cra_init(struct crypto_tfm *tfm, const char *alg)
{ … }
static void safexcel_hmac_sha3_cra_exit(struct crypto_tfm *tfm)
{ … }
static int safexcel_hmac_sha3_setkey(struct crypto_ahash *tfm, const u8 *key,
unsigned int keylen)
{ … }
static int safexcel_hmac_sha3_224_init(struct ahash_request *areq)
{ … }
static int safexcel_hmac_sha3_224_digest(struct ahash_request *req)
{ … }
static int safexcel_hmac_sha3_224_cra_init(struct crypto_tfm *tfm)
{ … }
struct safexcel_alg_template safexcel_alg_hmac_sha3_224 = …;
static int safexcel_hmac_sha3_256_init(struct ahash_request *areq)
{ … }
static int safexcel_hmac_sha3_256_digest(struct ahash_request *req)
{ … }
static int safexcel_hmac_sha3_256_cra_init(struct crypto_tfm *tfm)
{ … }
struct safexcel_alg_template safexcel_alg_hmac_sha3_256 = …;
static int safexcel_hmac_sha3_384_init(struct ahash_request *areq)
{ … }
static int safexcel_hmac_sha3_384_digest(struct ahash_request *req)
{ … }
static int safexcel_hmac_sha3_384_cra_init(struct crypto_tfm *tfm)
{ … }
struct safexcel_alg_template safexcel_alg_hmac_sha3_384 = …;
static int safexcel_hmac_sha3_512_init(struct ahash_request *areq)
{ … }
static int safexcel_hmac_sha3_512_digest(struct ahash_request *req)
{ … }
static int safexcel_hmac_sha3_512_cra_init(struct crypto_tfm *tfm)
{ … }
struct safexcel_alg_template safexcel_alg_hmac_sha3_512 = …;