Parent topic:MPLAB® Harmony Crypto Library
int CRYPT_ECC_DHE_KeyMake(
CRYPT_ECC_CTX* ecc,
CRYPT_RNG_CTX* rng,
int keySz
);
This function creates a new ECC key.
The context must have been initialized with a call to CRYPT_ECC_Initialize. The random number generator context must have been initialized with a call to CRYPT_RNG_Initialize.
Parameters | Description |
---|---|
ecc | Pointer to context which saves state between calls. |
rng | Pointer to the context for the random number generator. |
keySz | The size of the key desired. |
-
BAD_FUNC_ARG - An invalid pointer was passed to the function.
-
MEMORY_E - Could not create the memory buffer for the key.
-
0 - An invalid pointer was not passed to the function.
None.
CRYPT_ECC_CTX userA;
int ret;
byte sharedA[100];
unsigned int aSz = (unsigned int)sizeof(sharedA);
unsigned int usedA = 0;
ret = CRYPT_ECC_Initialize(&userA);
ret = CRYPT_ECC_DHE_KeyMake(&userA, &mcRng, 32);