Ed448SchemeProvider extends SchemeProvider { @Override public byte[] dom(byte[] context) { String domPrefix = "SigEd448"; return ByteUtils.join( domPrefix.getBytes(), new byte[]{(byte) 0}, new byte[]{(byte) context.length}, context); } Ed448SchemeProvider(HashAlgorithm hashAlgorithm); @Override EdDsaSigner getSigner(); @Override PublicKeyDelegate getPublicKeyDelegate(); @Override PrivateKey generatePrivateKey(); @Override byte[] preHash(byte[] input); @Override byte[] dom(byte[] context);  }
@Test public void success_dom_1() { SchemeProvider schemeProvider = new Ed448SchemeProvider(HashAlgorithm.SHAKE_256); byte[] dom = schemeProvider.dom(new byte[0]); assertThat(HexEncoder.getString(dom), is("53696745643434380000")); }
@Test public void success_dom_2() { byte[] value = HexEncoder.getBytes("666f6f"); SchemeProvider schemeProvider = new Ed448SchemeProvider(HashAlgorithm.SHAKE_256); byte[] dom = schemeProvider.dom(value); assertThat(HexEncoder.getString(dom), is("53696745643434380003666f6f")); }