@Test
    public void updateWithByteBuffer_works() throws Exception {
        KeyPairGenerator keyGen = KeyPairGenerator.getInstance("Ed25519", conscryptProvider);
        KeyPair keyPair = keyGen.generateKeyPair();

        byte[] message = decodeHex("00112233");
        Signature signature = Signature.getInstance("Ed25519", conscryptProvider);
        signature.initSign(keyPair.getPrivate());
        signature.update(message);
        byte[] sig = signature.sign();

        signature.initSign(keyPair.getPrivate());
        signature.update(ByteBuffer.wrap(message));
        assertArrayEquals(sig, signature.sign());

        signature.initVerify(keyPair.getPublic());
        signature.update(ByteBuffer.wrap(message));
        assertTrue(signature.verify(sig));
    }
Implements a KeySpec that contains the raw bytes of a key.
common/src/test/java/org/conscrypt/EdDsaTest.java