@Test public void success_GeneratePublicKeySeed_via_SHAKE_512_from_hex_string_1() { PrivateKey privateKey = PrivateKey.newInstance(HexEncoder.getBytes( "6c82a562cb808d10d632be89c8513ebf" + "6c929f34ddfa8c9f63c9960ef6e348a3" + "528c8a3fcc2f044e39a3fc5b94492f8f" + "032e7549a20098f95b")); byte[] seed = delegate.generatePublicKeySeed(privateKey); assertThat(HexEncoder.getString(seed), is( "5fd7449b59b461fd2ce787ec616ad46a" + "1da1342485a70e1f8a0ea75d80e96778" + "edf124769b46c7061bd6783df1e50f6c" + "d1fa1abeafe8256180")); }
@Override public byte[] generatePublicKeySeed(PrivateKey privateKey) { if (!(privateKey instanceof PrivateKeyEd448)) { throw new IllegalArgumentException("Public key on Curve448 must be " + CURVE.getPublicKeyByteLength() + " byte length. Length: " + privateKey.getRaw().length); } BigInteger s = privateKey.getScalarSeed(this); Point point = CURVE.getBasePoint().scalarMultiply(s); return point.encode().getValue(); }
Ed448PublicKeyDelegate implements PublicKeyDelegate, HashDelegate { @Override public byte[] generatePublicKeySeed(PrivateKey privateKey) { if (!(privateKey instanceof PrivateKeyEd448)) { throw new IllegalArgumentException("Public key on Curve448 must be " + CURVE.getPublicKeyByteLength() + " byte length. Length: " + privateKey.getRaw().length); } BigInteger s = privateKey.getScalarSeed(this); Point point = CURVE.getBasePoint().scalarMultiply(s); return point.encode().getValue(); } }
Ed448PublicKeyDelegate implements PublicKeyDelegate, HashDelegate { @Override public byte[] generatePublicKeySeed(PrivateKey privateKey) { if (!(privateKey instanceof PrivateKeyEd448)) { throw new IllegalArgumentException("Public key on Curve448 must be " + CURVE.getPublicKeyByteLength() + " byte length. Length: " + privateKey.getRaw().length); } BigInteger s = privateKey.getScalarSeed(this); Point point = CURVE.getBasePoint().scalarMultiply(s); return point.encode().getValue(); } Ed448PublicKeyDelegate(HashAlgorithm hashAlgorithm); }
Ed448PublicKeyDelegate implements PublicKeyDelegate, HashDelegate { @Override public byte[] generatePublicKeySeed(PrivateKey privateKey) { if (!(privateKey instanceof PrivateKeyEd448)) { throw new IllegalArgumentException("Public key on Curve448 must be " + CURVE.getPublicKeyByteLength() + " byte length. Length: " + privateKey.getRaw().length); } BigInteger s = privateKey.getScalarSeed(this); Point point = CURVE.getBasePoint().scalarMultiply(s); return point.encode().getValue(); } Ed448PublicKeyDelegate(HashAlgorithm hashAlgorithm); @Override byte[] generatePublicKeySeed(PrivateKey privateKey); @Override byte[] hashPrivateKey(PrivateKey privateKey); }
Ed448PublicKeyDelegate implements PublicKeyDelegate, HashDelegate { @Override public byte[] generatePublicKeySeed(PrivateKey privateKey) { if (!(privateKey instanceof PrivateKeyEd448)) { throw new IllegalArgumentException("Public key on Curve448 must be " + CURVE.getPublicKeyByteLength() + " byte length. Length: " + privateKey.getRaw().length); } BigInteger s = privateKey.getScalarSeed(this); Point point = CURVE.getBasePoint().scalarMultiply(s); return point.encode().getValue(); } Ed448PublicKeyDelegate(HashAlgorithm hashAlgorithm); @Override byte[] generatePublicKeySeed(PrivateKey privateKey); @Override byte[] hashPrivateKey(PrivateKey privateKey);  }