ECJPAKE.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-2020, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 /*!****************************************************************************
33  * @file ECJPAKE.h
34  *
35  * @brief TI Driver for Elliptic Curve Password Authenticated Key Exchange
36  * by Juggling.
37  *
38  * @anchor ti_drivers_ECJPAKE_Overview
39  * # Overview #
40  * Elliptic Curve Password Authenticated Key Exchange by Juggling (EC-JPAKE)
41  * is a key agreement scheme that establishes a secure channel over an insecure
42  * network. It only requires sharing a password offline and does not require
43  * public key infrastructure or trusted third parties such as certificate
44  * authorities.
45  *
46  * At the end of the EC-JPAKE scheme, both parties derive a shared secret
47  * from which a session key is derived.
48  *
49  * The scheme is symmetric. Both parties perform the exact same operations
50  * to end up with the shared secret.
51  *
52  * # Steps involved #
53  * Since the scheme is symmetric, the steps involved will be illustrated
54  * using Alice and Bob as relevant parties.
55  *
56  * -# Alice and Bob decide on some pre-shared secret, the password, and
57  * negotiate this through some offline means such as during commissioning.
58  *
59  * -# Alice generates private keys x1, x2, v1, and v2 uniformly at random from [1, n - 1],
60  * where n is the order of the curve.
61  * -# Alice generates public keys X1 = x1 * G, X2 = x2 * G, V1 = v1 * G, and V2 = v2 * G.
62  * -# Alice generates Zero-Knowledge Proofs (ZKPs) for (X1, x1) and (X2, x2).
63  * The required hash is computed by concatenating G, V, the public key
64  * the ZKP authenticates, and the UserID of the authenticator and hashing
65  * the new bitstring. The exact order and formatting of all parameters and
66  * any extra information such as length words must be agreed upon by both
67  * parties to yield the same result.
68  * -# Alice sends X1, X2, V1, V2, r1, r2, and her UserID to Bob.
69  *
70  * -# Bob generates private keys x3, x4, v3, and v4 uniformly at random from [1, n - 1],
71  * where n is the order of the curve.
72  * -# Bob generates public keys X3 = x3 * G, X4 = x4 * G, V3 = v3 * G, and V4 = v4 * G.
73  * -# Bob generates Zero-Knowledge Proofs (ZKPs) for (X3, x3) and (X4, x4).
74  * -# Bob sends X3, X4, V3, V4, r3, r4, and his UserID to Bob.
75  *
76  * -# Alice and Bob verify the other parties ZKPs and break off the scheme if they
77  * do not check out.
78  *
79  * -# Alice computes the new generator point G2 = (X1 + X3 + X4).
80  * -# Alice computes the combined private key x5 = x2 * s, where s is the pre-shared
81  * secret.
82  * -# Alice computes the combined public key X5 = x5 * G2.
83  * -# Alice computes a ZKP for (X5, x5) using G2 as the generator point of the ZKP.
84  * -# Alice sends X5, V5, r5, and her UserID to Bob.
85  *
86  * -# Bob computes the new generator point G3 = (X3 + X1 + X2).
87  * -# Bob computes the combined private key x6 = x4 * s, where s is the pre-shared
88  * secret.
89  * -# Bob computes the combined public key X6 = x6 * G3.
90  * -# Bob computes a ZKP for (X6, x6) using G3 as the generator point of the ZKP.
91  * -# Bob sends X6, V6, r6, and his UserID to Alice.
92  *
93  * -# Alice and Bob verify the other parties ZKPs and break off the scheme if they
94  * do not check out. This involves computing the other parties generator point.
95  *
96  * -# Alice computes shared secret K = (X6 - (X4 * x5)) * x2.
97  *
98  * -# Bob computes shared secret K = (X5 - (X2 * x6)) * x4.
99  *
100  * -# Alice and Bob each run K through a mutually agreed upon key derivation
101  * function to compute the symmetric session key.
102  *
103  * @anchor ti_drivers_ECJPAKE_Usage
104  * # Usage #
105  *
106  * ## Before starting an ECJPAKE operation #
107  *
108  * Before starting an ECJPAKE operation, the application must do the following:
109  * -# Call ECJPAKE_init() to initialize the driver
110  * -# Call ECJPAKE_Params_init() to initialize the ECJPAKE_Params to default values.
111  * -# Modify the ECJPAKE_Params as desired
112  * -# Call ECJPAKE_open() to open an instance of the driver
113  *
114  * ## Round one #
115  * -# Initialize the following private key CryptoKeys.
116  * Seed them with keying material uniformly drawn from [1, n - 1]
117  * - myPrivateKey1
118  * - myPrivateKey2
119  * - myPrivateV1
120  * - myPrivateV2
121  * -# Initialize the following blank public key CryptoKeys:
122  * - myPublicKey1
123  * - myPublicKey2
124  * - myPublicV1
125  * - myPublicV2
126  * - theirPublicKey1
127  * - theirPublicKey2
128  * - theirPublicV1
129  * - theirPublicV2
130  * -# Call ECJPAKE_roundOneGenerateKeys() to generate all round one keys as needed.
131  * -# Generate the hashes for the ZKPs using previously agreed upon formatting.
132  * Use the default generator point of the curve in the first round.
133  * -# Generate your two ZKPs by calling ECJPAKE_generateZKP() once per ZKP.
134  * -# Exchange public keys, UserIDs, and ZKP signatures. Write the received keying
135  * material into the relevant buffers or load them into key stores as specified
136  * by the CryptoKeys initialised earlier.
137  * -# Verify the other party's ZKPs after computing their ZKP hash by calling
138  * ECJPAKE_verifyZKP() once per ZKP.
139  * -# You can now let all V keys, myPrivateKey1, and all ZKP signatures go out of scope
140  * and re-use their memory.
141  *
142  * ## Round two #
143  * -# Initialize the following private key CryptoKeys.
144  * Seed myPrivateV with keying material uniformly drawn from [1, n - 1].
145  * Initialise the preSharedSecret with the common keying material previously
146  * shared between you and the other party.
147  * - preSharedSecret
148  * - myCombinedPrivateKey
149  * -# Initialize the following blank public key CryptoKeys:
150  * - theirNewGenerator
151  * - myNewGenerator
152  * - myCombinedPublicKey
153  * - myPublicV
154  * -# Call ECJPAKE_roundTwoGenerateKeys() to generate the remaining round two keys.
155  * -# Generate the hash for your ZKP use myNewGenerator as your generator point.
156  * -# Exchange public keys, UserIDs, and ZKP signatures. Write the received keying
157  * material into the relevant buffers or load them into key stores as specified
158  * by the CryptoKeys initialised earlier.
159  * -# Verify the other party's ZKP after computing their ZKP hash b calling
160  * ECJPAKE_verifyZKP(). Use theirNewGenerator as the generator point for this
161  * ZKP.
162  * -# You can now let all keys and keying material but myCombinedPrivateKey,
163  * theirCombinedPublicKey, theirPublicKey2, and myPrivateKey2 go out of scope.
164  *
165  * ## Computing the shared secret #
166  * -# Initialize the following blank public key CryptoKey:
167  * - sharedSecret
168  * -# Call ECJPAKE_computeSharedSecret().
169  * -# Run sharedSecret through a key derivation function to compute the shared
170  * symmetric session key.
171  *
172  * ## Key Formatting
173  * The ECJPAKE API expects the private and public keys to be formatted in octet
174  * string format. The details of octet string formatting can be found in
175  * SEC 1: Elliptic Curve Cryptography.
176  *
177  * Private keys and V's are formatted as big-endian integers of the same length
178  * as the curve length.
179  *
180  * Public keys, public V's, generator points, and shared secrets are points on
181  * an elliptic curve. These points can be expressed in several ways.
182  * This API uses points expressed in uncompressed affine coordinates by default.
183  * The octet string format requires a formatting byte in the first byte of the
184  * public key. When using uncompressed affine coordinates, this is the value
185  * 0x04.
186  * The point itself is stored as a concatenated array of X followed by Y.
187  * X and Y are big-endian. Some implementations do not require or yield
188  * the Y coordinate for ECJPAKE on certain curves. It is recommended that the full
189  * keying material buffer of twice the curve param length is used to facilitate
190  * code-reuse. Implementations that do not use the Y coordinate will zero-out
191  * the Y-coordinate whenever they write a point to the CryptoKey.
192  *
193  * This API accepts and returns the keying material of public keys according
194  * to the following table:
195  *
196  * | Curve Type | Keying Material Array | Array Length |
197  * |--------------------|-----------------------|----------------------------|
198  * | Short Weierstrass | [0x04, X, Y] | 1 + 2 * Curve Param Length |
199  * | Montgomery | [0x04, X, Y] | 1 + 2 * Curve Param Length |
200  * | Edwards | [0x04, X, Y] | 1 + 2 * Curve Param Length |
201  *
202  * The r component of the ZKP signature, hash, and preSharedSecret also all
203  * use the octet string format. They are interpreted as big-endian integers.
204  *
205  * @anchor ti_drivers_ECJPAKE_Synopsis
206  * ## Synopsis
207  *
208  * @anchor ti_drivers_ECJPAKE_Synopsis_Code
209  * @code
210  * // Import ECJPAKE Driver definitions
211  * #include <ti/drivers/ECJPAKE.h>
212  *
213  * ECJPAKE_init();
214  *
215  * // Since we are using default ECJPAKE_Params, we just pass in NULL for that parameter.
216  * ecjpakeHandle = ECJPAKE_open(0, NULL);
217 
218  * ECJPAKE_Handle handle = ECJPAKE_open(0, &params);
219  *
220  * ECJPAKE_OperationRoundOneGenerateKeys operationRoundOneGenerateKeys;
221  * ECJPAKE_OperationRoundTwoGenerateKeys operationRoundTwoGenerateKeys;
222  * ECJPAKE_OperationGenerateZKP operationGenerateZKP;
223  * ECJPAKE_OperationVerifyZKP operationVerifyZKP;
224  * ECJPAKE_OperationComputeSharedSecret operationComputeSharedSecret;
225  *
226  * // Generate my round one keys
227  * ECJPAKE_OperationRoundOneGenerateKeys_init(&operationRoundOneGenerateKeys);
228  * operationRoundOneGenerateKeys.curve = &ECCParams_NISTP256;
229  * operationRoundOneGenerateKeys.myPrivateKey1 = &myPrivateCryptoKey1;
230  * operationRoundOneGenerateKeys.myPrivateKey2 = &myPrivateCryptoKey2;
231  * operationRoundOneGenerateKeys.myPublicKey1 = &myPublicCryptoKey1;
232  * operationRoundOneGenerateKeys.myPublicKey2 = &myPublicCryptoKey2;
233  * operationRoundOneGenerateKeys.myPrivateV1 = &myPrivateCryptoV1;
234  * operationRoundOneGenerateKeys.myPrivateV2 = &myPrivateCryptoV2;
235  * operationRoundOneGenerateKeys.myPublicV1 = &myPublicCryptoV1;
236  * operationRoundOneGenerateKeys.myPublicV2 = &myPublicCryptoV2;
237  *
238  * result = ECJPAKE_roundOneGenerateKeys(handle, &operationRoundOneGenerateKeys);
239  *
240  * // Generate hashes here
241  *
242  * // generate my round one ZKPs
243  * ECJPAKE_OperationGenerateZKP_init(&operationGenerateZKP);
244  * operationGenerateZKP.curve = &ECCParams_NISTP256;
245  * operationGenerateZKP.myPrivateKey = &myPrivateCryptoKey1;
246  * operationGenerateZKP.myPrivateV = &myPrivateCryptoV1;
247  * operationGenerateZKP.hash = myHash1;
248  * operationGenerateZKP.r = myR1;
249  *
250  * result = ECJPAKE_generateZKP(handle, &operationGenerateZKP);
251  *
252  * ECJPAKE_OperationGenerateZKP_init(&operationGenerateZKP);
253  * operationGenerateZKP.curve = &ECCParams_NISTP256;
254  * operationGenerateZKP.myPrivateKey = &myPrivateCryptoKey2;
255  * operationGenerateZKP.myPrivateV = &myPrivateCryptoV2;
256  * operationGenerateZKP.hash = myHash2;
257  * operationGenerateZKP.r = myR2;
258  *
259  * result = ECJPAKE_generateZKP(handle, &operationGenerateZKP);
260  *
261  * // Do ZKP and key transmission here
262  *
263  * // Verify their round one ZKPs
264  * // Generate their hashes here
265  *
266  * ECJPAKE_OperationVerifyZKP_init(&operationVerifyZKP);
267  * operationVerifyZKP.curve = &ECCParams_NISTP256;
268  * operationVerifyZKP.theirGenerator = NULL;
269  * operationVerifyZKP.theirPublicKey = &theirPublicCryptoKey1;
270  * operationVerifyZKP.theirPublicV = &theirPublicCryptoV1;
271  * operationVerifyZKP.hash = theirHash1;
272  * operationVerifyZKP.r = theirR1;
273  *
274  * result = ECJPAKE_verifyZKP(handle, &operationVerifyZKP);
275  *
276  * ECJPAKE_OperationVerifyZKP_init(&operationVerifyZKP);
277  * operationVerifyZKP.curve = &ECCParams_NISTP256;
278  * operationVerifyZKP.theirGenerator = NULL;
279  * operationVerifyZKP.theirPublicKey = &theirPublicCryptoKey2;
280  * operationVerifyZKP.theirPublicV = &theirPublicCryptoV2;
281  * operationVerifyZKP.hash = theirHash2;
282  * operationVerifyZKP.r = theirR2;
283  *
284  * result = ECJPAKE_verifyZKP(handle,&operationVerifyZKP);
285  *
286  * // Round two starts now
287  *
288  * // Generate my round two keys
289  * ECJPAKE_OperationRoundTwoGenerateKeys_init(&operationRoundTwoGenerateKeys);
290  * operationRoundTwoGenerateKeys.curve = &ECCParams_NISTP256;
291  * operationRoundTwoGenerateKeys.myPrivateKey2 = &myPrivateCryptoKey2;
292  * operationRoundTwoGenerateKeys.myPublicKey1 = &myPublicCryptoKey1;
293  * operationRoundTwoGenerateKeys.myPublicKey2 = &myPublicCryptoKey2;
294  * operationRoundTwoGenerateKeys.theirPublicKey1 = &theirPublicCryptoKey1;
295  * operationRoundTwoGenerateKeys.theirPublicKey2 = &theirPublicCryptoKey2;
296  * operationRoundTwoGenerateKeys.preSharedSecret = &preSharedSecretCryptoKey;
297  * operationRoundTwoGenerateKeys.theirNewGenerator = &theirGeneratorKey;
298  * operationRoundTwoGenerateKeys.myNewGenerator = &myGeneratorKey;
299  * operationRoundTwoGenerateKeys.myCombinedPrivateKey = &myCombinedPrivateKey;
300  * operationRoundTwoGenerateKeys.myCombinedPublicKey = &myCombinedPublicKey;
301  * operationRoundTwoGenerateKeys.myPrivateV = &myPrivateCryptoV3;
302  * operationRoundTwoGenerateKeys.myPublicV = &myPublicCryptoV3;
303  *
304  * result = ECJPAKE_roundTwoGenerateKeys(handle, &operationRoundTwoGenerateKeys);
305  *
306  * // Generate my round two ZKP
307  * // Generate the round two hash here
308  *
309  * ECJPAKE_OperationGenerateZKP_init(&operationGenerateZKP);
310  * operationGenerateZKP.curve = &ECCParams_NISTP256;
311  * operationGenerateZKP.myPrivateKey = &myCombinedPrivateKey;
312  * operationGenerateZKP.myPrivateV = &myPrivateCryptoV3;
313  * operationGenerateZKP.hash = myHash3;
314  * operationGenerateZKP.r = myR3;
315  *
316  * result = ECJPAKE_generateZKP(handle, &operationGenerateZKP);
317  *
318  * // Exchange keys and ZKPs again
319  *
320  * // Verify their second round ZKP
321  * // Generate their round two hash here
322  *
323  * ECJPAKE_OperationVerifyZKP_init(&operationVerifyZKP);
324  * operationVerifyZKP.curve = &ECCParams_NISTP256;
325  * operationVerifyZKP.theirGenerator = &theirGeneratorKey;
326  * operationVerifyZKP.theirPublicKey = &theirCombinedPublicKey;
327  * operationVerifyZKP.theirPublicV = &theirPublicCryptoV3;
328  * operationVerifyZKP.hash = theirHash3;
329  * operationVerifyZKP.r = theirR3;
330  *
331  * result = ECJPAKE_verifyZKP(handle, &operationVerifyZKP);
332  *
333  * // Generate shared secret
334  * ECJPAKE_OperationComputeSharedSecret_init(&operationComputeSharedSecret);
335  * operationComputeSharedSecret.curve = &ECCParams_NISTP256;
336  * operationComputeSharedSecret.myCombinedPrivateKey = &myCombinedPrivateKey;
337  * operationComputeSharedSecret.theirCombinedPublicKey = &theirCombinedPublicKey;
338  * operationComputeSharedSecret.theirPublicKey2 = &theirPublicCryptoKey2;
339  * operationComputeSharedSecret.myPrivateKey2 = &myPrivateCryptoKey2;
340  * operationComputeSharedSecret.sharedSecret = &sharedSecretCryptoKey;
341  *
342  * result = ECJPAKE_computeSharedSecret(handle, &operationComputeSharedSecret);
343  *
344  * // Close the driver
345  * ECJPAKE_close(handle);
346  * @endcode
347  *
348  * @anchor ti_drivers_ECJPAKE_Examples
349  * # Examples #
350  *
351  * ## Basic ECJPAKE exchange #
352  *
353  * @code
354  *
355  * #define NISTP256_CURVE_LENGTH_BYTES 32
356  * #define OCTET_STRING_OFFSET 1
357  * #define NISTP256_PRIVATE_KEY_LENGTH_BYTES NISTP256_CURVE_LENGTH_BYTES
358  * #define NISTP256_PUBLIC_KEY_LENGTH_BYTES (NISTP256_CURVE_LENGTH_BYTES * 2 + OCTET_STRING_OFFSET)
359  *
360  * // My fixed keying material
361  * uint8_t myPrivateKeyMaterial1[NISTP256_PRIVATE_KEY_LENGTH_BYTES];
362  * uint8_t myPrivateKeyMaterial2[NISTP256_PRIVATE_KEY_LENGTH_BYTES];
363  * uint8_t myPrivateVMaterial1[NISTP256_PRIVATE_KEY_LENGTH_BYTES];
364  * uint8_t myPrivateVMaterial2[NISTP256_PRIVATE_KEY_LENGTH_BYTES];
365  * uint8_t myPrivateVMaterial3[NISTP256_PRIVATE_KEY_LENGTH_BYTES];
366  * uint8_t myHash1[NISTP256_PRIVATE_KEY_LENGTH_BYTES];
367  * uint8_t myHash2[NISTP256_PRIVATE_KEY_LENGTH_BYTES];
368  * uint8_t myHash3[NISTP256_PRIVATE_KEY_LENGTH_BYTES];
369  * // My derived keying material
370  * uint8_t myR1[NISTP256_PRIVATE_KEY_LENGTH_BYTES];
371  * uint8_t myR2[NISTP256_PRIVATE_KEY_LENGTH_BYTES];
372  * uint8_t myR3[NISTP256_PRIVATE_KEY_LENGTH_BYTES];
373  * uint8_t myPublicKeyMaterial1[NISTP256_PUBLIC_KEY_LENGTH_BYTES];
374  * uint8_t myPublicKeyMaterial2[NISTP256_PUBLIC_KEY_LENGTH_BYTES];
375  * uint8_t myPublicVMaterial1[NISTP256_PUBLIC_KEY_LENGTH_BYTES];
376  * uint8_t myPublicVMaterial2[NISTP256_PUBLIC_KEY_LENGTH_BYTES];
377  * uint8_t myPublicVMaterial3[NISTP256_PUBLIC_KEY_LENGTH_BYTES];
378  * uint8_t myCombinedPublicKeyMaterial1[NISTP256_PUBLIC_KEY_LENGTH_BYTES];
379  * uint8_t myCombinedPrivateKeyMaterial1[NISTP256_PRIVATE_KEY_LENGTH_BYTES];
380  * uint8_t myGenerator[NISTP256_PUBLIC_KEY_LENGTH_BYTES];
381  *
382  * // Their fixed keying material
383  * uint8_t theirHash1[NISTP256_PRIVATE_KEY_LENGTH_BYTES];
384  * uint8_t theirHash2[NISTP256_PRIVATE_KEY_LENGTH_BYTES];
385  * uint8_t theirHash3[NISTP256_PRIVATE_KEY_LENGTH_BYTES];
386  *
387  * // Their derived keying material
388  * uint8_t theirR1[NISTP256_PRIVATE_KEY_LENGTH_BYTES];
389  * uint8_t theirR2[NISTP256_PRIVATE_KEY_LENGTH_BYTES];
390  * uint8_t theirR3[NISTP256_PRIVATE_KEY_LENGTH_BYTES];
391  * uint8_t theirPublicKeyMaterial1[NISTP256_PUBLIC_KEY_LENGTH_BYTES];
392  * uint8_t theirPublicKeyMaterial2[NISTP256_PUBLIC_KEY_LENGTH_BYTES];
393  * uint8_t theirPublicVMaterial1[NISTP256_PUBLIC_KEY_LENGTH_BYTES];
394  * uint8_t theirPublicVMaterial2[NISTP256_PUBLIC_KEY_LENGTH_BYTES];
395  * uint8_t theirPublicVMaterial3[NISTP256_PUBLIC_KEY_LENGTH_BYTES];
396  * uint8_t theirCombinedPublicKeyMaterial1[NISTP256_PUBLIC_KEY_LENGTH_BYTES];
397  * uint8_t theirGenerator[NISTP256_PUBLIC_KEY_LENGTH_BYTES];
398  *
399  * // Shared secrets
400  * uint8_t preSharedSecretKeyingMaterial[NISTP256_PRIVATE_KEY_LENGTH_BYTES] = "This is our password";
401  * uint8_t sharedSecretKeyingMaterial1[NISTP256_PUBLIC_KEY_LENGTH_BYTES];
402  *
403  * // Pre-Shared Secret Key
404  * CryptoKey preSharedSecretCryptoKey;
405  *
406  * // Final shared secret keys
407  * CryptoKey sharedSecretCryptoKey;
408  *
409  * // My's keys
410  * CryptoKey myPrivateCryptoKey1;
411  * CryptoKey myPrivateCryptoKey2;
412  * CryptoKey myPrivateCryptoV1;
413  * CryptoKey myPrivateCryptoV2;
414  * CryptoKey myPrivateCryptoV3;
415  * CryptoKey myCombinedPrivateKey;
416  *
417  * CryptoKey myPublicCryptoKey1;
418  * CryptoKey myPublicCryptoKey2;
419  * CryptoKey myPublicCryptoV1;
420  * CryptoKey myPublicCryptoV2;
421  * CryptoKey myPublicCryptoV3;
422  * CryptoKey myCombinedPublicKey;
423  * CryptoKey myGeneratorKey;
424  *
425  * // Their's Keys
426  * CryptoKey theirPublicCryptoKey1;
427  * CryptoKey theirPublicCryptoKey2;
428  * CryptoKey theirPublicCryptoV1;
429  * CryptoKey theirPublicCryptoV2;
430  * CryptoKey theirPublicCryptoV3;
431  * CryptoKey theirCombinedPublicKey;
432  * CryptoKey theirGeneratorKey;
433  *
434  * // NISTP256 generator
435  * CryptoKeyPlaintext_initKey(NULL, ECCParams_NISTP256.generatorX, sizeof(ECCParams_NISTP256.length * 2));
436  *
437  * // Pre-shared secret
438  * CryptoKeyPlaintext_initKey(&preSharedSecretCryptoKey, preSharedSecretKeyingMaterial,
439  sizeof(preSharedSecretKeyingMaterial));
440  *
441  * // Final shared secret key
442  * CryptoKeyPlaintext_initKey(&sharedSecretCryptoKey, sharedSecretKeyingMaterial1, sizeof(sharedSecretKeyingMaterial1));
443  * CryptoKeyPlaintext_initKey(&sharedSecretCryptoKey2, sharedSecretKeyingMaterial2,
444  sizeof(sharedSecretKeyingMaterial2));
445  *
446  *
447  * // My keys
448  *
449  * // This example assumes that the private keying material buffers already
450  * // contains random bytes. Otherwise, we need to use a TRNG or DRBG to fill
451  * // them after initialising the CryptoKeys.
452  * CryptoKeyPlaintext_initKey(&myPrivateCryptoKey1, myPrivateKeyMaterial1, sizeof(myPrivateKeyMaterial1));
453  * CryptoKeyPlaintext_initKey(&myPrivateCryptoKey2, myPrivateKeyMaterial2, sizeof(myPrivateKeyMaterial2));
454  * CryptoKeyPlaintext_initKey(&myPrivateCryptoV1, myPrivateVMaterial1, sizeof(myPrivateVMaterial1));
455  * CryptoKeyPlaintext_initKey(&myPrivateCryptoV2, myPrivateVMaterial2, sizeof(myPrivateVMaterial2));
456  * CryptoKeyPlaintext_initKey(&myPrivateCryptoV3, myPrivateVMaterial3, sizeof(myPrivateVMaterial3));
457  *
458  * CryptoKeyPlaintext_initBlankKey(&myPublicCryptoKey1, myPublicKeyMaterial1, sizeof(myPublicKeyMaterial1));
459  * CryptoKeyPlaintext_initBlankKey(&myPublicCryptoKey2, myPublicKeyMaterial2, sizeof(myPublicKeyMaterial2));
460  * CryptoKeyPlaintext_initBlankKey(&myPublicCryptoV1, myPublicVMaterial1, sizeof(myPublicVMaterial1));
461  * CryptoKeyPlaintext_initBlankKey(&myPublicCryptoV2, myPublicVMaterial2, sizeof(myPublicVMaterial2));
462  * CryptoKeyPlaintext_initBlankKey(&myPublicCryptoV3, myPublicVMaterial3, sizeof(myPublicVMaterial3));
463  * CryptoKeyPlaintext_initBlankKey(&myCombinedPrivateKey, myCombinedPrivateKeyMaterial1,
464  sizeof(myCombinedPrivateKeyMaterial1));
465  * CryptoKeyPlaintext_initBlankKey(&myCombinedPublicKey, myCombinedPublicKeyMaterial1,
466  sizeof(myCombinedPublicKeyMaterial1));
467  * CryptoKeyPlaintext_initBlankKey(&myGeneratorKey, myGenerator, sizeof(myGenerator));
468  *
469  * // Their keys
470  * CryptoKeyPlaintext_initBlankKey(&theirPublicCryptoKey1, theirPublicKeyMaterial1, sizeof(theirPublicKeyMaterial1));
471  * CryptoKeyPlaintext_initBlankKey(&theirPublicCryptoKey2, theirPublicKeyMaterial2, sizeof(theirPublicKeyMaterial2));
472  * CryptoKeyPlaintext_initBlankKey(&theirPublicCryptoV1, theirPublicVMaterial1, sizeof(theirPublicVMaterial1));
473  * CryptoKeyPlaintext_initBlankKey(&theirPublicCryptoV2, theirPublicVMaterial2, sizeof(theirPublicVMaterial2));
474  * CryptoKeyPlaintext_initBlankKey(&theirPublicCryptoV3, theirPublicVMaterial3, sizeof(theirPublicVMaterial3));
475  * CryptoKeyPlaintext_initBlankKey(&theirCombinedPublicKey, theirCombinedPublicKeyMaterial1,
476  sizeof(theirCombinedPublicKeyMaterial1));
477  * CryptoKeyPlaintext_initBlankKey(&theirGeneratorKey, theirGenerator, sizeof(theirGenerator));
478  *
479  * // Initial driver setup
480  * ECJPAKE_Params params;
481  * ECJPAKE_Params_init(&params);
482  *
483  *
484  * ECJPAKE_Handle handle = ECJPAKE_open(0, &params);
485  *
486  * ECJPAKE_OperationRoundOneGenerateKeys operationRoundOneGenerateKeys;
487  * ECJPAKE_OperationRoundTwoGenerateKeys operationRoundTwoGenerateKeys;
488  * ECJPAKE_OperationGenerateZKP operationGenerateZKP;
489  * ECJPAKE_OperationVerifyZKP operationVerifyZKP;
490  * ECJPAKE_OperationComputeSharedSecret operationComputeSharedSecret;
491  *
492  * // Generate my round one keys
493  * ECJPAKE_OperationRoundOneGenerateKeys_init(&operationRoundOneGenerateKeys);
494  * operationRoundOneGenerateKeys.curve = &ECCParams_NISTP256;
495  * operationRoundOneGenerateKeys.myPrivateKey1 = &myPrivateCryptoKey1;
496  * operationRoundOneGenerateKeys.myPrivateKey2 = &myPrivateCryptoKey2;
497  * operationRoundOneGenerateKeys.myPublicKey1 = &myPublicCryptoKey1;
498  * operationRoundOneGenerateKeys.myPublicKey2 = &myPublicCryptoKey2;
499  * operationRoundOneGenerateKeys.myPrivateV1 = &myPrivateCryptoV1;
500  * operationRoundOneGenerateKeys.myPrivateV2 = &myPrivateCryptoV2;
501  * operationRoundOneGenerateKeys.myPublicV1 = &myPublicCryptoV1;
502  * operationRoundOneGenerateKeys.myPublicV2 = &myPublicCryptoV2;
503  *
504  * int_fast16_t result = ECJPAKE_roundOneGenerateKeys(handle, &operationRoundOneGenerateKeys);
505  *
506  * if (result != ECJPAKE_STATUS_SUCCESS) {
507  * while(1);
508  * }
509  *
510  * // Generate hashes here
511  *
512  * // generate my round one ZKPs
513  * ECJPAKE_OperationGenerateZKP_init(&operationGenerateZKP);
514  * operationGenerateZKP.curve = &ECCParams_NISTP256;
515  * operationGenerateZKP.myPrivateKey = &myPrivateCryptoKey1;
516  * operationGenerateZKP.myPrivateV = &myPrivateCryptoV1;
517  * operationGenerateZKP.hash = myHash1;
518  * operationGenerateZKP.r = myR1;
519  *
520  * result = ECJPAKE_generateZKP(handle, &operationGenerateZKP);
521  *
522  * if (result != ECJPAKE_STATUS_SUCCESS) {
523  * while(1);
524  * }
525  *
526  * ECJPAKE_OperationGenerateZKP_init(&operationGenerateZKP);
527  * operationGenerateZKP.curve = &ECCParams_NISTP256;
528  * operationGenerateZKP.myPrivateKey = &myPrivateCryptoKey2;
529  * operationGenerateZKP.myPrivateV = &myPrivateCryptoV2;
530  * operationGenerateZKP.hash = myHash2;
531  * operationGenerateZKP.r = myR2;
532  *
533  * result = ECJPAKE_generateZKP(handle, &operationGenerateZKP);
534  *
535  * if (result != ECJPAKE_STATUS_SUCCESS) {
536  * while(1);
537  * }
538  *
539  * // Do ZKP and key transmission here
540  *
541  * // Verify their round one ZKPs
542  * // Generate their hashes here
543  *
544  * ECJPAKE_OperationVerifyZKP_init(&operationVerifyZKP);
545  * operationVerifyZKP.curve = &ECCParams_NISTP256;
546  * operationVerifyZKP.theirGenerator = NULL;
547  * operationVerifyZKP.theirPublicKey = &theirPublicCryptoKey1;
548  * operationVerifyZKP.theirPublicV = &theirPublicCryptoV1;
549  * operationVerifyZKP.hash = theirHash1;
550  * operationVerifyZKP.r = theirR1;
551  *
552  * result = ECJPAKE_verifyZKP(handle, &operationVerifyZKP);
553  *
554  * if (result != ECJPAKE_STATUS_SUCCESS) {
555  * while(1);
556  * }
557  *
558  * ECJPAKE_OperationVerifyZKP_init(&operationVerifyZKP);
559  * operationVerifyZKP.curve = &ECCParams_NISTP256;
560  * operationVerifyZKP.theirGenerator = NULL;
561  * operationVerifyZKP.theirPublicKey = &theirPublicCryptoKey2;
562  * operationVerifyZKP.theirPublicV = &theirPublicCryptoV2;
563  * operationVerifyZKP.hash = theirHash2;
564  * operationVerifyZKP.r = theirR2;
565  *
566  * result = ECJPAKE_verifyZKP(handle,&operationVerifyZKP);
567  *
568  * if (result != ECJPAKE_STATUS_SUCCESS) {
569  * while(1);
570  * }
571  *
572  * // Round two starts now
573  *
574  * // Generate my round two keys
575  * ECJPAKE_OperationRoundTwoGenerateKeys_init(&operationRoundTwoGenerateKeys);
576  * operationRoundTwoGenerateKeys.curve = &ECCParams_NISTP256;
577  * operationRoundTwoGenerateKeys.myPrivateKey2 = &myPrivateCryptoKey2;
578  * operationRoundTwoGenerateKeys.myPublicKey1 = &myPublicCryptoKey1;
579  * operationRoundTwoGenerateKeys.myPublicKey2 = &myPublicCryptoKey2;
580  * operationRoundTwoGenerateKeys.theirPublicKey1 = &theirPublicCryptoKey1;
581  * operationRoundTwoGenerateKeys.theirPublicKey2 = &theirPublicCryptoKey2;
582  * operationRoundTwoGenerateKeys.preSharedSecret = &preSharedSecretCryptoKey;
583  * operationRoundTwoGenerateKeys.theirNewGenerator = &theirGeneratorKey;
584  * operationRoundTwoGenerateKeys.myNewGenerator = &myGeneratorKey;
585  * operationRoundTwoGenerateKeys.myCombinedPrivateKey = &myCombinedPrivateKey;
586  * operationRoundTwoGenerateKeys.myCombinedPublicKey = &myCombinedPublicKey;
587  * operationRoundTwoGenerateKeys.myPrivateV = &myPrivateCryptoV3;
588  * operationRoundTwoGenerateKeys.myPublicV = &myPublicCryptoV3;
589  *
590  * result = ECJPAKE_roundTwoGenerateKeys(handle, &operationRoundTwoGenerateKeys);
591  *
592  * // Generate my round two ZKP
593  * // Generate the round two hash here
594  *
595  * ECJPAKE_OperationGenerateZKP_init(&operationGenerateZKP);
596  * operationGenerateZKP.curve = &ECCParams_NISTP256;
597  * operationGenerateZKP.myPrivateKey = &myCombinedPrivateKey;
598  * operationGenerateZKP.myPrivateV = &myPrivateCryptoV3;
599  * operationGenerateZKP.hash = myHash3;
600  * operationGenerateZKP.r = myR3;
601  *
602  * result = ECJPAKE_generateZKP(handle, &operationGenerateZKP);
603  *
604  * if (result != ECJPAKE_STATUS_SUCCESS) {
605  * while(1);
606  * }
607  *
608  * // Exchange keys and ZKPs again
609  *
610  * // Verify their second round ZKP
611  * // Generate their round two hash here
612  *
613  * ECJPAKE_OperationVerifyZKP_init(&operationVerifyZKP);
614  * operationVerifyZKP.curve = &ECCParams_NISTP256;
615  * operationVerifyZKP.theirGenerator = &theirGeneratorKey;
616  * operationVerifyZKP.theirPublicKey = &theirCombinedPublicKey;
617  * operationVerifyZKP.theirPublicV = &theirPublicCryptoV3;
618  * operationVerifyZKP.hash = theirHash3;
619  * operationVerifyZKP.r = theirR3;
620  *
621  * result = ECJPAKE_verifyZKP(handle, &operationVerifyZKP);
622  *
623  * if (result != ECJPAKE_STATUS_SUCCESS) {
624  * while(1);
625  * }
626  *
627  *
628  * // Generate shared secret
629  * ECJPAKE_OperationComputeSharedSecret_init(&operationComputeSharedSecret);
630  * operationComputeSharedSecret.curve = &ECCParams_NISTP256;
631  * operationComputeSharedSecret.myCombinedPrivateKey = &myCombinedPrivateKey;
632  * operationComputeSharedSecret.theirCombinedPublicKey = &theirCombinedPublicKey;
633  * operationComputeSharedSecret.theirPublicKey2 = &theirPublicCryptoKey2;
634  * operationComputeSharedSecret.myPrivateKey2 = &myPrivateCryptoKey2;
635  * operationComputeSharedSecret.sharedSecret = &sharedSecretCryptoKey;
636  *
637  * result = ECJPAKE_computeSharedSecret(handle, &operationComputeSharedSecret);
638  *
639  * if (result != ECJPAKE_STATUS_SUCCESS) {
640  * while(1);
641  * }
642  *
643  * // Run sharedSecretCryptoKey through a key derivation function and
644  * // confirm to the other party that we have derived the same key
645  *
646  *
647  * @endcode
648  *
649  *
650  */
651 
652 #ifndef ti_drivers_ECJPAKE__include
653 #define ti_drivers_ECJPAKE__include
654 
655 #include <stdbool.h>
656 #include <stddef.h>
657 #include <stdint.h>
658 
661 
662 #ifdef __cplusplus
663 extern "C" {
664 #endif
665 
678 #define ECJPAKE_STATUS_RESERVED (-32)
679 
686 #define ECJPAKE_STATUS_SUCCESS (0)
687 
694 #define ECJPAKE_STATUS_ERROR (-1)
695 
704 #define ECJPAKE_STATUS_RESOURCE_UNAVAILABLE (-2)
705 
711 #define ECJPAKE_STATUS_INVALID_PUBLIC_KEY (-3)
712 
719 #define ECJPAKE_STATUS_PUBLIC_KEY_NOT_ON_CURVE (-4)
720 
728 #define ECJPAKE_STATUS_PUBLIC_KEY_LARGER_THAN_PRIME (-5)
729 
736 #define ECJPAKE_STATUS_POINT_AT_INFINITY (-6)
737 
744 #define ECJPAKE_STATUS_INVALID_PRIVATE_KEY (-7)
745 
752 #define ECJPAKE_STATUS_INVALID_PRIVATE_V (-8)
753 
757 #define ECJPAKE_STATUS_CANCELED (-9)
758 
770 typedef struct
771 {
773  void *object;
774 
776  void const *hwAttrs;
778 
783 
805 typedef enum
806 {
822 
826 typedef struct
827 {
882 
886 typedef struct
887 {
900  const uint8_t *hash;
904  uint8_t *r;
908 
912 typedef struct
913 {
933  const uint8_t *hash;
936  const uint8_t *r;
940 
944 typedef struct
945 {
1013 
1017 typedef struct
1018 {
1042 
1046 typedef union
1047 {
1057 
1061 typedef enum
1062 {
1069 
1088 typedef void (*ECJPAKE_CallbackFxn)(ECJPAKE_Handle handle,
1089  int_fast16_t returnStatus,
1090  ECJPAKE_Operation operation,
1091  ECJPAKE_OperationType operationType);
1092 
1101 typedef struct
1102 {
1105  uint32_t timeout;
1108  void *custom;
1111 } ECJPAKE_Params;
1112 
1121 void ECJPAKE_init(void);
1122 
1132 
1142 
1152 
1162 
1172 
1182 void ECJPAKE_close(ECJPAKE_Handle handle);
1183 
1201 ECJPAKE_Handle ECJPAKE_open(uint_least8_t index, ECJPAKE_Params *params);
1202 
1216 
1242 int_fast16_t ECJPAKE_roundOneGenerateKeys(ECJPAKE_Handle handle, ECJPAKE_OperationRoundOneGenerateKeys *operation);
1243 
1276 int_fast16_t ECJPAKE_generateZKP(ECJPAKE_Handle handle, ECJPAKE_OperationGenerateZKP *operation);
1277 
1304 int_fast16_t ECJPAKE_verifyZKP(ECJPAKE_Handle handle, ECJPAKE_OperationVerifyZKP *operation);
1305 
1329 int_fast16_t ECJPAKE_roundTwoGenerateKeys(ECJPAKE_Handle handle, ECJPAKE_OperationRoundTwoGenerateKeys *operation);
1330 
1356 int_fast16_t ECJPAKE_computeSharedSecret(ECJPAKE_Handle handle, ECJPAKE_OperationComputeSharedSecret *operation);
1357 
1371 int_fast16_t ECJPAKE_cancelOperation(ECJPAKE_Handle handle);
1372 
1396 ECJPAKE_Handle ECJPAKE_construct(ECJPAKE_Config *config, const ECJPAKE_Params *params);
1397 
1398 #ifdef __cplusplus
1399 }
1400 #endif
1401 
1402 #endif /* ti_drivers_ECJPAKE__include */
Struct containing the parameters required to generate a ZKP.
Definition: ECJPAKE.h:886
const CryptoKey * myPrivateKey2
Definition: ECJPAKE.h:949
ADC_Params params
Definition: Driver_Init.h:11
CryptoKey * myPublicKey2
Definition: ECJPAKE.h:844
The CryptoKey type is an opaque representation of a cryptographic key.
const uint8_t * hash
Definition: ECJPAKE.h:900
CryptoKey * myPrivateKey1
Definition: ECJPAKE.h:831
int_fast16_t ECJPAKE_computeSharedSecret(ECJPAKE_Handle handle, ECJPAKE_OperationComputeSharedSecret *operation)
Computes the shared secret.
ECJPAKE_OperationType
Enum for the operation types supported by the driver.
Definition: ECJPAKE.h:1061
CryptoKey * myPublicV2
Definition: ECJPAKE.h:872
void * object
Definition: ECJPAKE.h:773
void ECJPAKE_OperationVerifyZKP_init(ECJPAKE_OperationVerifyZKP *operation)
Function to initialize an ECJPAKE_OperationVerifyZKP struct to its defaults.
const ECCParams_CurveParams * curve
Definition: ECJPAKE.h:914
const CryptoKey * myCombinedPrivateKey
Definition: ECJPAKE.h:1022
const ECCParams_CurveParams * curve
Definition: ECJPAKE.h:828
ECJPAKE_ReturnBehavior returnBehavior
Definition: ECJPAKE.h:1103
void ECJPAKE_close(ECJPAKE_Handle handle)
Function to close an ECJPAKE peripheral specified by the ECJPAKE handle.
ECJPAKE_OperationComputeSharedSecret * computeSharedSecret
Definition: ECJPAKE.h:1054
const CryptoKey * theirGenerator
Definition: ECJPAKE.h:917
const ECCParams_CurveParams * curve
Definition: ECJPAKE.h:946
void ECJPAKE_OperationRoundOneGenerateKeys_init(ECJPAKE_OperationRoundOneGenerateKeys *operation)
Function to initialize an ECJPAKE_OperationRoundOneGenerateKeys struct to its defaults.
ECJPAKE_OperationRoundOneGenerateKeys * generateRoundOneKeys
Definition: ECJPAKE.h:1048
int_fast16_t ECJPAKE_roundTwoGenerateKeys(ECJPAKE_Handle handle, ECJPAKE_OperationRoundTwoGenerateKeys *operation)
Generates all public and private keying material for the first round of the EC-JPAKE scheme...
const CryptoKey * theirCombinedPublicKey
Definition: ECJPAKE.h:1026
void ECJPAKE_OperationRoundTwoGenerateKeys_init(ECJPAKE_OperationRoundTwoGenerateKeys *operation)
Function to initialize an ECJPAKE_OperationRoundTwoGenerateKeys struct to its defaults.
int_fast16_t ECJPAKE_cancelOperation(ECJPAKE_Handle handle)
Cancels an ongoing ECJPAKE operation.
CryptoKey datastructure.
Definition: CryptoKey.h:192
Struct containing the parameters required to generate the second round keys.
Definition: ECJPAKE.h:944
Struct containing the parameters required to compute the shared secret.
Definition: ECJPAKE.h:1017
void(* ECJPAKE_CallbackFxn)(ECJPAKE_Handle handle, int_fast16_t returnStatus, ECJPAKE_Operation operation, ECJPAKE_OperationType operationType)
The definition of a callback function used by the ECJPAKE driver when used in ECJPAKE_RETURN_BEHAVIOR...
Definition: ECJPAKE.h:1088
int_fast16_t ECJPAKE_verifyZKP(ECJPAKE_Handle handle, ECJPAKE_OperationVerifyZKP *operation)
Verifies a Schnorr Zero-Knowledge Proof (ZKP) signature.
void ECJPAKE_init(void)
This function initializes the ECJPAKE module.
void * custom
Definition: ECJPAKE.h:1108
CryptoKey * myPublicV1
Definition: ECJPAKE.h:863
const CryptoKey * myPublicKey2
Definition: ECJPAKE.h:956
const CryptoKey * myPublicKey1
Definition: ECJPAKE.h:953
const CryptoKey * myPrivateKey
Definition: ECJPAKE.h:891
ECJPAKE Parameters.
Definition: ECJPAKE.h:1101
CryptoKey * myCombinedPublicKey
Definition: ECJPAKE.h:993
Struct containing the parameters required to generate the first round of keys.
Definition: ECJPAKE.h:826
Definition: ECJPAKE.h:817
CryptoKey * myPrivateKey2
Definition: ECJPAKE.h:835
int_fast16_t ECJPAKE_generateZKP(ECJPAKE_Handle handle, ECJPAKE_OperationGenerateZKP *operation)
Generates the r component of a Schnorr Zero-Knowledge Proof (ZKP) signature.
ECJPAKE_CallbackFxn callbackFxn
Definition: ECJPAKE.h:1104
const ECCParams_CurveParams * curve
Definition: ECJPAKE.h:888
const CryptoKey * preSharedSecret
Definition: ECJPAKE.h:965
CryptoKey * myNewGenerator
Definition: ECJPAKE.h:981
const CryptoKey * theirPublicKey1
Definition: ECJPAKE.h:959
ECJPAKE Global configuration.
Definition: ECJPAKE.h:770
CryptoKey * myPublicKey1
Definition: ECJPAKE.h:839
ECJPAKE_Handle ECJPAKE_construct(ECJPAKE_Config *config, const ECJPAKE_Params *params)
Constructs a new ECJPAKE object.
const CryptoKey * myPrivateV
Definition: ECJPAKE.h:895
CryptoKey * theirNewGenerator
Definition: ECJPAKE.h:974
const uint8_t * r
Definition: ECJPAKE.h:936
const CryptoKey * theirPublicKey2
Definition: ECJPAKE.h:1029
void const * hwAttrs
Definition: ECJPAKE.h:776
Definition: ECJPAKE.h:1065
CryptoKey * myPrivateV
Definition: ECJPAKE.h:996
CryptoKey * myCombinedPrivateKey
Definition: ECJPAKE.h:988
Definition: ECJPAKE.h:807
const uint8_t * hash
Definition: ECJPAKE.h:933
void ECJPAKE_Params_init(ECJPAKE_Params *params)
Function to initialize the ECJPAKE_Params struct to its defaults.
const CryptoKey * theirPublicKey2
Definition: ECJPAKE.h:962
Struct containing the parameters required to verify a ZKP.
Definition: ECJPAKE.h:912
ECJPAKE_OperationRoundTwoGenerateKeys * generateRoundTwoKeys
Definition: ECJPAKE.h:1052
CryptoKey * sharedSecret
Definition: ECJPAKE.h:1038
int_fast16_t ECJPAKE_roundOneGenerateKeys(ECJPAKE_Handle handle, ECJPAKE_OperationRoundOneGenerateKeys *operation)
Generates all public and private keying material for the first round of the EC-JPAKE scheme...
Definition: ECJPAKE.h:813
const CryptoKey * myPrivateKey2
Definition: ECJPAKE.h:1034
ECJPAKE_OperationGenerateZKP * generateZKP
Definition: ECJPAKE.h:1050
Definition: ECJPAKE.h:1064
A structure containing the parameters of an elliptic curve.
Definition: ECCParams.h:140
uint32_t timeout
Definition: ECJPAKE.h:1105
ECJPAKE_ReturnBehavior
The way in which ECJPAKE function calls return after performing an encryption + authentication or dec...
Definition: ECJPAKE.h:805
CryptoKey * myPrivateV2
Definition: ECJPAKE.h:856
CryptoKey * myPrivateV1
Definition: ECJPAKE.h:849
const CryptoKey * theirPublicV
Definition: ECJPAKE.h:930
CryptoKey * myPublicV
Definition: ECJPAKE.h:1003
const CryptoKey * theirPublicKey
Definition: ECJPAKE.h:926
ECJPAKE_OperationVerifyZKP * verifyZKP
Definition: ECJPAKE.h:1051
Union containing pointers to all supported operation structs.
Definition: ECJPAKE.h:1046
ECJPAKE_Handle ECJPAKE_open(uint_least8_t index, ECJPAKE_Params *params)
This function opens a given ECJPAKE peripheral.
const ECCParams_CurveParams * curve
Definition: ECJPAKE.h:1019
ECJPAKE_Config * ECJPAKE_Handle
A handle that is returned from an ECJPAKE_open() call.
Definition: ECJPAKE.h:782
void ECJPAKE_OperationGenerateZKP_init(ECJPAKE_OperationGenerateZKP *operation)
Function to initialize an ECJPAKE_OperationGenerateZKP struct to its defaults.
uint8_t * r
Definition: ECJPAKE.h:904
void ECJPAKE_OperationComputeSharedSecret_init(ECJPAKE_OperationComputeSharedSecret *operation)
Function to initialize an ECJPAKE_OperationComputeSharedSecret struct to its defaults.
© Copyright 1995-2022, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale