public Ed25519PublicKey(EdDSAPublicKeySpec spec) { super(spec); EdDSANamedCurveSpec ed25519 = EdDSANamedCurveTable.getByName("Ed25519"); if (!spec.getParams().getCurve().equals(ed25519.getCurve())) { throw new SSHRuntimeException("Cannot create Ed25519 Public Key from wrong spec"); } }
public static GroupElement[][] getPrecomputation(String fileName) { EdDSANamedCurveSpec ed25519 = EdDSANamedCurveTable.getByName(EdDSANamedCurveTable.ED_25519); Curve curve = ed25519.getCurve(); Field field = curve.getField(); GroupElement[][] precmp = new GroupElement[32][8];
public static GroupElement[] getDoublePrecomputation(String fileName) { EdDSANamedCurveSpec ed25519 = EdDSANamedCurveTable.getByName(EdDSANamedCurveTable.ED_25519); Curve curve = ed25519.getCurve(); Field field = curve.getField(); GroupElement[] dblPrecmp = new GroupElement[8];
private static NKey createPair(Type type, SecureRandom random) throws IOException, NoSuchProviderException, NoSuchAlgorithmException { if (random == null) { random = SecureRandom.getInstance("SHA1PRNG", "SUN"); } byte[] seed = new byte[NKey.ed25519.getCurve().getField().getb() / 8]; random.nextBytes(seed); return createPair(type, seed); }
private static NKey createPair(Type type, SecureRandom random) throws IOException, NoSuchProviderException, NoSuchAlgorithmException { if (random == null) { random = SecureRandom.getInstance("SHA1PRNG", "SUN"); } byte[] seed = new byte[NKey.ed25519.getCurve().getField().getb() / 8]; random.nextBytes(seed); return createPair(type, seed); }
public Ed25519PublicKey(EdDSAPublicKeySpec spec) { super(spec); EdDSANamedCurveSpec ed25519 = EdDSANamedCurveTable.getByName("Ed25519"); if (!spec.getParams().getCurve().equals(ed25519.getCurve())) { throw new SSHRuntimeException("Cannot create Ed25519 Public Key from wrong spec"); } }