Looks like there is some problem in higher-level EVP_ functions.
I completely rewrote the example using lower-level ECDSA_do_sign and it
started to work always.
Here is the code:
EVP_MD_CTX *Ctx = EVP_MD_CTX_create();
EVP_DigestInit(Ctx, EVP_sha256());
EVP_DigestUpdate(Ctx, dt.data(),
Thank you for the hint, but it looks like the problem is somewhere else
I rewrote the piece of code in such a way:
char *Result = new char [SignatureLength];
EVP_DigestSignFinal(Ctx, reinterpret_cast(Result),
);
TFile SignatureBin = {"/home/gc/signature.bin", ...};
On 16/10/2018 16:39, Dmitry wrote:
Hello!
I have a C++ programme, ECDSA key pair and some string to sign. The
programme generates signature and saves it into a file
(signature.bin). Then I check the validity of the signature via the
following command:
openssl dgst -verify ec_public.pem
Hello!
I have a C++ programme, ECDSA key pair and some string to sign. The
programme generates signature and saves it into a file (signature.bin).
Then I check the validity of the signature via the following command:
openssl dgst -verify ec_public.pem -signature signature.bin ToSign.txt
the