Mistake on this page?
Report an issue in GitHub or email us
crys_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 POLY APIs, as well as the APIs themselves.
40 @defgroup crys_poly CryptoCell POLY APIs
41 @{
42 @ingroup cryptocell_api
43 
44 */
45 #ifndef CRYS_POLY_H
46 #define CRYS_POLY_H
47 
48 
49 #include "ssi_pal_types.h"
50 #include "crys_error.h"
51 
52 
53 #ifdef __cplusplus
54 extern "C"
55 {
56 #endif
57 
58 /************************ Defines ******************************/
59 /*! POLY KEY size in words. */
60 #define CRYS_POLY_KEY_SIZE_IN_WORDS 8
61 /*! POLY KEY size in bytes. */
62 #define CRYS_POLY_KEY_SIZE_IN_BYTES (CRYS_POLY_KEY_SIZE_IN_WORDS*SASI_32BIT_WORD_SIZE)
63 
64 /*! POLY MAC size in words. */
65 #define CRYS_POLY_MAC_SIZE_IN_WORDS 4
66 /*! POLY MAC size in bytes. */
67 #define CRYS_POLY_MAC_SIZE_IN_BYTES (CRYS_POLY_MAC_SIZE_IN_WORDS*SASI_32BIT_WORD_SIZE)
68 
69 /************************ Typedefs ****************************/
70 
71 /*! CHACHA MAC buffer definition. */
73 
74 /*! CHACHA key buffer definition. */
76 
77 /************************ Public Functions **********************/
78 
79 /****************************************************************************************************/
80 /*!
81 @brief This function is used to perform the POLY MAC Calculation.
82 
83 @return CRYS_OK on success.
84 @return A non-zero value on failure as defined crys_poly_error.h.
85 */
86 CIMPORT_C CRYSError_t CRYS_POLY(
87  CRYS_POLY_Key_t pKey, /*!< [in] A pointer to the user's key buffer. */
88  uint8_t *pDataIn, /*!< [in] A pointer to the buffer of the input data to the CHACHA.
89  must not be null. */
90  size_t dataInSize, /*!< [in] The size of the input data. must not be 0. */
91  CRYS_POLY_Mac_t macRes /*!< [in/out] Pointer to the MAC result buffer.*/
92 );
93 
94 
95 
96 #ifdef __cplusplus
97 }
98 #endif
99 /**
100 @}
101  */
102 #endif /* #ifndef CRYS_POLY_H */
103 
104 
105 
106 
107 
CRYSError_t CRYS_POLY(CRYS_POLY_Key_t pKey, uint8_t *pDataIn, size_t dataInSize, CRYS_POLY_Mac_t macRes)
This function is used to perform the POLY MAC Calculation.
#define CRYS_POLY_KEY_SIZE_IN_WORDS
Definition: crys_poly.h:60
uint32_t CRYSError_t
Definition: crys_error.h:253
This file contains the platform dependent definitions and types.
uint32_t CRYS_POLY_Key_t[8]
Definition: crys_poly.h:75
uint32_t CRYS_POLY_Mac_t[4]
Definition: crys_poly.h:72
#define CRYS_POLY_MAC_SIZE_IN_WORDS
Definition: crys_poly.h:65
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.