[PATCH 0/1] BLAKE2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux