Hello!
your public key seems to be a public point in non-compressed format
(you just have to add 04 in the front of the pubkey data)
unsigned char public_exponent[49] = {
0x04,
0xD9, 0xEB, 0x8C, 0x03, 0x56, 0xA8, 0xDE, 0x27, 0x06, 0xF8, 0x3A,
0x4D, 0x14, 0xE0, 0xD7, 0xAF,
0xFD, 0x65, 0x1E, 0xAE, 0x3B, 0x72, 0x30, 0xDB, 0x45, 0x63, 0x3E,
0x0E, 0x67, 0xCE, 0x16, 0xC7,
0x7E, 0xF5, 0x2F, 0xF4, 0xCD, 0x10, 0x7A, 0x66, 0x5B, 0x48, 0xB3,
0x3A, 0x7E, 0xAA, 0x57, 0x87
};
to initialize the public key you can use the following code:
CryptoPP::ECIES< CryptoPP::ECP >::PublicKey PublicKey;
PublicKey.AccessGroupParameters().Initialize
(ECC_CryptoPP::ASN1::secp192r1());
PublicKey.GetGroupParameters().GetCurve().DecodePoint(p,
public_exponent,
PublicKey.GetGroupParameters().GetCurve().EncodedPointSize
(false));
PublicKey.SetPublicElement(p);
and then you can validate the public key using
bool PublicKeyLoaded = PublicKey.Validate(rng, 3);
On Dec 17, 5:55 pm, maig <[email protected]> wrote:
> Hello,
>
> I have a signature that was generated from a device using ECC,
> secp192r1()
>
> This is a example of parameters I get from the device.
>
> Public key 192 bit:
> "D9EB8C0356A8DE2706F83A4D14E0D7AFFD651EAE3B7230DB45633E0E67CE16C77EF52FF4CD107A665B48B33A7EAA5787"
> Signature 192 bit:
> "ED408F6D6A25FFC622EB2623E8AC38E88813CCB8F20FE961C9E6537BEF432ACC84B05E79686824221ED5506C50D55BD0"
> Data stream 96 bit: "000F9302009600932D3608003F00088C38C004E4C0000008"
>
> I have no idea how to set the public key in Crypto++.
> CryptoPP::ECIES< CryptoPP::ECP >::PublicKey PublicKey;
>
> I found many code examples how to create a public key from a private
> key, to sign a data stream and verify it again.
> But no example which only verify with a public key and a signature.
>
> Thanks for any help.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the "Crypto++ Users"
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at
http://www.cryptopp.com.
-~----------~----~----~----~------~----~------~--~---