linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/10] crypto: AF_ALG: add AEAD and RNG support
@ 2014-11-16  2:23 Stephan Mueller
  2014-11-16  2:23 ` [PATCH v2 01/10] crypto: AF_ALG: add user space interface for AEAD Stephan Mueller
                   ` (9 more replies)
  0 siblings, 10 replies; 41+ messages in thread
From: Stephan Mueller @ 2014-11-16  2:23 UTC (permalink / raw)
  To: Herbert Xu; +Cc: Daniel Borkmann, quentin.gouchet, LKML, linux-crypto, ABI/API

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.

The patch 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

Stephan Mueller (10):
  crypto: AF_ALG: add user space interface for AEAD
  crypto: AF_ALG: user space interface for cipher info
  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: make setkey optional
  crypto: AF_ALG: add random number generator support
  crypto: AF_ALG: enable RNG interface compilation
  crypto: AF_ALG: user space interface for hash info
  crypto: AF_ALG: document the user space interface

 Documentation/crypto/crypto-API-userspace.txt |  95 ++++++-
 crypto/Kconfig                                |   9 +
 crypto/Makefile                               |   1 +
 crypto/af_alg.c                               |  20 ++
 crypto/algif_hash.c                           |  35 ++-
 crypto/algif_rng.c                            | 186 ++++++++++++++
 crypto/algif_skcipher.c                       | 352 +++++++++++++++++++++++---
 include/crypto/if_alg.h                       |   2 +
 include/uapi/linux/if_alg.h                   |  15 ++
 9 files changed, 683 insertions(+), 32 deletions(-)
 create mode 100644 crypto/algif_rng.c

-- 
2.1.0



^ permalink raw reply	[flat|nested] 41+ messages in thread

end of thread, other threads:[~2014-11-21  4:40 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-16  2:23 [PATCH v2 00/10] crypto: AF_ALG: add AEAD and RNG support Stephan Mueller
2014-11-16  2:23 ` [PATCH v2 01/10] crypto: AF_ALG: add user space interface for AEAD Stephan Mueller
2014-11-18 14:06   ` Herbert Xu
2014-11-19  0:34     ` Stephan Mueller
2014-11-19  4:20     ` Stephan Mueller
2014-11-19  4:27       ` Herbert Xu
2014-11-19  6:30         ` Stephan Mueller
2014-11-19  6:45           ` Herbert Xu
2014-11-16  2:24 ` [PATCH v2 02/10] crypto: AF_ALG: user space interface for cipher info Stephan Mueller
2014-11-18 14:08   ` Herbert Xu
2014-11-19  1:02     ` Stephan Mueller
2014-11-19  1:05       ` Herbert Xu
2014-11-20  4:03     ` Stephan Mueller
2014-11-20  4:07       ` Herbert Xu
2014-11-20  4:14         ` Stephan Mueller
2014-11-20  4:18           ` Herbert Xu
2014-11-20  4:23             ` Stephan Mueller
2014-11-20  4:46               ` crypto: user - Allow get request with empty driver name Herbert Xu
2014-11-20  7:11                 ` Steffen Klassert
2014-11-20  7:45                   ` Herbert Xu
2014-11-20  8:04                     ` Steffen Klassert
2014-11-20 13:07                       ` Stephan Mueller
2014-11-20 13:02                 ` Stephan Mueller
2014-11-20 13:10                   ` Stephan Mueller
2014-11-20 13:40                     ` Herbert Xu
2014-11-20 16:08                       ` Stephan Mueller
2014-11-21  2:31                         ` Herbert Xu
2014-11-21  2:42                           ` Stephan Mueller
2014-11-21  4:40                   ` Stephan Mueller
2014-11-20  6:32       ` [PATCH v2 02/10] crypto: AF_ALG: user space interface for cipher info Steffen Klassert
2014-11-20  7:05       ` Steffen Klassert
2014-11-16  2:25 ` [PATCH v2 03/10] crypto: AF_ALG: extend data structuers for AEAD Stephan Mueller
2014-11-16  2:25 ` [PATCH v2 04/10] crypto: AF_ALG: crypto API calls to inline functions Stephan Mueller
2014-11-16  2:26 ` [PATCH v2 05/10] crypto: AF_ALG: add AEAD support Stephan Mueller
2014-11-16  2:26 ` [PATCH v2 06/10] crypto: AF_ALG: make setkey optional Stephan Mueller
2014-11-18 14:10   ` Herbert Xu
2014-11-19  2:36     ` Stephan Mueller
2014-11-16  2:27 ` [PATCH v2 07/10] crypto: AF_ALG: add random number generator support Stephan Mueller
2014-11-16  2:28 ` [PATCH v2 08/10] crypto: AF_ALG: enable RNG interface compilation Stephan Mueller
2014-11-16  2:28 ` [PATCH v2 09/10] crypto: AF_ALG: user space interface for hash info Stephan Mueller
2014-11-16  2:29 ` [PATCH v2 10/10] crypto: AF_ALG: document the user space interface Stephan Mueller

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).