Mistake on this page?
Report an issue in GitHub or email us
crys_chacha_poly.h
Go to the documentation of this file.
1 /**************************************************************************************
2 * Copyright (c) 2016-2017, ARM Limited or its affiliates. All rights reserved *
3 * *
4 * This file and the related binary are licensed under the following license: *
5 * *
6 * ARM Object Code and Header Files License, v1.0 Redistribution. *
7 * *
8 * Redistribution and use of object code, header files, and documentation, without *
9 * modification, are permitted provided that the following conditions are met: *
10 * *
11 * 1) Redistributions must reproduce the above copyright notice and the *
12 * following disclaimer in the documentation and/or other materials *
13 * provided with the distribution. *
14 * *
15 * 2) Unless to the extent explicitly permitted by law, no reverse *
16 * engineering, decompilation, or disassembly of is permitted. *
17 * *
18 * 3) Redistribution and use is permitted solely for the purpose of *
19 * developing or executing applications that are targeted for use *
20 * on an ARM-based product. *
21 * *
22 * DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND *
23 * CONTRIBUTORS "AS IS." ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT *
24 * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, NON-INFRINGEMENT, *
25 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *
26 * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED *
28 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
29 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
30 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
31 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
33 **************************************************************************************/
34 
35 
36 /*!
37 @file
38 @brief This file contains all of the enums and definitions that are used for the
39  CRYS CHACHA-POLY APIs, as well as the APIs themselves.
40 @defgroup crys_chacha_poly CryptoCell CHACHA-POLY APIs
41 @{
42 @ingroup cryptocell_api
43 */
44 #ifndef CRYS_CHACHA_POLY_H
45 #define CRYS_CHACHA_POLY_H
46 
47 
48 #include "ssi_pal_types.h"
49 #include "crys_error.h"
50 #include "crys_chacha.h"
51 #include "crys_poly.h"
52 
53 
54 #ifdef __cplusplus
55 extern "C"
56 {
57 #endif
58 
59 
60 /*!
61 @brief This function is used to perform the CHACHA-POLY encryption and authentication operation.
62 
63 @return CRYS_OK on success.
64 @return A non-zero value on failure as defined crys_chacha_poly_error.h.
65 */
67  CRYS_CHACHA_Nonce_t pNonce, /*!< [in] A pointer to a buffer containing the nonce value. */
68  CRYS_CHACHA_Key_t pKey, /*!< [in] A pointer to the user's key buffer. */
69  CRYS_CHACHA_EncryptMode_t encryptDecryptFlag, /*!< [in] A flag specifying whether the CHACHA-POLY should perform an Encrypt or
70  Decrypt operation. */
71  uint8_t *pAddData, /*!< [in] A pointer to the buffer of the additional data to the POLY.
72  The pointer does not need to be aligned. must not be null. */
73  size_t addDataSize, /*!< [in] The size of the input data. must not be 0. */
74  uint8_t *pDataIn, /*!< [in] A pointer to the buffer of the input data to the CHACHA.
75  The pointer does not need to be aligned. must not be null. */
76  size_t dataInSize, /*!< [in] The size of the input data. must not be 0. */
77  uint8_t *pDataOut, /*!< [out] A pointer to the buffer of the output data from the CHACHA.
78  must not be null. */
79  CRYS_POLY_Mac_t macRes /*!< [in/out] Pointer to the MAC result buffer.*/
80 );
81 
82 
83 
84 #ifdef __cplusplus
85 }
86 #endif
87 /**
88 @}
89  */
90 #endif /* #ifndef CRYS_CHACHA_POLY_H */
91 
92 
93 
94 
95 
CRYSError_t CRYS_CHACHA_POLY(CRYS_CHACHA_Nonce_t pNonce, CRYS_CHACHA_Key_t pKey, CRYS_CHACHA_EncryptMode_t encryptDecryptFlag, uint8_t *pAddData, size_t addDataSize, uint8_t *pDataIn, size_t dataInSize, uint8_t *pDataOut, CRYS_POLY_Mac_t macRes)
This function is used to perform the CHACHA-POLY encryption and authentication operation.
This file contains all of the enums and definitions that are used for the CRYS POLY APIs...
uint8_t CRYS_CHACHA_Nonce_t[(3 *sizeof(uint32_t))]
Definition: crys_chacha.h:108
CRYS_CHACHA_EncryptMode_t
Definition: crys_chacha.h:79
uint32_t CRYSError_t
Definition: crys_error.h:253
This file contains all of the enums and definitions that are used for the CRYS CHACHA APIs...
This file contains the platform dependent definitions and types.
uint8_t CRYS_CHACHA_Key_t[(8 *sizeof(uint32_t))]
Definition: crys_chacha.h:111
uint32_t CRYS_POLY_Mac_t[4]
Definition: crys_poly.h:72
This module defines the error return code types and the numbering spaces of the error codes for each ...
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.