@Test public void success_GeneratePublicKeySeed_via_SHAKE_512_from_hex_string_9() { PrivateKey privateKey = PrivateKey.newInstance(HexEncoder.getBytes( "872d093780f5d3730df7c212664b37b8" + "a0f24f56810daa8382cd4fa3f77634ec" + "44dc54f1c2ed9bea86fafb7632d8be19" + "9ea165f5ad55dd9ce8")); byte[] seed = delegate.generatePublicKeySeed(privateKey); assertThat(HexEncoder.getString(seed), is( "a81b2e8a70a5ac94ffdbcc9badfc3feb" + "0801f258578bb114ad44ece1ec0e799d" + "a08effb81c5d685c0c56f64eecaef8cd" + "f11cc38737838cf400")); }
@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);  }