/*
 * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
 *
 * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
 * property and proprietary rights in and to this material, related
 * documentation and any modifications thereto. Any use, reproduction,
 * disclosure or distribution of this material and related documentation
 * without an express license agreement from NVIDIA CORPORATION or
 * its affiliates is strictly prohibited.
 */

#ifndef __TEGRA_SE_CCC_HASH_H__
#define __TEGRA_SE_CCC_HASH_H__

#if defined (CFG_CRYPTO_DRIVER_TEGRA_SE)
#include <crypto/crypto_impl.h>
#include <drvcrypt.h>
#endif

/* tegra_se_ccc_hash_wrapper functions */
#if defined (CFG_CRYPTO_DRIVER_TEGRA_SE)
/* hash functions */
#if defined (CFG_CRYPTO_DRV_HASH_TEGRA_SE)
TEE_Result tegra_register_hash(void);
TEE_Result tegra_hash_alloc_ctx(struct crypto_hash_ctx **ctx,
				tegra_crypto_algo_mode algo);
TEE_Result tegra_ccc_hash_initialize(struct crypto_hash_ctx *ctx);
TEE_Result tegra_ccc_hash_update(struct crypto_hash_ctx *ctx,
				 const uint8_t *data, size_t len);
TEE_Result tegra_ccc_hash_final(struct crypto_hash_ctx *ctx,
				uint8_t *digest, size_t len);
void tegra_ccc_hash_free(struct crypto_hash_ctx *ctx);
void tegra_ccc_hash_copy_state(struct crypto_hash_ctx *dst_ctx,
			       struct crypto_hash_ctx *src_ctx);
#endif
#endif

#endif /* __TEGRA_SE_CCC_HASH_H__ */
