ricmoo / GMEllipticCurveCrypto

Elliptic Curve Cryptography library for iOS (ECDSA and ECDH)
BSD 2-Clause "Simplified" License
122 stars 46 forks source link

PublicKey Coordinates #27

Open saravnandm opened 5 years ago

saravnandm commented 5 years ago

Hi, Is there a way to get coordinates (X and Y) of publickey like android ECPublic->ECPoint ?

If not could you add that support?

leohyman commented 4 years ago

Encounter the same problem, ask how to solve. How to transform

grishka commented 3 years ago
GMEllipticCurveCrypto* ecc = [GMEllipticCurveCrypto generateKeyPairForCurve: GMEllipticCurveSecp256r1];
ecc.compressedPublicKey = false;
NSData* pkeyX = [ecc.publicKey subdataWithRange:NSMakeRange(1, 32)];
NSData* pkeyY = [ecc.publicKey subdataWithRange:NSMakeRange(33, 32)];