From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: crasm@wireguard.1.email.vczf.io
Cc: WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Re: Java userspace test (contrib/external-tests/java)
Date: Tue, 18 Apr 2017 03:54:44 +0200 [thread overview]
Message-ID: <CAHmME9oX6x2NKTqqTNZVKz2y2h0cSVkYeXUqL0MTSB8Tc1-T3A@mail.gmail.com> (raw)
In-Reply-To: <1492479545.1458773.947454608.1D3BD4D5@webmail.messagingengine.com>
>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
next prev parent reply other threads:[~2017-04-18 1:47 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 [this message]
2017-04-19 16:06 ` crasm
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=CAHmME9oX6x2NKTqqTNZVKz2y2h0cSVkYeXUqL0MTSB8Tc1-T3A@mail.gmail.com \
--to=jason@zx2c4.com \
--cc=crasm@wireguard.1.email.vczf.io \
--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).