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

// SPDX-License-Identifier: GPL-2.0-only
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
/*
 * Crypto driver file to manage keys of NVIDIA Security Engine.
 */

#include <linux/bitops.h>
#include <linux/module.h>
#include <crypto/aes.h>

#include "tegra-se.h"

#define SE_KEY_FULL_MASK

/* Reserve keyslot 0, 14, 15 */
#define SE_KEY_RSVD_MASK
#define SE_KEY_VALID_MASK

/* Mutex lock to guard keyslots */
static DEFINE_MUTEX(kslt_lock);

/* Keyslot bitmask (0 = available, 1 = in use/not available) */
static u16 tegra_se_keyslots =;

static u16 tegra_keyslot_alloc(void)
{}

static void tegra_keyslot_free(u16 slot)
{}

static unsigned int tegra_key_prep_ins_cmd(struct tegra_se *se, u32 *cpuvaddr,
					   const u32 *key, u32 keylen, u16 slot, u32 alg)
{}

static bool tegra_key_in_kslt(u32 keyid)
{}

static int tegra_key_insert(struct tegra_se *se, const u8 *key,
			    u32 keylen, u16 slot, u32 alg)
{}

void tegra_key_invalidate(struct tegra_se *se, u32 keyid, u32 alg)
{}

int tegra_key_submit(struct tegra_se *se, const u8 *key, u32 keylen, u32 alg, u32 *keyid)
{}