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

#include <trace.h>
#include <tegra_se_ccc.h>
#include <tegra_se_ccc_errno.h>
#include <tegra_se_ccc_rng.h>
#include <tegra_se_driver_rng.h>

#if defined(CFG_TEGRA_SE_RNG1)
TEE_Result se_rng1_get_random(void *data, uint32_t data_len)
{
	status_t ret = NO_ERROR;

	ret = tegra_se_ccc_genrnd(data, data_len);
	if (ret != NO_ERROR) {
		EMSG("%s failed with: %d", __func__, ret);
		return TEE_ERROR_GENERIC;
	}

	return TEE_SUCCESS;
}
#endif /* CFG_TEGRA_SE_RNG1 */
