Topic: [SOLVED] Point to BIGNUM conversion

Hi,

Is there a feature in WolfSSL to conveniently convert an ECC point to a single BIGNUM.  A point is 3 BIGNUMs for x, y, and z coordinates in a single struct.  For comparison, OpenSSL has a EC_POINT_point2bn function that does this.  Incidentally, it also calls the EC_POINT_point2oct which I did not find equivalent for either.  This function is called in a firmware library for ECC key pair generation.  Anyone else ran into this issue?

Thanks!
-- DL

Share

Re: [SOLVED] Point to BIGNUM conversion

Hi DL,

wolfSSL doesn't currently have a conversion function for an ecc_point to OpenSSL BIGNUM or octet string formats.

Can you tell me more about the project?  Are you trying to do ECC key pair generation with wolfSSL in your firmware library?

Thanks,
Chris

Re: [SOLVED] Point to BIGNUM conversion

Yes.  I am trying to generate a new key pair and flatten the point data into a single buffer of octets in a similar way to OpenSSL.

Share

Re: [SOLVED] Point to BIGNUM conversion

Do you need to export the key pair to an OpenSSL specific format, or can you export it to a normal DER or X9.63?  We have the latter functionality in <wolfssl/wolfcrypt/ecc.h>

int wc_ecc_export_x963(ecc_key*, byte* out, word32* outLen);
int wc_ecc_export_x963_ex(ecc_key*, byte* out, word32* outLen, int compressed);
int wc_ecc_export_private_only(ecc_key* key, byte* out, word32* outLen);
int wc_ecc_export_point_der(const int curve_idx, ecc_point* point, byte* out, word32* outLen);

Best Regards,
Chris

Re: [SOLVED] Point to BIGNUM conversion

Thanks Chris!

I think

int wc_ecc_export_x963(ecc_key*, byte* out, word32* outLen);

would work in our case.

-DL

Share