private void setFieldIdentifier() { if (ECAlgorithms.isFpCurve(curve)) { fieldIdentifier = prime_field; } else if (ECAlgorithms.isF2mCurve(curve)) { fieldIdentifier = characteristic_two_field; } else { throw new IllegalArgumentException("This type of ECCurve is not implemented"); } }
private void setFieldIdentifier() { if (ECAlgorithms.isFpCurve(curve)) { fieldIdentifier = prime_field; } else if (ECAlgorithms.isF2mCurve(curve)) { fieldIdentifier = characteristic_two_field; } else { throw new IllegalArgumentException("This type of ECCurve is not implemented"); } }
public static void discoverEndomorphisms(X9ECParameters x9) { if (x9 == null) { throw new NullPointerException("x9"); } ECCurve c = x9.getCurve(); if (ECAlgorithms.isFpCurve(c)) { BigInteger characteristic = c.getField().getCharacteristic(); if (c.getA().isZero() && characteristic.mod(ECConstants.THREE).equals(ECConstants.ONE)) { System.out.println("Curve has a 'GLV Type B' endomorphism with these parameters:"); printGLVTypeBParameters(x9); } } }
private static void discoverEndomorphisms(String curveName) { X9ECParameters x9 = ECNamedCurveTable.getByName(curveName); if (x9 == null) { System.err.println("Unknown curve: " + curveName); return; } ECCurve c = x9.getCurve(); if (ECAlgorithms.isFpCurve(c)) { BigInteger characteristic = c.getField().getCharacteristic(); if (c.getA().isZero() && characteristic.mod(ECConstants.THREE).equals(ECConstants.ONE)) { System.out.println("Curve '" + curveName + "' has a 'GLV Type B' endomorphism with these parameters:"); printGLVTypeBParameters(x9); } } }
private static void discoverEndomorphism(String curveName) { X9ECParameters x9 = ECNamedCurveTable.getByName(curveName); if (x9 == null) { System.err.println("Unknown curve: " + curveName); return; } ECCurve c = x9.getCurve(); if (ECAlgorithms.isFpCurve(c)) { BigInteger characteristic = c.getField().getCharacteristic(); if (c.getA().isZero() && characteristic.mod(ECConstants.THREE).equals(ECConstants.ONE)) { System.out.println("Curve '" + curveName + "' has a 'GLV Type B' endomorphism with these parameters: "); printGLVTypeBParameters(x9); } } }
public static byte[] serializeECPoint(short[] ecPointFormats, ECPoint point) throws IOException { ECCurve curve = point.getCurve(); /* * RFC 4492 5.7. ...an elliptic curve point in uncompressed or compressed format. Here, the * format MUST conform to what the server has requested through a Supported Point Formats * Extension if this extension was used, and MUST be uncompressed if this extension was not * used. */ boolean compressed = false; if (ECAlgorithms.isFpCurve(curve)) { compressed = isCompressionPreferred(ecPointFormats, ECPointFormat.ansiX962_compressed_prime); } else if (ECAlgorithms.isF2mCurve(curve)) { compressed = isCompressionPreferred(ecPointFormats, ECPointFormat.ansiX962_compressed_char2); } return point.getEncoded(compressed); }
public static byte[] serializeECPoint(short[] ecPointFormats, ECPoint point) throws IOException { ECCurve curve = point.getCurve(); /* * RFC 4492 5.7. ...an elliptic curve point in uncompressed or compressed format. Here, the * format MUST conform to what the server has requested through a Supported Point Formats * Extension if this extension was used, and MUST be uncompressed if this extension was not * used. */ boolean compressed = false; if (ECAlgorithms.isFpCurve(curve)) { compressed = isCompressionPreferred(ecPointFormats, ECPointFormat.ansiX962_compressed_prime); } else if (ECAlgorithms.isF2mCurve(curve)) { compressed = isCompressionPreferred(ecPointFormats, ECPointFormat.ansiX962_compressed_char2); } return point.getEncoded(compressed); }
this.seed = seed; if (ECAlgorithms.isFpCurve(curve))
this.seed = Arrays.clone(seed); if (ECAlgorithms.isFpCurve(curve))
else if (ECAlgorithms.isFpCurve(curve))
else if (ECAlgorithms.isFpCurve(curve))
if (ECAlgorithms.isFpCurve(curve))
if (ECAlgorithms.isFpCurve(curve))
if (!twiceP.isInfinity() && ECAlgorithms.isFpCurve(c) && c.getFieldSize() >= 64)
if (ECAlgorithms.isFpCurve(c) && c.getFieldSize() >= 64)