le_iks_aesMilenage_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_aesMilenage_common.h
12  *
13  * Type definitions for le_iks_aesMilenage.
14  *
15  */
16 #ifndef LE_IKS_AESMILENAGE_COMMON_H_INCLUDE_GUARD
17 #define LE_IKS_AESMILENAGE_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_AESMILENAGE_PROTOCOL_ID "0ae0a5645edea79c08d908d2417523ba"
26 #define IFGEN_LE_IKS_AESMILENAGE_MSG_SIZE 74
27 /** @addtogroup le_iks_aesMilenage
28  * @{ **/
29 
30 
31 //--------------------------------------------------------------------------------------------------
32 /**
33  * Key size in bytes. This refers to the subscriber key, K.
34  */
35 //--------------------------------------------------------------------------------------------------
36 #define LE_IKS_AESMILENAGE_K_SIZE 16
37 
38 //--------------------------------------------------------------------------------------------------
39 /**
40  * OPC size in bytes.
41  */
42 //--------------------------------------------------------------------------------------------------
43 #define LE_IKS_AESMILENAGE_OPC_SIZE 16
44 
45 //--------------------------------------------------------------------------------------------------
46 /**
47  * Milenage parameter sizes in bytes.
48  */
49 //--------------------------------------------------------------------------------------------------
50 #define LE_IKS_AESMILENAGE_RAND_SIZE 16
51 
52 //--------------------------------------------------------------------------------------------------
53 /**
54  */
55 //--------------------------------------------------------------------------------------------------
56 #define LE_IKS_AESMILENAGE_AMF_SIZE 2
57 
58 //--------------------------------------------------------------------------------------------------
59 /**
60  */
61 //--------------------------------------------------------------------------------------------------
62 #define LE_IKS_AESMILENAGE_SQN_SIZE 6
63 
64 //--------------------------------------------------------------------------------------------------
65 /**
66  */
67 //--------------------------------------------------------------------------------------------------
68 #define LE_IKS_AESMILENAGE_MACA_SIZE 8
69 
70 //--------------------------------------------------------------------------------------------------
71 /**
72  */
73 //--------------------------------------------------------------------------------------------------
74 #define LE_IKS_AESMILENAGE_MACS_SIZE 8
75 
76 //--------------------------------------------------------------------------------------------------
77 /**
78  */
79 //--------------------------------------------------------------------------------------------------
80 #define LE_IKS_AESMILENAGE_RES_SIZE 8
81 
82 //--------------------------------------------------------------------------------------------------
83 /**
84  */
85 //--------------------------------------------------------------------------------------------------
86 #define LE_IKS_AESMILENAGE_CK_SIZE 16
87 
88 //--------------------------------------------------------------------------------------------------
89 /**
90  */
91 //--------------------------------------------------------------------------------------------------
92 #define LE_IKS_AESMILENAGE_IK_SIZE 16
93 
94 //--------------------------------------------------------------------------------------------------
95 /**
96  */
97 //--------------------------------------------------------------------------------------------------
98 #define LE_IKS_AESMILENAGE_AK_SIZE 6
99 
100 
101 //--------------------------------------------------------------------------------------------------
102 /**
103  * Get if this client bound locally.
104  */
105 //--------------------------------------------------------------------------------------------------
106 LE_SHARED bool ifgen_le_iks_aesMilenage_HasLocalBinding
107 (
108  void
109 );
110 
111 
112 //--------------------------------------------------------------------------------------------------
113 /**
114  * Init data that is common across all threads
115  */
116 //--------------------------------------------------------------------------------------------------
117 LE_SHARED void ifgen_le_iks_aesMilenage_InitCommonData
118 (
119  void
120 );
121 
122 
123 //--------------------------------------------------------------------------------------------------
124 /**
125  * Perform common initialization and open a session
126  */
127 //--------------------------------------------------------------------------------------------------
128 LE_SHARED le_result_t ifgen_le_iks_aesMilenage_OpenSession
129 (
130  le_msg_SessionRef_t _ifgen_sessionRef,
131  bool isBlocking
132 );
133 
134 //--------------------------------------------------------------------------------------------------
135 /**
136  * Calculates the network authentication code MAC-A using the Milenage algorithm set with AES-128 as
137  * the block cipher. Implements the Milenage function f1.
138  *
139  * @return
140  * LE_OK if successful.
141  * LE_BAD_PARAMETER if either K or OPc reference is invalid
142  * or if either K or OPc key type is invalid
143  * or if either randPtr, amfPtr, sqnPtr, or macaPtr is NULL.
144  * LE_UNSUPPORTED if underlying resource does not support this operation.
145  * LE_FAULT if there was an internal error.
146  */
147 //--------------------------------------------------------------------------------------------------
148 LE_SHARED le_result_t ifgen_le_iks_aesMilenage_GetMacA
149 (
150  le_msg_SessionRef_t _ifgen_sessionRef,
151  uint64_t kRef,
152  ///< [IN] Reference to K.
153  uint64_t opcRef,
154  ///< [IN] Reference to OPc.
155  const uint8_t* randPtr,
156  ///< [IN] RAND challenge. Assumed to be RAND_SIZE bytes.
157  size_t randSize,
158  ///< [IN]
159  const uint8_t* amfPtr,
160  ///< [IN] Authentication management field, AMF.
161  ///< Assumed to be AMF_SIZE bytes.
162  size_t amfSize,
163  ///< [IN]
164  const uint8_t* sqnPtr,
165  ///< [IN] Sequence number, SQN.
166  ///< Assumed to be SQN_SIZE bytes.
167  size_t sqnSize,
168  ///< [IN]
169  uint8_t* macaPtr,
170  ///< [OUT] Buffer to hold the network authentication code.
171  ///< Assumed to be MACA_SIZE bytes.
172  size_t* macaSizePtr
173  ///< [INOUT]
174 );
175 
176 //--------------------------------------------------------------------------------------------------
177 /**
178  * Calculates the re-synchronisation authentication code MAC-S using the Milenage algorithm set with
179  * AES-128 as the block cipher. Implements the Milenage function f1*.
180  *
181  * @return
182  * LE_OK if successful.
183  * LE_BAD_PARAMETER if either K or OPc reference is invalid
184  * or if either K or OPc key type is invalid
185  * or if either randPtr, amfPtr, sqnPtr, or macsPtr is NULL.
186  * LE_UNSUPPORTED if underlying resource does not support this operation.
187  * LE_FAULT if there was an internal error.
188  */
189 //--------------------------------------------------------------------------------------------------
190 LE_SHARED le_result_t ifgen_le_iks_aesMilenage_GetMacS
191 (
192  le_msg_SessionRef_t _ifgen_sessionRef,
193  uint64_t kRef,
194  ///< [IN] Reference to K.
195  uint64_t opcRef,
196  ///< [IN] Reference to OPc.
197  const uint8_t* randPtr,
198  ///< [IN] RAND challenge. Assumed to be RAND_SIZE bytes.
199  size_t randSize,
200  ///< [IN]
201  const uint8_t* amfPtr,
202  ///< [IN] Authentication management field, AMF.
203  ///< Assumed to be AMF_SIZE bytes.
204  size_t amfSize,
205  ///< [IN]
206  const uint8_t* sqnPtr,
207  ///< [IN] Sequence number, SQN.
208  ///< Assumed to be SQN_SIZE bytes.
209  size_t sqnSize,
210  ///< [IN]
211  uint8_t* macsPtr,
212  ///< [OUT] Buffer to hold the re-sync authentication code.
213  ///< Assumed to be MACS_SIZE bytes.
214  size_t* macsSizePtr
215  ///< [INOUT]
216 );
217 
218 //--------------------------------------------------------------------------------------------------
219 /**
220  * Derives authentication response and keys using the Milenage algorithm set with AES-128 as the
221  * block cipher. Implements the Milenage functions f2, f3, f4, f5.
222  *
223  * @return
224  * LE_OK if successful.
225  * LE_BAD_PARAMETER if either K or OPc reference is invalid
226  * or if either K or OPc key type is invalid
227  * or if either randPtr, resPtr, ckPtr, ikPtr or akPtr is NULL.
228  * LE_UNSUPPORTED if underlying resource does not support this operation.
229  * LE_FAULT if there was an internal error.
230  */
231 //--------------------------------------------------------------------------------------------------
232 LE_SHARED le_result_t ifgen_le_iks_aesMilenage_GetKeys
233 (
234  le_msg_SessionRef_t _ifgen_sessionRef,
235  uint64_t kRef,
236  ///< [IN] Reference to K.
237  uint64_t opcRef,
238  ///< [IN] Reference to OPc.
239  const uint8_t* randPtr,
240  ///< [IN] RAND challenge. Assumed to be RAND_SIZE bytes.
241  size_t randSize,
242  ///< [IN]
243  uint8_t* resPtr,
244  ///< [OUT] Buffer to hold the authentication response RES.
245  ///< Assumed to be RES_SIZE bytes.
246  size_t* resSizePtr,
247  ///< [INOUT]
248  uint8_t* ckPtr,
249  ///< [OUT] Buffer to hold the confidentiality key CK.
250  ///< Assumed to be CK_SIZE bytes.
251  size_t* ckSizePtr,
252  ///< [INOUT]
253  uint8_t* ikPtr,
254  ///< [OUT] Buffer to hold the integrity key IK.
255  ///< Assumed to be IK_SIZE bytes.
256  size_t* ikSizePtr,
257  ///< [INOUT]
258  uint8_t* akPtr,
259  ///< [OUT] Buffer to hold the anonymity key AK.
260  ///< Assumed to be AK_SIZE bytes.
261  size_t* akSizePtr
262  ///< [INOUT]
263 );
264 
265 //--------------------------------------------------------------------------------------------------
266 /**
267  * Derives the anonymity key for the re-synchronisation message using the Milenage algorithm set
268  * with AES-128 as the block cipher. Implements the Milenage functions f5*.
269  *
270  * @return
271  * LE_OK if successful.
272  * LE_BAD_PARAMETER if either K or OPc reference is invalid
273  * or if either K or OPc key type is invalid
274  * or if either randPtr or akPtr is NULL.
275  * LE_UNSUPPORTED if underlying resource does not support this operation.
276  * LE_FAULT if there was an internal error.
277  */
278 //--------------------------------------------------------------------------------------------------
279 LE_SHARED le_result_t ifgen_le_iks_aesMilenage_GetAk
280 (
281  le_msg_SessionRef_t _ifgen_sessionRef,
282  uint64_t kRef,
283  ///< [IN] Reference to K.
284  uint64_t opcRef,
285  ///< [IN] Reference to OPc.
286  const uint8_t* randPtr,
287  ///< [IN] RAND challenge. Assumed to be RAND_SIZE bytes.
288  size_t randSize,
289  ///< [IN]
290  uint8_t* akPtr,
291  ///< [OUT] Buffer to hold the anonymity key AK.
292  ///< Assumed to be AK_SIZE bytes.
293  size_t* akSizePtr
294  ///< [INOUT]
295 );
296 /** @} **/
297 #endif // LE_IKS_AESMILENAGE_COMMON_H_INCLUDE_GUARD
#define LE_SHARED
Definition: le_basics.h:300
le_result_t
Definition: le_basics.h:46
struct le_msg_Session * le_msg_SessionRef_t
Definition: le_messaging.h:860