le_iks_aesCmac_common.h

Go to the documentation of this file.
1 
2 /*
3  * ====================== WARNING ======================
4  *
5  * THE CONTENTS OF THIS FILE HAVE BEEN AUTO-GENERATED.
6  * DO NOT MODIFY IN ANY WAY.
7  *
8  * ====================== WARNING ======================
9  */
10 /**
11  * @file le_iks_aesCmac_common.h
12  *
13  * Type definitions for le_iks_aesCmac.
14  *
15  */
16 #ifndef LE_IKS_AESCMAC_COMMON_H_INCLUDE_GUARD
17 #define LE_IKS_AESCMAC_COMMON_H_INCLUDE_GUARD
18 
19 
20 #include "legato.h"
21 
22 // Interface specific includes
23 #include "le_iks_common.h"
24 
25 #define IFGEN_LE_IKS_AESCMAC_PROTOCOL_ID "f432403827cde3743f70700921ae0f1b"
26 #define IFGEN_LE_IKS_AESCMAC_MSG_SIZE 4116
27 /** @addtogroup le_iks_aesCmac
28  * @{ **/
29 
30 
31 //--------------------------------------------------------------------------------------------------
32 /**
33  * Tag size in bytes.
34  */
35 //--------------------------------------------------------------------------------------------------
36 #define LE_IKS_AESCMAC_MAX_TAG_SIZE 16
37 
38 
39 //--------------------------------------------------------------------------------------------------
40 /**
41  * Get if this client bound locally.
42  */
43 //--------------------------------------------------------------------------------------------------
44 LE_SHARED bool ifgen_le_iks_aesCmac_HasLocalBinding
45 (
46  void
47 );
48 
49 
50 //--------------------------------------------------------------------------------------------------
51 /**
52  * Init data that is common across all threads
53  */
54 //--------------------------------------------------------------------------------------------------
55 LE_SHARED void ifgen_le_iks_aesCmac_InitCommonData
56 (
57  void
58 );
59 
60 
61 //--------------------------------------------------------------------------------------------------
62 /**
63  * Perform common initialization and open a session
64  */
65 //--------------------------------------------------------------------------------------------------
66 LE_SHARED le_result_t ifgen_le_iks_aesCmac_OpenSession
67 (
68  le_msg_SessionRef_t _ifgen_sessionRef,
69  bool isBlocking
70 );
71 
72 //--------------------------------------------------------------------------------------------------
73 /**
74  * Process message chunks. This function may be called multiple times to process the entire
75  * message but once a message has been completely processed and le_iks_aesCmac_Done() or
76  * le_iks_aesCmac_Verify() has been called this function should not be called again with the same
77  * session.
78  *
79  * @return
80  * LE_OK if successful.
81  * LE_BAD_PARAMETER if the session reference is invalid
82  * or if the key type is invalid
83  * or if msgChunkPtr is NULL.
84  * LE_UNSUPPORTED if underlying resource does not support this operation.
85  * LE_FAULT if no more messages can be processed, ie. le_iks_aesCmac_Done() or
86  * le_iks_aesCmac_Verify() has already been called,
87  * or if there was an internal error.
88  */
89 //--------------------------------------------------------------------------------------------------
90 LE_SHARED le_result_t ifgen_le_iks_aesCmac_ProcessChunk
91 (
92  le_msg_SessionRef_t _ifgen_sessionRef,
93  uint64_t session,
94  ///< [IN] Session reference.
95  const uint8_t* msgChunkPtr,
96  ///< [IN] Message chunk.
97  ///< Must be <= MAX_PACKET_SIZE.
98  size_t msgChunkSize
99  ///< [IN]
100 );
101 
102 //--------------------------------------------------------------------------------------------------
103 /**
104  * Complete message processing and get the processed message's authentication tag.
105  *
106  * The maximum size of the authentication tag is MAX_TAG_SIZE. If the supplied buffer is
107  * smaller than the maximum tag size then the tag will be truncated. However, all tags produced
108  * using the same key must use the same tag size. It is up to the caller to ensure this.
109  *
110  * @return
111  * LE_OK if successful.
112  * LE_BAD_PARAMETER if the session reference is invalid
113  * or if the key type is invalid
114  * or if bufPtr is NULL.
115  * LE_UNSUPPORTED if underlying resource does not support this operation.
116  * LE_FAULT if no message was processed or le_iks_aesCmac_Done() or
117  * le_iks_aesCmac_Verify() has already been called,
118  * or if there was an internal error.
119  */
120 //--------------------------------------------------------------------------------------------------
121 LE_SHARED le_result_t ifgen_le_iks_aesCmac_Done
122 (
123  le_msg_SessionRef_t _ifgen_sessionRef,
124  uint64_t session,
125  ///< [IN] Session reference.
126  uint8_t* tagBufPtr,
127  ///< [OUT] Buffer to hold the authentication tag.
128  size_t* tagBufSizePtr
129  ///< [INOUT]
130 );
131 
132 //--------------------------------------------------------------------------------------------------
133 /**
134  * Complete message processing and compare the resulting authentication tag with the supplied tag.
135  *
136  * The maximum size of the authentication tag is MAX_TAG_SIZE. If the supplied tag is
137  * smaller than the maximum tag size then only the first tagSize bytes of the tag is compared.
138  * However, all tags produced using the same key must use the same tag size. It is up to the caller
139  * to ensure this.
140  *
141  * @return
142  * LE_OK if the specified tag matches the calculated message tag.
143  * LE_BAD_PARAMETER if the session reference is invalid
144  * or if the key type is invalid
145  * or if tagPtr is NULL or tagSize is zero.
146  * LE_UNSUPPORTED if underlying resource does not support this operation.
147  * LE_FAULT if the specified tag does not match the calculated message tag,
148  * or if no message was processed or le_iks_aesCmac_Done() or
149  * or le_iks_aesCmac_Verify() has already been called,
150  * or if there was an internal error.
151  */
152 //--------------------------------------------------------------------------------------------------
153 LE_SHARED le_result_t ifgen_le_iks_aesCmac_Verify
154 (
155  le_msg_SessionRef_t _ifgen_sessionRef,
156  uint64_t session,
157  ///< [IN] Session reference.
158  const uint8_t* tagBufPtr,
159  ///< [IN] Authentication tag to check against.
160  size_t tagBufSize
161  ///< [IN]
162 );
163 /** @} **/
164 #endif // LE_IKS_AESCMAC_COMMON_H_INCLUDE_GUARD
#define LE_SHARED
Definition: le_basics.h:287
le_result_t
Definition: le_basics.h:46
struct le_msg_Session * le_msg_SessionRef_t
Definition: le_messaging.h:860