1 /*
2 * Copyright (c) 2020 - 2024 Renesas Electronics Corporation and/or its affiliates
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7 #ifndef HW_SCE_HASH_PRIVATE_H
8 #define HW_SCE_HASH_PRIVATE_H
9
10 /**********************************************************************************************************************
11 * Includes
12 ***********************************************************************************************************************/
13 #include "bsp_api.h"
14 #include "hw_sce_common.h"
15
16 #define HW_SCE_LARGE_DATA_VALUE_0 (0x80000000U)
17 #define HW_SCE_LARGE_DATA_VALUE_1 (0x00000000U)
18
19 /*******************************************************************************************************************//**
20 * Converts byte data to bit data. This function returns upper 3 digits.
21 ***********************************************************************************************************************/
r_sce_byte_to_bit_convert_upper(const uint64_t bytes)22 static inline uint32_t r_sce_byte_to_bit_convert_upper (const uint64_t bytes)
23 {
24 return (uint32_t) (bytes >> 29);
25 }
26
27 /*******************************************************************************************************************//**
28 * Converts byte data to bit data. This function returns lower 32 digits.
29 ***********************************************************************************************************************/
r_sce_byte_to_bit_convert_lower(const uint64_t bytes)30 static inline uint32_t r_sce_byte_to_bit_convert_lower (const uint64_t bytes)
31 {
32 return (uint32_t) (bytes << 3);
33 }
34
35 fsp_err_t HW_SCE_SHA256_UpdateHash(const uint32_t * p_source, uint32_t num_words, uint32_t * p_digest);
36 extern fsp_err_t HW_SCE_Sha224256GenerateMessageDigestSub(const uint32_t * InData_InitVal,
37 const uint32_t * InData_PaddedMsg,
38 const uint32_t MAX_CNT,
39 uint32_t * OutData_MsgDigest);
40 extern fsp_err_t HW_SCE_ShaGenerateMessageDigestSub(const uint32_t InData_HashType[],
41 const uint32_t InData_Cmd[],
42 const uint32_t InData_Msg[],
43 const uint32_t InData_MsgLen[],
44 const uint32_t InData_State[],
45 uint32_t OutData_MsgDigest[],
46 uint32_t OutData_State[],
47 const uint32_t MAX_CNT);
48
49 #endif /* HW_SCE_HASH_PRIVATE_H */
50