From: Stephan Mueller <smueller@chronox.de>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Daniel Borkmann <dborkman@redhat.com>,
"'Quentin Gouchet'" <quentin.gouchet@gmail.com>,
lkml - Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-crypto@vger.kernel.org, linux-api@vger.kernel.org
Subject: [PATCH v3 0/7] crypto: AF_ALG: add AEAD and RNG support
Date: Fri, 21 Nov 2014 06:29:36 +0100 [thread overview]
Message-ID: <4088013.2O8zCP0xXa@tachyon.chronox.de> (raw)
Hi,
This patch set adds AEAD and RNG support to the AF_ALG interface
exported by the kernel crypto API. By extending AF_ALG with AEAD and RNG
support, all cipher types the kernel crypto API allows access to are
now accessible from userspace.
The RNG support is stand-alone.
The AEAD implementation is added to algif_skcipher.c to prevent
re-implementation of the memory moving logic.
The extension for the AEAD support can be summarized with the following
types of changes:
* select the correct crypto API functions (either the ablkcipher
or the aead functions)
* apply the additional data needed for AEAD at the right time
(associated data, authentication tag) -- this includes the addition
of user space interfaces to allow setting this data.
* add the calculation for the memory size needed for encryption and
decryption.
In addition, the patch set adds a getsockopt implementation to skcipher to
allow user space to inquire about properties of the ciphers (IV size,
block size, authentication data size). This extension would be needed for a
generic user space usage of these ciphers.
The new AEAD and RNG interfaces are fully tested with the test application
provided at [1]. That test application exercises all newly added user space
interfaces.
Stephan Mueller (7):
*tch set was tested on x86_64 and i386.
[1] http://www.chronox.de/libkcapi.html
Changes v2:
* rebase to current cryptodev-2.6 tree
* use memzero_explicit to zeroize AEAD associated data
* use sizeof for determining length of AEAD associated data
* update algif_rng.c covering all suggestions from Daniel Borkmann
<dborkman@redhat.com>
* addition of patch 9: add digestsize interface for hashes
* addition of patch to update documentation covering the userspace interface
* change numbers of getsockopt options: separate them from sendmsg interface
definitions
Changes v3:
* remove getsockopt interface
* AEAD: associated data is set prepended to the plain/ciphertext
* AEAD: allowing arbitrary associated data lengths
* remove setkey patch as protection was already in the existing code
crypto: AF_ALG: add user space interface for AEAD
crypto: AF_ALG: extend data structuers for AEAD
crypto: AF_ALG: crypto API calls to inline functions
crypto: AF_ALG: add AEAD support
crypto: AF_ALG: add random number generator support
crypto: AF_ALG: enable RNG interface compilation
crypto: AF_ALG: document the user space interface
Documentation/crypto/crypto-API-userspace.txt | 70 +++++-
crypto/Kconfig | 9 +
crypto/Makefile | 1 +
crypto/af_alg.c | 12 +
crypto/algif_rng.c | 186 ++++++++++++++++
crypto/algif_skcipher.c | 308 +++++++++++++++++++++++---
include/crypto/if_alg.h | 2 +
include/uapi/linux/if_alg.h | 2 +
8 files changed, 559 insertions(+), 31 deletions(-)
create mode 100644 crypto/algif_rng.c
--
2.1.0
next reply other threads:[~2014-11-21 5:42 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-21 5:29 Stephan Mueller [this message]
2014-11-21 5:30 ` [PATCH v3 1/7] crypto: AF_ALG: add user space interface for AEAD Stephan Mueller
2014-11-24 14:26 ` Herbert Xu
2014-11-21 5:30 ` [PATCH v3 3/7] crypto: AF_ALG: crypto API calls to inline functions Stephan Mueller
2014-11-21 5:31 ` [PATCH v3 2/7] crypto: AF_ALG: extend data structuers for AEAD Stephan Mueller
2014-11-21 5:32 ` [PATCH v3 4/7] crypto: AF_ALG: add AEAD support Stephan Mueller
2014-11-24 14:29 ` Herbert Xu
2014-11-24 14:58 ` Stephan Mueller
2014-11-25 14:58 ` Herbert Xu
2014-11-25 15:08 ` Stephan Mueller
2014-11-24 20:55 ` Stephan Mueller
2014-11-21 5:32 ` [PATCH v3 5/7] crypto: AF_ALG: add random number generator support Stephan Mueller
2014-11-24 14:31 ` Herbert Xu
2014-11-24 15:08 ` Stephan Mueller
2014-11-21 5:33 ` [PATCH v3 6/7] crypto: AF_ALG: enable RNG interface compilation Stephan Mueller
2014-11-21 5:34 ` [PATCH v3 7/7] crypto: AF_ALG: document the user space interface Stephan Mueller
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=4088013.2O8zCP0xXa@tachyon.chronox.de \
--to=smueller@chronox.de \
--cc=dborkman@redhat.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-api@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quentin.gouchet@gmail.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