Skip to content

Latest commit

 

History

History
53 lines (34 loc) · 1.03 KB

GUID-38C5F7B8-909B-418E-8F1F-DC67D9042248.md

File metadata and controls

53 lines (34 loc) · 1.03 KB

CRYPT_ECC_SignatureSizeGet Function

Parent topic:MPLAB® Harmony Crypto Library

C

int CRYPT_ECC_SignatureSizeGet(
    CRYPT_ECC_CTX* ecc
);

Description

This function returns the size of the signature in a given context, in octets.

Preconditions

The ECC context must have been initialized with a call to CRYPT_ECC_Initialize. The keys must have been imported or created prior to calling this function.

Parameters

Parameters Description
ecc Pointer to context which saves state between calls, and contains the signature.

Returns

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

  • int - The size of the signature.

Remarks

None.

Example

CRYPT_ECC_CTX userA; 
int           ret;
byte          sig[100];
unsigned int  sigSz = (unsigned int)sizeof(sig);
unsigned int  usedA = 0;

ret = CRYPT_ECC_Initialize(&userA);
...
// Import or generate private key
...
ret = CRYPT_ECC_SignatureSizeGet(&userA);