// SPDX-License-Identifier: BSD-2-Clause
/*
 * SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 */

#ifndef __TEGRA_SE_DRIVER_AES_H__
#define __TEGRA_SE_DRIVER_AES_H__

#include <drivers/tegra/tegra_se_keyslot.h>

TEE_Result se_aes_encrypt(uint8_t *src, size_t src_len,
			  uint8_t *dst, size_t dst_len, se_aes_op_mode mode,
			  uint32_t keyslot, uint8_t *iv);

TEE_Result se_aes_ecb_kdf(uint8_t *derived_key, size_t derived_key_len,
			  uint8_t *iv, size_t iv_len,
			  uint32_t keyslot);

TEE_Result se_nist_sp_800_108_cmac_kdf(se_aes_keyslot_t keyslot,
				       uint32_t key_len,
				       char const *context, uint32_t context_len,
				       char const *label, uint32_t label_len,
				       uint32_t dk_len, uint8_t *out_dk);

TEE_Result se_write_aes_keyslot(uint8_t *input_key, uint32_t keylen,
				uint32_t key_quad_sel, se_aes_keyslot_t keyslot);

TEE_Result se_clear_aes_keyslots(void);

#endif /* __TEGRA_SE_DRIVER_AES_H__  */
