Skip to content

Latest commit

 

History

History
51 lines (34 loc) · 1.05 KB

GUID-1A6D1067-4F9C-4CD2-95AC-4E7FF5634811.md

File metadata and controls

51 lines (34 loc) · 1.05 KB

CRYPT_ECC_PrivateImport Function

Parent topic:MPLAB® Harmony Crypto Library

C

int CRYPT_ECC_PrivateImport(
    CRYPT_ECC_CTX* ecc, 
    const unsigned char* priv, 
    unsigned int privSz, 
    const unsigned char* pub, 
    unsigned int pubSz
);

Description

This function imports a public/private key pair in X9.63 format.

Preconditions

The context must have been initialized with a call to CRYPT_ECC_Initialize.

Parameters

Parameters Description
ecc Pointer to context which saves state between calls.
priv Pointer to the private key.
privSz Size of the private key, in bytes.
pub Pointer to the public key.
pubSz Size of the public key, in bytes.

Returns

  • BAD_FUNC_ARG - An invalid pointer was passed to the function.

  • 0 - An invalid pointer was not passed to the function.

Example

CRYPT_ECC_CTX ecc;

CRYPT_ECC_Initialize(&ecc);
...
CRYPT_ECC_PrivateImport(&ecc, priv_key, sizeof(priv_key), pub_key, sizeof(pub_key));