List of usage examples for org.bouncycastle.math.ec ECPoint.Fp normalize
public ECPoint normalize()
From source file:de.tsenger.animamea.ca.ChipAuthenticationECDH.java
License:Open Source License
@Override public byte[] getSharedSecret_K(PrivateKey ephskpcd, byte[] pkpicc) { ;/* w w w . j a v a 2 s .co m*/ BigInteger privKey = ((ECPrivateKey) ephskpcd).getD(); PK_PICC = byteArrayToECPoint(pkpicc, curve); ECPoint.Fp K = (Fp) PK_PICC.multiply(privKey); byte[] sharedSecret_K = bigIntToByteArray(K.normalize().getXCoord().toBigInteger()); return sharedSecret_K; }
From source file:de.tsenger.animamea.pace.PaceECDH.java
License:Open Source License
@Override public byte[] getSharedSecret_K(byte[] Y2) { ECPoint PICC_PK_Y2 = byteArrayToECPoint(Y2, curve); ECPoint.Fp K = (Fp) PICC_PK_Y2.multiply(PCD_SK_x2); return bigIntToByteArray(K.normalize().getXCoord().toBigInteger()); }