Re: Public Key Extraction in Implicit Certificates (ECQV)

biscas <[email protected]> Wed, 17 Jul 2019 05:51:39 -0500 (CDT)
Newsgroups gmane.comp.encryption.bouncy-castle.devel
Message-ID <[email protected]>
Hi Peter,

Regarding Point 3, we have made the suggested test, that is:

int dummy_hash(unsigned char *digest, unsigned long int sz, unsigned char
*dat){
    memset(digest,0,16);
    return 0;
}

ZSE_ECQVReconstructPublicKey(u_certificate,ca_PublicKey,u_recoveredPublicKey1,dummy_hash,
yield, YIELD_LEVEL);

If CA_Public_Key is a Public Key generated via BouncyCastle, for instance:

BC_CA_PUBLIC_KEY:
03:03:8B:06:D2:86:55:52:31:3C:0A:13:E6:2B:22:F4:48:DE:CB:D1:E1:77
RECOVERED_KEY:
03:06:79:D1:85:B2:E5:9F:F1:94:1C:07:FA:DE:E1:80:4A:32:9D:A4:97:11
RECOVERED KEY is different from the BC_CA_PUBLIC_KEY AND BouncyCastle deems
it to be invalid.

CERTICOM_CA_PUBLIC_KEY:
02:00:FD:E8:A7:F3:D1:08:42:24:96:2A:4E:7C:54:E6:9A:C3:F0:4D:A6:B8
RECOVERED_KEY:
02:00:FD:E8:A7:F3:D1:08:42:24:96:2A:4E:7C:54:E6:9A:C3:F0:4D:A6:B8

If on the other side, CERTICOM_CA_PUBLIC_KEY is used as input, output
matches input. Moreover the CERTICOM_CA_PUBLIC_KEY is a valid one according
to BouncyCastle. This at least explains why the developed BC Verifier is
able to verify signatures from certificates emitted by Certicom.




--
Sent from: http://bouncy-castle.1462172.n4.nabble.com/Bouncy-Castle-Dev-f1462173.html