1 /***************************************************************************//**
2 * \file cy_crypto_core_crc_v2.h
3 * \version 2.90
4 *
5 * \brief
6 *  This file provides the headers for CRC API
7 *  in the Crypto driver.
8 *
9 ********************************************************************************
10 * \copyright
11 * Copyright (c) (2020-2022), Cypress Semiconductor Corporation (an Infineon company) or
12 * an affiliate of Cypress Semiconductor Corporation.
13 * SPDX-License-Identifier: Apache-2.0
14 *
15 * Licensed under the Apache License, Version 2.0 (the "License");
16 * you may not use this file except in compliance with the License.
17 * You may obtain a copy of the License at
18 *
19 *    http://www.apache.org/licenses/LICENSE-2.0
20 *
21 * Unless required by applicable law or agreed to in writing, software
22 * distributed under the License is distributed on an "AS IS" BASIS,
23 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24 * See the License for the specific language governing permissions and
25 * limitations under the License.
26 *******************************************************************************/
27 
28 
29 #if !defined (CY_CRYPTO_CORE_CRC_V2_H)
30 #define CY_CRYPTO_CORE_CRC_V2_H
31 
32 #include "cy_crypto_common.h"
33 
34 #if defined(CY_IP_MXCRYPTO) && defined(CY_CRYPTO_CFG_HW_V2_ENABLE)
35 
36 #if defined(__cplusplus)
37 extern "C" {
38 #endif
39 
40 #if (CPUSS_CRYPTO_CRC == 1) && defined(CY_CRYPTO_CFG_CRC_C)
41 
42 cy_en_crypto_status_t Cy_Crypto_Core_V2_Crc_Init(CRYPTO_Type *base,
43                                         uint32_t polynomial,
44                                         uint32_t dataReverse,
45                                         uint32_t dataXor,
46                                         uint32_t remReverse,
47                                         uint32_t remXor);
48 
49 cy_en_crypto_status_t Cy_Crypto_Core_V2_Crc(CRYPTO_Type *base,
50                                         uint32_t *crc,
51                                         void      const *data,
52                                         uint32_t  dataSize,
53                                         uint32_t  lfsrInitState);
54 
55 /* The new partial calculation interface. */
56 cy_en_crypto_status_t Cy_Crypto_Core_V2_Crc_CalcInit(CRYPTO_Type *base,
57                                         uint32_t width,
58                                         uint32_t polynomial,
59                                         uint32_t dataReverse,
60                                         uint32_t dataXor,
61                                         uint32_t remReverse,
62                                         uint32_t remXor,
63                                         uint32_t lfsrInitState);
64 
65 cy_en_crypto_status_t Cy_Crypto_Core_V2_Crc_CalcStart(CRYPTO_Type *base, uint32_t width, uint32_t  lfsrInitState);
66 
67 cy_en_crypto_status_t Cy_Crypto_Core_V2_Crc_CalcPartial(CRYPTO_Type *base, void const *data, uint32_t  dataSize);
68 
69 cy_en_crypto_status_t Cy_Crypto_Core_V2_Crc_CalcFinish(CRYPTO_Type *base, uint32_t width, uint32_t *crc);
70 
71 cy_en_crypto_status_t Cy_Crypto_Core_V2_Crc_Calc(CRYPTO_Type *base,
72                                         uint32_t  width,
73                                         uint32_t *crc,
74                                         void      const *data,
75                                         uint32_t  dataSize);
76 
77 #endif /* (CPUSS_CRYPTO_CRC == 1) && defined(CY_CRYPTO_CFG_CRC_C) */
78 
79 #if defined(__cplusplus)
80 }
81 #endif
82 
83 #endif /* defined(CY_IP_MXCRYPTO) && defined(CY_CRYPTO_CFG_HW_V2_ENABLE) */
84 
85 #endif /* #if !defined (CY_CRYPTO_CORE_CRC_V2_H) */
86 
87 
88 /* [] END OF FILE */
89