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

#ifndef __TEGRA_SE_AES_H__
#define __TEGRA_SE_AES_H__

#include <tee_api_types.h>

/*
 * SE AES CBC - AES encryption function with CBC mode
 *
 * src			[in] source buffer of input key
 * src_len		[in] buffer length of input key
 * dst			[out] buffer of output buffer
 * keyslot		[in] SE keyslot.
 * iv			[in] initial vector
 */

TEE_Result tegra_se_aes_encrypt_cbc(uint8_t *src, size_t src_len,
					uint8_t *dst, uint32_t keyslot, uint8_t *iv);

#if defined(PLATFORM_FLAVOR_t264)
/*
 * SE AES CMAC - AES-CMAC
 *
 * keyslot		[in] SE keyslot.
 * keylen		[in] key length
 * src			[in] source buffer
 * src_len		[in] buffer length
 * mac			[out] buffer of mac
 * mac_len		[out] lenght of mac
 */
TEE_Result tegra_se_aes_cmac(uint32_t keyslot, uint32_t key_len,
			     uint8_t *src, uint32_t src_len,
			     uint8_t *mac,  uint32_t mac_len);
#endif

#endif
