Hello everyone,
may someone help me with checking a signature using crypto++.
My situation:
1. A mesage is signed externally using an ATECC108 chip (K283 curve).
2. The public key is available as 2 byte atrrays (36 byte X and 36 byte Y component).
3. Initializing a public key in crypto++ throws an error on validating the public key "CryptoMaterial: this object contains invalid values"
i´m using this code to check a signature
PolynomialMod2 X(pubKey, 36);
PolynomialMod2 Y(&pubKey[36], 36);
EC2N::Point D(X, Y);
ECDSA<EC2N, SHA256>::PublicKey pKey;
pKey.Initialize(oid, D);
result = pKey.Validate( prng, 3);
if( !result )
{
cout << "Validation of public key failed !!!" << endl;
}
StringSource sss(signature+message, true,
new SignatureVerificationFilter(
ECDSA<EC2N,SHA256>::Verifier(pKey),
new ArraySink( (byte*)&result, sizeof(result) )
) // SignatureVerificationFilter
);
if( !result )
{
cout << "Signature check failed !!!" << endl;
}
else
{
cout << "Signature check succeed !!!" << endl;
}
Using the crypto++ library to sign and to check works fine, but initializing and using a public key goes wrong.
Can anyone help?
BR
Robert