Java userspace test (contrib/external-tests/java)

crasm at wireguard.1.email.vczf.io crasm at wireguard.1.email.vczf.io
Wed Apr 19 18:06:59 CEST 2017


I did replace it, but I'm still having the same problem.

https://github.com/crasm/noise-java/blob/wireguard-contrib-external-tests/src/main/java/com/southernstorm/noise/crypto/Blake2sMessageDigest.java
https://github.com/crasm/WireGuard/blob/master/contrib/external-tests/java/src/main/java/wireguard/Main.java

If anyone can help, it would be appreciated, but I'll continue debugging
on my own as well.

On Mon, Apr 17, 2017, at 09:54 PM, Jason A. Donenfeld wrote:
> From your code:
> 
> Blake2sMessageDigest blake2s = new Blake2sMessageDigest(preshared);
> blake2s.update(theirPublic);
> blake2s.update(buf.array(), 0, buf.position());
> // Note: Blake2s returns 32 bytes, but we only use the first 16.
> buf.put(blake2s.digest(), 0, 16);
> 
> The final length needs to be passed to Blake2sMessageDigest in the
> constructor, because Blake2 encodes the final length into the initial
> block. The implementation from here might work better:
> https://github.com/Geal/android-wireguard/blob/master/app/src/main/java/com/southernstorm/noise/crypto/Blake2sMessageDigest.java


More information about the WireGuard mailing list