I am trying to generate an ECDSA key-pair using an external library called easy-ecc. The thing that I do not understand is this library generates a single coordinate for public key. As far as I see from books, online ECDSA generators or NIST test vectors, the public key has always two coordinates on the curve (X and Y). For example, if P-384 curve
is used, the length of the private key will be 48 bytes and the public key will have two different points X and Y, 48 bytes
each. So, in total 96 bytes
. Yet, the ecc_make_key
function does not behave as expected.
Here is the prototype of the function that creates key pairs:
int ecc_make_key(
uint8_t p_publicKey[ECC_BYTES+1],
uint8_t p_privateKey[ECC_BYTES]
);
This function fills the empty arrays with pass by reference strategy. However, why the p_publicKey
has to be ECC_BYTES+1
instead of ECC_BYTES*2
?