Hi Dgarske,

I have fixed the problem using wc_ecc_rs_to_sig() and wc_ecc_import_raw(). As you suggested, the problem was that my r and s values were stored in an array (like char r[] = {0x01, 0x23, 0x45, 0x67}) instead of char r[] = "01234567". Now everything is working. Thank you for your help.

Regards,
Majkel

Hi,
I have following problem with ecc signature veryfication. I have two parts of public key: x and y, message digest and ecc signature in two parts: r and s. I want to use wc_ecc_verify_hash to check if the signature is valid.

From what I read from documentation, first I should use function wc_ecc_import_raw(ecc_key* key, const char* qx, const char* qy, const char* d, const char* curveName) to initialise ecc_key structure. Here I see first problem - I don't have private key (parameter d). Can I put there some random value since private key is not needed for signature veryfication?

Second problem is that wc_ecc_verify_hash takes signature as one argument but I have it stored int two parts (r,s).
Should I use wc_ecc_rs_to_sig to convert them into  DER-encoded signature or is there some other way to do it?

Sorry if these questions seems basic, but I'm new to both ecc and wolfcrpyt and I don't understand yet how exactly it works.

Kind regards
Majkel