'Elliptic Curve DSA in Bouncy Castle - what do h and n stand for?
I am trying to re-construct an ECPublicKey (generated by a smart card) in java with BouncyCastle.
I have this code, found from an example online:
KeyFactory keyFact = KeyFactory.getInstance("EC");
ECNamedCurveParameterSpec paramSpec = ECNamedCurveTable.getParameterSpec("secp256k1");
ECParameterSpec params = new ECNamedCurveSpec("secp256k1", paramSpec.getCurve(), paramSpec.getG(), paramSpec.getN(), paramSpec.getH());
ECPublicKey ecPublicKey = (ECPublicKey) keyFact.generatePublic(new ECPublicKeySpec(w, params));
(w is an ECPoint made of the x and y values I have from the smartcard)
What are n and h? Are they the cofactor and order of the cofactor of g, or something else?
Is there anymore values I need to get from the card to re-construct the key?
Solution 1:[1]
N is de order of G and h is the cofactor
id recommend looking at this
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | alberto sansegundo |
