1 /*
2  * Copyright (c) 2001-2019, Arm Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 
8 /*!
9  @addtogroup hash_ext_dma
10  @{
11  */
12 
13 /*!
14  @file
15  @brief This file contains all the CryptoCell hash external DMA APIs, their
16  enums and definitions.
17  */
18 
19 #ifndef _MBEDTLS_HASH_EXT_DMA_H
20 #define _MBEDTLS_HASH_EXT_DMA_H
21 
22 #include "cc_pal_types.h"
23 #include "cc_hash_defs.h"
24 
25 
26 #ifdef __cplusplus
27 extern "C"
28 {
29 #endif
30 
31 /*!
32  @brief This function initializes the External DMA Control.
33 
34  It configures the hash mode, the initial hash value, and other configurations.
35 
36  @return \c CC_OK on success.
37  @return A non-zero value on failure.
38  */
39 int mbedtls_hash_ext_dma_init(
40     /*! [in] The hash mode. Supported modes are: SHA1, SHA224 or SHA256. */
41     CCHashOperationMode_t  operationMode,
42     /*! [in] Input data size in bytes. */
43     uint32_t                dataSize
44     );
45 
46 /*!
47   @brief This function returns the digest after the hash operation, and frees
48   used resources.
49 
50   @return \c CC_OK on success.
51   @return A non-zero value on failure.
52  */
53 int mbedtls_hash_ext_dma_finish(
54     /*! [in] The hash mode. Supported modes are: SHA1, SHA224 or SHA256. */
55     CCHashOperationMode_t  operationMode,
56     /*! [in] The size of the hash digest in bytes. */
57     uint32_t digestBufferSize,
58     /*! [out] The output digest buffer. */
59     uint32_t *digestBuffer
60     );
61 
62 #ifdef __cplusplus
63 }
64 #endif
65 
66 /*!
67  @}
68  */
69 #endif /* #ifndef MBEDTLS_HASH_EXT_DMA_H_ */
70