Development discussion of WireGuard
 help / color / mirror / Atom feed
From: crasm@wireguard.1.email.vczf.io
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Re: Java userspace test (contrib/external-tests/java)
Date: Wed, 19 Apr 2017 12:06:59 -0400	[thread overview]
Message-ID: <1492618019.116821.949489032.63283A29@webmail.messagingengine.com> (raw)
In-Reply-To: <CAHmME9oX6x2NKTqqTNZVKz2y2h0cSVkYeXUqL0MTSB8Tc1-T3A@mail.gmail.com>

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

      reply	other threads:[~2017-04-19 15:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-18  1:39 crasm
2017-04-18  1:54 ` Jason A. Donenfeld
2017-04-19 16:06   ` crasm [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1492618019.116821.949489032.63283A29@webmail.messagingengine.com \
    --to=crasm@wireguard.1.email.vczf.io \
    --cc=Jason@zx2c4.com \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).