linux/drivers/crypto/tegra/tegra-se-aes.c

// SPDX-License-Identifier: GPL-2.0-only
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
/*
 * Crypto driver to handle block cipher algorithms using NVIDIA Security Engine.
 */

#include <linux/clk.h>
#include <linux/dma-mapping.h>
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/platform_device.h>

#include <crypto/aead.h>
#include <crypto/aes.h>
#include <crypto/engine.h>
#include <crypto/gcm.h>
#include <crypto/scatterwalk.h>
#include <crypto/xts.h>
#include <crypto/internal/aead.h>
#include <crypto/internal/hash.h>
#include <crypto/internal/skcipher.h>

#include "tegra-se.h"

struct tegra_aes_ctx {};

struct tegra_aes_reqctx {};

struct tegra_aead_ctx {};

struct tegra_aead_reqctx {};

struct tegra_cmac_ctx {};

struct tegra_cmac_reqctx {};

/* increment counter (128-bit int) */
static void ctr_iv_inc(__u8 *counter, __u8 bits, __u32 nums)
{}

static void tegra_cbc_iv_copyback(struct skcipher_request *req, struct tegra_aes_ctx *ctx)
{}

static void tegra_aes_update_iv(struct skcipher_request *req, struct tegra_aes_ctx *ctx)
{}

static int tegra234_aes_crypto_cfg(u32 alg, bool encrypt)
{}

static int tegra234_aes_cfg(u32 alg, bool encrypt)
{}

static unsigned int tegra_aes_prep_cmd(struct tegra_aes_ctx *ctx,
				       struct tegra_aes_reqctx *rctx)
{}

static int tegra_aes_do_one_req(struct crypto_engine *engine, void *areq)
{}

static int tegra_aes_cra_init(struct crypto_skcipher *tfm)
{}

static void tegra_aes_cra_exit(struct crypto_skcipher *tfm)
{}

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

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

static int tegra_aes_kac_manifest(u32 user, u32 alg, u32 keylen)
{}

static int tegra_aes_crypt(struct skcipher_request *req, bool encrypt)

{}

static int tegra_aes_encrypt(struct skcipher_request *req)
{}

static int tegra_aes_decrypt(struct skcipher_request *req)
{}

static struct tegra_se_alg tegra_aes_algs[] =;

static unsigned int tegra_gmac_prep_cmd(struct tegra_aead_ctx *ctx,
					struct tegra_aead_reqctx *rctx)
{}

static unsigned int tegra_gcm_crypt_prep_cmd(struct tegra_aead_ctx *ctx,
					     struct tegra_aead_reqctx *rctx)
{}

static int tegra_gcm_prep_final_cmd(struct tegra_se *se, u32 *cpuvaddr,
				    struct tegra_aead_reqctx *rctx)
{}

static int tegra_gcm_do_gmac(struct tegra_aead_ctx *ctx, struct tegra_aead_reqctx *rctx)
{}

static int tegra_gcm_do_crypt(struct tegra_aead_ctx *ctx, struct tegra_aead_reqctx *rctx)
{}

static int tegra_gcm_do_final(struct tegra_aead_ctx *ctx, struct tegra_aead_reqctx *rctx)
{}

static int tegra_gcm_do_verify(struct tegra_se *se, struct tegra_aead_reqctx *rctx)
{}

static inline int tegra_ccm_check_iv(const u8 *iv)
{}

static unsigned int tegra_cbcmac_prep_cmd(struct tegra_aead_ctx *ctx,
					  struct tegra_aead_reqctx *rctx)
{}

static unsigned int tegra_ctr_prep_cmd(struct tegra_aead_ctx *ctx,
				       struct tegra_aead_reqctx *rctx)
{}

static int tegra_ccm_do_cbcmac(struct tegra_aead_ctx *ctx, struct tegra_aead_reqctx *rctx)
{}

static int tegra_ccm_set_msg_len(u8 *block, unsigned int msglen, int csize)
{}

static int tegra_ccm_format_nonce(struct tegra_aead_reqctx *rctx, u8 *nonce)
{}

static int tegra_ccm_format_adata(u8 *adata, unsigned int a)
{}

static int tegra_ccm_add_padding(u8 *buf, unsigned int len)
{}

static int tegra_ccm_format_blocks(struct tegra_aead_reqctx *rctx)
{}

static int tegra_ccm_mac_result(struct tegra_se *se, struct tegra_aead_reqctx *rctx)
{}

static int tegra_ccm_ctr_result(struct tegra_se *se, struct tegra_aead_reqctx *rctx)
{}

static int tegra_ccm_compute_auth(struct tegra_aead_ctx *ctx, struct tegra_aead_reqctx *rctx)
{}

static int tegra_ccm_do_ctr(struct tegra_aead_ctx *ctx, struct tegra_aead_reqctx *rctx)
{}

static int tegra_ccm_crypt_init(struct aead_request *req, struct tegra_se *se,
				struct tegra_aead_reqctx *rctx)
{}

static int tegra_ccm_do_one_req(struct crypto_engine *engine, void *areq)
{}

static int tegra_gcm_do_one_req(struct crypto_engine *engine, void *areq)
{}

static int tegra_aead_cra_init(struct crypto_aead *tfm)
{}

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

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

static void tegra_aead_cra_exit(struct crypto_aead *tfm)
{}

static int tegra_aead_crypt(struct aead_request *req, bool encrypt)
{}

static int tegra_aead_encrypt(struct aead_request *req)
{}

static int tegra_aead_decrypt(struct aead_request *req)
{}

static int tegra_aead_setkey(struct crypto_aead *tfm,
			     const u8 *key, u32 keylen)
{}

static unsigned int tegra_cmac_prep_cmd(struct tegra_cmac_ctx *ctx,
					struct tegra_cmac_reqctx *rctx)
{}

static void tegra_cmac_copy_result(struct tegra_se *se, struct tegra_cmac_reqctx *rctx)
{}

static void tegra_cmac_paste_result(struct tegra_se *se, struct tegra_cmac_reqctx *rctx)
{}

static int tegra_cmac_do_update(struct ahash_request *req)
{}

static int tegra_cmac_do_final(struct ahash_request *req)
{}

static int tegra_cmac_do_one_req(struct crypto_engine *engine, void *areq)
{}

static void tegra_cmac_init_fallback(struct crypto_ahash *tfm, struct tegra_cmac_ctx *ctx,
				     const char *algname)
{}

static int tegra_cmac_cra_init(struct crypto_tfm *tfm)
{}

static void tegra_cmac_cra_exit(struct crypto_tfm *tfm)
{}

static int tegra_cmac_init(struct ahash_request *req)
{}

static int tegra_cmac_setkey(struct crypto_ahash *tfm, const u8 *key,
			     unsigned int keylen)
{}

static int tegra_cmac_update(struct ahash_request *req)
{}

static int tegra_cmac_final(struct ahash_request *req)
{}

static int tegra_cmac_finup(struct ahash_request *req)
{}

static int tegra_cmac_digest(struct ahash_request *req)
{}

static int tegra_cmac_export(struct ahash_request *req, void *out)
{}

static int tegra_cmac_import(struct ahash_request *req, const void *in)
{}

static struct tegra_se_alg tegra_aead_algs[] =;

static struct tegra_se_alg tegra_cmac_algs[] =;

int tegra_init_aes(struct tegra_se *se)
{}

void tegra_deinit_aes(struct tegra_se *se)
{}