linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.com>
To: linux-crypto@vger.kernel.org
Cc: David Sterba <dsterba@suse.com>
Subject: [PATCH 0/1] BLAKE2
Date: Mon, 30 Sep 2019 15:13:05 +0200	[thread overview]
Message-ID: <cover.1569849051.git.dsterba@suse.com> (raw)

Hi,

there's another implementation of blake2s in the list from today, I was waiting
with my patches post rc1 so I'm sending it as it was. My usecase is for 'BLAKE2b'.

---

The patch brings support of several BLAKE2 algorithms (2b, 2s, various digest
lengths). The in-tree user will be btrfs (for checksumming), we're going to use
the BLAKE2b-256 variant. It would be ideal if the patches get merged to 5.5,
thats our target to release the support of new hashes.

The code is reference implementation taken from the official sources and
slightly modified only in terms of kernel coding style (whitespace, comments,
uintXX_t -> uXX types, removed unused prototypes and #ifdefs, removed testing
code, changed secure_zero_memory -> memzero_explicit).

The crypto API definitions have been copied from sha3_generic.c, so there's
list of the digests as shown in RFC 7693 (while BLAKE2 supports 1-32 or 1-64
respectively).

I'm not sure about the licensing, so I'd appreaciate a review here. The blake2
code is CC0 or OpenSSL or Apache 2.0, the last one being in linux/LICENSES, so
I picked that one. For the other code it's GPL2-only, as other code I write for
kernel. The SPDX string is "SPDX-License-Identifier: (GPL-2.0-only OR Apache-2.0)".

Remaining items:

- add test vectors (available in official sources)
- add optimized versions for x86_64 and ARM (dtto)

Other than that, I tried to keep the style of the sources close to what I read
elsewhere in crypto/, but please let me know about things to fix up or update
or if it's preferred to split the patch.

d.

David Sterba (1):
  crypto: blake2s reference implementation

 crypto/Kconfig           |  35 +++
 crypto/Makefile          |   2 +
 crypto/blake2-impl.h     | 145 +++++++++++++
 crypto/blake2.h          | 143 +++++++++++++
 crypto/blake2b_generic.c | 445 ++++++++++++++++++++++++++++++++++++++
 crypto/blake2s_generic.c | 446 +++++++++++++++++++++++++++++++++++++++
 6 files changed, 1216 insertions(+)
 create mode 100644 crypto/blake2-impl.h
 create mode 100644 crypto/blake2.h
 create mode 100644 crypto/blake2b_generic.c
 create mode 100644 crypto/blake2s_generic.c

-- 
2.23.0


             reply	other threads:[~2019-09-30 13:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-30 13:13 David Sterba [this message]
2019-09-30 13:13 ` [PATCH] crypto: BLAKE2 reference implementation David Sterba
2019-10-03 12:18   ` Ard Biesheuvel
2019-10-03 21:21     ` David Sterba

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=cover.1569849051.git.dsterba@suse.com \
    --to=dsterba@suse.com \
    --cc=linux-crypto@vger.kernel.org \
    /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).