public ECPoint createPoint(BigInteger x, BigInteger y) { return createPoint(x, y, false); }
public ECPoint createPoint(BigInteger x, BigInteger y) { return createPoint(x, y, false); }
private ECPoint keyToPoint(byte[] publicKey) { BigInteger x = new BigInteger(1, Arrays.copyOfRange(publicKey, 1, 33)); BigInteger y = new BigInteger(1, Arrays.copyOfRange(publicKey, 33, 65)); return EC_CURVE_PARAMETERS.getCurve().createPoint(x, y); }
public ECPoint validatePoint(BigInteger x, BigInteger y) { ECPoint p = createPoint(x, y); if (!p.isValid()) { throw new IllegalArgumentException("Invalid point coordinates"); } return p; }
public ECPoint validatePoint(BigInteger x, BigInteger y) { ECPoint p = createPoint(x, y); if (!p.isValid()) { throw new IllegalArgumentException("Invalid point coordinates"); } return p; }
public static ECPoint keyToPoint(byte[] publicKey) { BigInteger x = new BigInteger(1, Arrays.copyOfRange(publicKey, 1, 33)); BigInteger y = new BigInteger(1, Arrays.copyOfRange(publicKey, 33, 65)); return EC_CURVE_PARAMETERS.getCurve().createPoint(x, y); }
public static ECPoint createPoint(byte[] x, byte[] y) { return EC_CURVE_PARAMETERS.getCurve().createPoint( new BigInteger(1, x), new BigInteger(1, y) ); }
/** * @deprecated per-point compression property will be removed, use {@link #validatePoint(BigInteger, BigInteger)} * and refer {@link ECPoint#getEncoded(boolean)} */ public ECPoint validatePoint(BigInteger x, BigInteger y, boolean withCompression) { ECPoint p = createPoint(x, y, withCompression); if (!p.isValid()) { throw new IllegalArgumentException("Invalid point coordinates"); } return p; }
/** * @deprecated per-point compression property will be removed, use {@link #validatePoint(BigInteger, BigInteger)} * and refer {@link ECPoint#getEncoded(boolean)} */ public ECPoint validatePoint(BigInteger x, BigInteger y, boolean withCompression) { ECPoint p = createPoint(x, y, withCompression); if (!p.isValid()) { throw new IllegalArgumentException("Invalid point coordinates"); } return p; }
@Override public byte[] createPoint(byte[] x, byte[] y) { return EC_CURVE_PARAMETERS.getCurve().createPoint( new BigInteger(1, x), new BigInteger(1, y) ).getEncoded(false); } }
@Override protected void deserializeExclusiveData(BinaryReader reader) throws IOException { try { pubKey = ECC.secp256r1.getCurve().createPoint( new BigInteger(1, reader.readVarBytes()), new BigInteger(1, reader.readVarBytes())); } catch (Exception e) { e.printStackTrace(); } }
@Override protected void deserializeExclusiveData(BinaryReader reader) throws IOException { try { pubKey = ECC.secp256r1.getCurve().createPoint( new BigInteger(1, reader.readVarBytes()), new BigInteger(1, reader.readVarBytes())); } catch (Exception e) { e.printStackTrace(); } }
public static Optional<ECCurvePoint> create(BigInteger x, BigInteger y, String curveName) { X9ECParameters x9ECParameters = ECAssistant.x9ECParameters(curveName); ECPoint Q = x9ECParameters.getCurve() .createPoint(x, y); if (!Q.isValid()) { logger.warn("-- create() - bad Q: {} curve: {}", Q, curveName); return Optional.empty(); } ECCurvePoint point = new ECCurvePoint(Q, curveName, x9ECParameters); return Optional.of(point); }
public static PublicKey createPubKeyEcdsa(String name, BigInteger x, BigInteger y) throws NoSuchAlgorithmException, InvalidKeySpecException { final String curveName = EC_NAME_TO_CURVE_NAME.get(name); ECNamedCurveParameterSpec curveParaSpecBc = ECNamedCurveTable.getParameterSpec(curveName); ECPoint point = curveParaSpecBc.getCurve().createPoint(x, y); ECPublicKeySpec pubKeySpec = new ECPublicKeySpec(point, curveParaSpecBc); return new JCEECPublicKey("EC", pubKeySpec); } }
@Override protected void deserializeExclusiveData(BinaryReader reader) throws IOException { try { int len = reader.readInt(); pubKeys = new ECPoint[len]; for (int i = 0; i < len; i++) { pubKeys[i] = ECC.secp256r1.getCurve().createPoint( new BigInteger(1, reader.readVarBytes()), new BigInteger(1, reader.readVarBytes())); } account = reader.readSerializable(Address.class); } catch (Exception e) { } }
@Override protected void deserializeExclusiveData(BinaryReader reader) throws IOException { issuer = ECC.secp256r1.getCurve().createPoint( new BigInteger(1, reader.readVarBytes()), new BigInteger(1, reader.readVarBytes())); action = BookkeeperAction.valueOf(reader.readByte()); cert = reader.readVarBytes(); }
@Override protected void deserializeExclusiveData(BinaryReader reader) throws IOException { issuer = ECC.secp256r1.getCurve().createPoint( new BigInteger(1, reader.readVarBytes()), new BigInteger(1, reader.readVarBytes())); action = BookkeeperAction.valueOf(reader.readByte()); cert = reader.readVarBytes(); }
public ECPoint copyQ() { return x9ECParameters() .getCurve() .createPoint(x(), y()); }
private static ECPoint extractPublicKey(final ECPublicKey ecPublicKey) { final java.security.spec.ECPoint publicPointW = ecPublicKey.getW(); final BigInteger xCoord = publicPointW.getAffineX(); final BigInteger yCoord = publicPointW.getAffineY(); return CURVE.getCurve().createPoint(xCoord, yCoord); }
public static org.bouncycastle.math.ec.ECPoint convertPoint( ECCurve curve, ECPoint point, boolean withCompression) { return curve.createPoint(point.getAffineX(), point.getAffineY()); }