Can you perform basic EC operations in Java 7 without a third-party library?

Java 7 comes with SunEC , which provides ECDH and ECDSA operations. I tried to perform basic EC operations (point addition, scalar multiplication).

I start with

ECParameterSpec p256 = NamedCurve.getECParameterSpec("secp256r1"); ECPoint generator = p256.getGenerator(); BigInteger scalar = new BigInteger("23"); 

But from there I do not see the next step. No ECPoint.scalarMultiply() or ECPoint.add() or EllipticCurve.multiply() .

Am I missing something, or the answer is simply "you can't do it without a third-party library?"

+4
source share
1 answer

You cannot do this directly without a third-party library. I think that the situation with elliptic curves in JCE is basically similar to the situation with RSA. Classes represent instances of various keys and encodings. You can switch between encodings and key parameters using KeyFactory, you can create public and private keys using KeyPairGenerator, etc. But just as there is no RSAPublicKey.exponentiate (), there is also no ECPoint.add (). These things happen under the hood in the Signature, KeyAgreement, and Cipher classes.

+2
source

All Articles