Development discussion of WireGuard
 help / color / mirror / Atom feed
From: crasm@wireguard.1.email.vczf.io
To: wireguard@lists.zx2c4.com
Subject: HKDF for a Java userspace implementation?
Date: Fri, 10 Feb 2017 19:25:57 -0500	[thread overview]
Message-ID: <1486772757.2823803.877388296.4A3928CE@webmail.messagingengine.com> (raw)

Hello,

I've started tinkering with a Java implementation of wireguard. I'm in
the early stages: the current goal is to be able to build the first
message using hardcoded parameters. I'm new to crypto and doing this
mainly for fun, curiosity, and to have wireguard on my phone.

I'm stuck on calculating the HMAC-BLAKE2s. Specifically,

    Hmac(key, input):
        Hmac-Blake2s(key, input), the ordinary BLAKE2s hash function
        used in an HMAC construction, returning 32 bytes of output.

Is there an existing library that does HKDF with BLAKE2s? Am I supposed
to write the HMAC construction myself using RFC5869 and the cited HKDF
paper [1]?

noise-java [2] can do regular BLAKE2s hashes (and I'm using that part),
but it doesn't include HMAC. Is there anything in libsodium [3] that can
help? Can someone with Java crypto experience point me in the right
direction?

Lastly, has someone already done this so I can get started on the
Android app instead? ;)

--
Christian Demsar

[1]: https://eprint.iacr.org/2010/264.pdf
[2]: https://rweather.github.io/noise-java/index.html
[3]: https://download.libsodium.org/doc/key_derivation/

             reply	other threads:[~2017-02-11  0:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-11  0:25 crasm [this message]
2017-02-11  8:51 ` Jason A. Donenfeld

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=1486772757.2823803.877388296.4A3928CE@webmail.messagingengine.com \
    --to=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).