Re: [PATCH v2 0/8] crypto: ARM/arm64 - big endian fixes

2016-10-20 Thread Herbert Xu
On Tue, Oct 11, 2016 at 07:15:12PM +0100, Ard Biesheuvel wrote:
> As it turns out, none of the accelerated crypto routines under 
> arch/arm64/crypto
> currently work, or have ever worked correctly when built for big endian. So 
> this
> series fixes all of them. This v2 now includes a similar fix for 32-bit ARM as
> well, and an additional fix for XTS which escaped my attention before.
> 
> Each of these patches carries a fixes tag, and could be backported to stable.
> However, for patches #1 and #5, the fixes tag denotes the oldest commit that 
> the
> fix is compatible with, not the patch that introduced the algorithm. This is 
> due
> to the fact that the key schedules are incompatible between generic AES and 
> the
> arm64 Crypto Extensions implementation (but only when building for big endian)
> This is not a problem in practice, but it does mean that the AES-CCM and AES 
> in
> EBC/CBC/CTR/XTS mode implementations before v3.19 require a different fix, 
> i.e.,
> one that is compatible with the generic AES key schedule generation code 
> (which
> it currently no longer uses)
> 
> In any case, please apply with cc to stable.
> 
> Ard Biesheuvel (8):
>   crypto: arm64/aes-ce - fix for big endian
>   crypto: arm64/ghash-ce - fix for big endian
>   crypto: arm64/sha1-ce - fix for big endian
>   crypto: arm64/sha2-ce - fix for big endian
>   crypto: arm64/aes-ccm-ce: fix for big endian
>   crypto: arm64/aes-neon - fix for big endian
>   crypto: arm64/aes-xts-ce: fix for big endian
>   crypto: arm/aes-ce - fix for big endian
> 
>  arch/arm/crypto/aes-ce-glue.c   |  5 ++
>  arch/arm64/crypto/aes-ce-ccm-core.S | 53 ++--
>  arch/arm64/crypto/aes-ce-cipher.c   | 25 +
>  arch/arm64/crypto/aes-ce.S  |  1 +
>  arch/arm64/crypto/aes-modes.S   |  3 +-
>  arch/arm64/crypto/aes-neon.S| 25 +
>  arch/arm64/crypto/ghash-ce-core.S   |  6 +--
>  arch/arm64/crypto/sha1-ce-core.S|  4 +-
>  arch/arm64/crypto/sha2-ce-core.S|  4 +-
>  9 files changed, 72 insertions(+), 54 deletions(-)

All applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] crypto: CCP - change type of struct member lsb to signed

2016-10-20 Thread Herbert Xu
On Wed, Oct 12, 2016 at 08:47:03AM -0500, Gary R Hook wrote:
> The lsb field uses a value of -1 to indicate that it
> is unassigned. Therefore type must be a signed int.
> 
> Signed-off-by: Gary R Hook 

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] crypto: cmac - fix alignment of 'consts'

2016-10-20 Thread Herbert Xu
On Mon, Oct 10, 2016 at 10:15:15AM -0700, Eric Biggers wrote:
> The per-transform 'consts' array is accessed as __be64 in
> crypto_cmac_digest_setkey() but was only guaranteed to be aligned to
> __alignof__(long).  Fix this by aligning it to __alignof__(__be64).
> 
> Signed-off-by: Eric Biggers 

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] crypto: cmac - return -EINVAL if block size is unsupported

2016-10-20 Thread Herbert Xu
On Mon, Oct 10, 2016 at 10:15:14AM -0700, Eric Biggers wrote:
> cmac_create() previously returned 0 if a cipher with a block size other
> than 8 or 16 bytes was specified.  It should return -EINVAL instead.
> Granted, this doesn't actually change any behavior because cryptomgr
> currently ignores any return value other than -EAGAIN from template
> ->create() functions.
> 
> Signed-off-by: Eric Biggers 

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] crypto: skcipher - Remove unused crypto_lookup_skcipher() declaration

2016-10-20 Thread Herbert Xu
On Fri, Oct 07, 2016 at 02:13:34PM -0700, Eric Biggers wrote:
> The definition of crypto_lookup_skcipher() was already removed in
> commit 3a01d0ee2b99 ("crypto: skcipher - Remove top-level givcipher
> interface").  So the declaration should be removed too.
> 
> Signed-off-by: Eric Biggers 

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] crypto: api - Remove no-op exit_ops code

2016-10-20 Thread Herbert Xu
On Fri, Oct 07, 2016 at 02:13:35PM -0700, Eric Biggers wrote:
> crypto_exit_cipher_ops() and crypto_exit_compress_ops() are no-ops and
> have been for a long time, so remove them.
> 
> Signed-off-by: Eric Biggers 

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v4 0/2] Improve DMA chaining for ahash requests

2016-10-20 Thread Herbert Xu
On Wed, Oct 05, 2016 at 09:56:31AM +0200, Romain Perier wrote:
> This series contain performance improvement regarding ahash requests.
> So far, ahash requests were systematically not chained at the DMA level.
> However, in some case, like this is the case by using IPSec, some ahash
> requests can be processed directly by the engine, and don't have
> intermediaire partial update states.
> 
> This series firstly re-work the way outer IVs are copied from the SRAM
> into the dma pool. To do so, we introduce a common dma pool for all type
> of requests that contains outer results (like IV or digest). Then, for
> ahash requests that can be processed directly by the engine, outer
> results are copied from the SRAM into the common dma pool. These requests
> are then allowed to be chained at the DMA level.
> 
> 
> Benchmarking results with iperf throught IPSec
> ==
>   ESP AH
> 
> Before343 Mbits/s 492 Mbits/s
> After 422 Mbits/s 577 Mbits/s
> Improvement   +23%+17%
> 
> Romain Perier (2):
>   crypto: marvell - Use an unique pool to copy results of requests
>   crypto: marvell - Don't break chain for computable last ahash requests
> 
>  drivers/crypto/marvell/cesa.c   |  4 ---
>  drivers/crypto/marvell/cesa.h   |  5 ++--
>  drivers/crypto/marvell/cipher.c |  8 +++--
>  drivers/crypto/marvell/hash.c   | 65 
> +++--
>  drivers/crypto/marvell/tdma.c   | 28 +-
>  5 files changed, 70 insertions(+), 40 deletions(-)

All applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 1/1] crypto: atmel-aes: add support to the XTS mode

2016-10-20 Thread Herbert Xu
On Mon, Oct 03, 2016 at 02:33:16PM +0200, Cyrille Pitchen wrote:
> This patch adds the xts(aes) algorithm, which is supported from
> hardware version 0x500 and above (sama5d2x).
> 
> Signed-off-by: Cyrille Pitchen 

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 0/8] Add support for SafeXcel IP-76 to OMAP RNG

2016-10-20 Thread Herbert Xu
On Thu, Oct 20, 2016 at 09:02:33AM +0200, Romain Perier wrote:
>
> Without any feedbacks from the OMAP guys, could you merge please ?
> Regressions can be detected in "next" and then fixed.

All appied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/1] crypto: atmel-aes: fix compiler error when VERBOSE_DEBUG is defined

2016-10-20 Thread Herbert Xu
On Thu, Sep 29, 2016 at 06:46:57PM +0200, Cyrille Pitchen wrote:
> This patch fixes a compiler error when VERBOSE_DEBUG is defined. Indeed,
> in atmel_aes_write(), the 3rd argument of atmel_aes_reg_name() was
> missing.
> 
> Signed-off-by: Cyrille Pitchen 
> Reported-by: Levent Demir 

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 4/8] crypto: doc - fix separation of cipher / req API

2016-10-20 Thread Stephan Mueller
Keep the cipher API and the request API function documentation in
separate sections.

Signed-off-by: Stephan Mueller 
---
 Documentation/crypto/api-akcipher.rst | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/Documentation/crypto/api-akcipher.rst 
b/Documentation/crypto/api-akcipher.rst
index 305e616..49e0ab6 100644
--- a/Documentation/crypto/api-akcipher.rst
+++ b/Documentation/crypto/api-akcipher.rst
@@ -25,32 +25,32 @@ Asymmetric Cipher API
 .. kernel-doc:: include/crypto/akcipher.h
:functions: crypto_akcipher_set_priv_key
 
-Asymmetric Cipher Request Handle
-
-
 .. kernel-doc:: include/crypto/akcipher.h
-   :functions: akcipher_request_alloc
+   :functions: crypto_akcipher_maxsize
 
 .. kernel-doc:: include/crypto/akcipher.h
-   :functions: akcipher_request_free
+   :functions: crypto_akcipher_encrypt
 
 .. kernel-doc:: include/crypto/akcipher.h
-   :functions: akcipher_request_set_callback
+   :functions: crypto_akcipher_decrypt
 
 .. kernel-doc:: include/crypto/akcipher.h
-   :functions: akcipher_request_set_crypt
+   :functions: crypto_akcipher_sign
 
 .. kernel-doc:: include/crypto/akcipher.h
-   :functions: crypto_akcipher_maxsize
+   :functions: crypto_akcipher_verify
+
+Asymmetric Cipher Request Handle
+
 
 .. kernel-doc:: include/crypto/akcipher.h
-   :functions: crypto_akcipher_encrypt
+   :functions: akcipher_request_alloc
 
 .. kernel-doc:: include/crypto/akcipher.h
-   :functions: crypto_akcipher_decrypt
+   :functions: akcipher_request_free
 
 .. kernel-doc:: include/crypto/akcipher.h
-   :functions: crypto_akcipher_sign
+   :functions: akcipher_request_set_callback
 
 .. kernel-doc:: include/crypto/akcipher.h
-   :functions: crypto_akcipher_verify
+   :functions: akcipher_request_set_crypt
-- 
2.7.4


--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 6/8] crypto: doc - remove crypto_alloc_ablkcipher

2016-10-20 Thread Stephan Mueller
Remove the documentation reference to crypto_alloc_ablkcipher as the API
function call was removed.

Signed-off-by: Stephan Mueller 
---
 Documentation/crypto/api-skcipher.rst | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/Documentation/crypto/api-skcipher.rst 
b/Documentation/crypto/api-skcipher.rst
index eabd369..cd8830b 100644
--- a/Documentation/crypto/api-skcipher.rst
+++ b/Documentation/crypto/api-skcipher.rst
@@ -107,9 +107,6 @@ Asynchronous Block Cipher API - Deprecated
:doc: Asynchronous Block Cipher API
 
 .. kernel-doc:: include/linux/crypto.h
-   :functions: crypto_alloc_ablkcipher
-
-.. kernel-doc:: include/linux/crypto.h
:functions: crypto_free_ablkcipher
 
 .. kernel-doc:: include/linux/crypto.h
-- 
2.7.4


--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 0/8] Conversion crypto API documentation to Sphinx

2016-10-20 Thread Stephan Mueller
Hi,

the attached patch set converts the existing crypto API documentation
from DocBook to Sphinx.

The first two patch sets perform the conversion without changes to the
content of the documentation. Starting with patch 3, fixes and
enhancements are applied.

A full review of the new kernel crypto API documentation is found
at [1].

[1] http://www.chronox.de/crypto-API/index.html

Changes v2:
 * Mark bullet list for AEAD memory structure appropriately header file
 * Mark inline function appropriately
 * add patch to optimize compilation of documentation

Stephan Mueller (8):
  crypto: doc - convert crypto API documentation to Sphinx
  crypto: doc - remove crypto API DocBook
  crypto: doc - fix source comments for Sphinx
  crypto: doc - fix separation of cipher / req API
  crypto: doc - add KPP documentation
  crypto: doc - remove crypto_alloc_ablkcipher
  crypto: doc - clarify AEAD memory structure
  crypto: doc - optimize compilation

 Documentation/DocBook/Makefile|2 +-
 Documentation/DocBook/crypto-API.tmpl | 2092 -
 Documentation/crypto/api-aead.rst |   23 +
 Documentation/crypto/api-akcipher.rst |   20 +
 Documentation/crypto/api-digest.rst   |   35 +
 Documentation/crypto/api-kpp.rst  |   38 +
 Documentation/crypto/api-rng.rst  |   14 +
 Documentation/crypto/api-samples.rst  |  224 
 Documentation/crypto/api-skcipher.rst |   62 +
 Documentation/crypto/api.rst  |   25 +
 Documentation/crypto/architecture.rst |  441 +++
 Documentation/crypto/devel-algos.rst  |  247 
 Documentation/crypto/index.rst|   24 +
 Documentation/crypto/intro.rst|   74 ++
 Documentation/crypto/userspace-if.rst |  387 ++
 Documentation/index.rst   |1 +
 crypto/algif_aead.c   |   14 +-
 include/crypto/aead.h |   50 +-
 include/crypto/dh.h   |   58 +
 include/crypto/ecdh.h |   58 +
 include/crypto/hash.h |2 +-
 include/crypto/kpp.h  |   15 +-
 include/crypto/skcipher.h |4 +-
 include/linux/crypto.h|4 +-
 24 files changed, 1770 insertions(+), 2144 deletions(-)
 delete mode 100644 Documentation/DocBook/crypto-API.tmpl
 create mode 100644 Documentation/crypto/api-aead.rst
 create mode 100644 Documentation/crypto/api-akcipher.rst
 create mode 100644 Documentation/crypto/api-digest.rst
 create mode 100644 Documentation/crypto/api-kpp.rst
 create mode 100644 Documentation/crypto/api-rng.rst
 create mode 100644 Documentation/crypto/api-samples.rst
 create mode 100644 Documentation/crypto/api-skcipher.rst
 create mode 100644 Documentation/crypto/api.rst
 create mode 100644 Documentation/crypto/architecture.rst
 create mode 100644 Documentation/crypto/devel-algos.rst
 create mode 100644 Documentation/crypto/index.rst
 create mode 100644 Documentation/crypto/intro.rst
 create mode 100644 Documentation/crypto/userspace-if.rst

-- 
2.7.4


--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 2/8] crypto: doc - remove crypto API DocBook

2016-10-20 Thread Stephan Mueller
With the conversion of the documentation to Sphinx, the old DocBook is
now stale.

Signed-off-by: Stephan Mueller 
---
 Documentation/DocBook/Makefile|2 +-
 Documentation/DocBook/crypto-API.tmpl | 2092 
-
 2 files changed, 1 insertion(+), 2093 deletions(-)
 delete mode 100644 Documentation/DocBook/crypto-API.tmpl

diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile
index fdf8232..ff191bd 100644
--- a/Documentation/DocBook/Makefile
+++ b/Documentation/DocBook/Makefile
@@ -15,7 +15,7 @@ DOCBOOKS := z8530book.xml  \
debugobjects.xml sh.xml regulator.xml \
alsa-driver-api.xml writing-an-alsa-driver.xml \
tracepoint.xml w1.xml \
-   writing_musb_glue_layer.xml crypto-API.xml iio.xml
+   writing_musb_glue_layer.xml iio.xml
 
 ifeq ($(DOCBOOKS),)
 
diff --git a/Documentation/DocBook/crypto-API.tmpl b/Documentation/DocBook/
crypto-API.tmpl
deleted file mode 100644
index 088b79c..000
--- a/Documentation/DocBook/crypto-API.tmpl
+++ /dev/null
@@ -1,2092 +0,0 @@
-
-http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd; []>
-
-
- 
-  Linux Kernel Crypto API
-
-  
-   
-Stephan
-Mueller
-
- 
-  smuel...@chronox.de
- 
-
-   
-   
-Marek
-Vasut
-
- 
-  ma...@denx.de
- 
-
-   
-  
-
-  
-   2014
-   Stephan Mueller
-  
-
-
-  
-   
- This documentation is free software; you can redistribute
- it and/or modify it under the terms of the GNU General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later
- version.
-   
-
-   
- This program is distributed in the hope that it will be
- useful, but WITHOUT ANY WARRANTY; without even the implied
- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details.
-   
-
-   
- You should have received a copy of the GNU General Public
- License along with this program; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- MA 02111-1307 USA
-   
-
-   
- For more details see the file COPYING in the source
- distribution of Linux.
-   
-  
- 
-
- 
-
- 
-  Kernel Crypto API Interface Specification
-
-   Introduction
-
-
- The kernel crypto API offers a rich set of cryptographic ciphers as
- well as other data transformation mechanisms and methods to invoke
- these. This document contains a description of the API and provides
- example code.
-
-
-
- To understand and properly use the kernel crypto API a brief
- explanation of its structure is given. Based on the architecture,
- the API can be separated into different components. Following the
- architecture specification, hints to developers of ciphers are
- provided. Pointers to the API function call  documentation are
- given at the end.
-
-
-
- The kernel crypto API refers to all algorithms as "transformations".
- Therefore, a cipher handle variable usually has the name "tfm".
- Besides cryptographic operations, the kernel crypto API also knows
- compression transformations and handles them the same way as ciphers.
-
-
-
- The kernel crypto API serves the following entity types:
-
- 
-  
-   consumers requesting cryptographic services
-  
-  
-  data transformation implementations (typically ciphers)
-   that can be called by consumers using the kernel crypto
-   API
-  
- 
-
-
-
- This specification is intended for consumers of the kernel crypto
- API as well as for developers implementing ciphers. This API
- specification, however, does not discuss all API calls available
- to data transformation implementations (i.e. implementations of
- ciphers and other transformations (such as CRC or even compression
- algorithms) that can register with the kernel crypto API).
-
-
-
- Note: The terms "transformation" and cipher algorithm are used
- interchangeably.
-
-   
-
-   Terminology
-
- The transformation implementation is an actual code or interface
- to hardware which implements a certain transformation with precisely
- defined behavior.
-
-
-
- The transformation object (TFM) is an instance of a transformation
- implementation. There can be multiple transformation objects
- associated with a single transformation implementation. Each of
- those transformation objects is held by a crypto API consumer or
- another transformation. Transformation object is allocated when a
- crypto API consumer requests a transformation implementation.
- The consumer is then provided with a structure, which contains
- a transformation object (TFM).
-
-
-
- The structure that contains 

[PATCH v2 1/8] crypto: doc - convert crypto API documentation to Sphinx

2016-10-20 Thread Stephan Mueller
With the conversion of the kernel crypto API DocBook to Sphinx, the
monolithic document is broken up into individual documents. The
documentation is unchanged with the exception of a slight reordering to
keep the individual document parts self-contained.

Signed-off-by: Stephan Mueller 
---
 Documentation/crypto/api-aead.rst |  68 ++
 Documentation/crypto/api-akcipher.rst |  56 +
 Documentation/crypto/api-digest.rst   | 122 ++
 Documentation/crypto/api-rng.rst  |  32 +++
 Documentation/crypto/api-samples.rst  | 224 +
 Documentation/crypto/api-skcipher.rst | 203 
 Documentation/crypto/api.rst  |  24 ++
 Documentation/crypto/architecture.rst | 435 ++
 Documentation/crypto/devel-algos.rst  | 247 +++
 Documentation/crypto/index.rst|  24 ++
 Documentation/crypto/intro.rst|  74 ++
 Documentation/crypto/userspace-if.rst | 387 ++
 Documentation/index.rst   |   1 +
 13 files changed, 1897 insertions(+)
 create mode 100644 Documentation/crypto/api-aead.rst
 create mode 100644 Documentation/crypto/api-akcipher.rst
 create mode 100644 Documentation/crypto/api-digest.rst
 create mode 100644 Documentation/crypto/api-rng.rst
 create mode 100644 Documentation/crypto/api-samples.rst
 create mode 100644 Documentation/crypto/api-skcipher.rst
 create mode 100644 Documentation/crypto/api.rst
 create mode 100644 Documentation/crypto/architecture.rst
 create mode 100644 Documentation/crypto/devel-algos.rst
 create mode 100644 Documentation/crypto/index.rst
 create mode 100644 Documentation/crypto/intro.rst
 create mode 100644 Documentation/crypto/userspace-if.rst

diff --git a/Documentation/crypto/api-aead.rst 
b/Documentation/crypto/api-aead.rst
new file mode 100644
index 000..78a7ce4
--- /dev/null
+++ b/Documentation/crypto/api-aead.rst
@@ -0,0 +1,68 @@
+Authenticated Encryption With Associated Data (AEAD) Algorithm Definitions
+--
+
+.. kernel-doc:: include/crypto/aead.h
+   :doc: Authenticated Encryption With Associated Data (AEAD) Cipher API
+
+.. kernel-doc:: include/crypto/aead.h
+   :functions: aead_request
+
+.. kernel-doc:: include/crypto/aead.h
+   :functions: aead_alg
+
+Authenticated Encryption With Associated Data (AEAD) Cipher API
+---
+
+.. kernel-doc:: include/crypto/aead.h
+   :functions: crypto_alloc_aead
+
+.. kernel-doc:: include/crypto/aead.h
+   :functions: crypto_free_aead
+
+.. kernel-doc:: include/crypto/aead.h
+   :functions: crypto_aead_ivsize
+
+.. kernel-doc:: include/crypto/aead.h
+   :functions: crypto_aead_authsize
+
+.. kernel-doc:: include/crypto/aead.h
+   :functions: crypto_aead_blocksize
+
+.. kernel-doc:: include/crypto/aead.h
+   :functions: crypto_aead_setkey
+
+.. kernel-doc:: include/crypto/aead.h
+   :functions: crypto_aead_setauthsize
+
+.. kernel-doc:: include/crypto/aead.h
+   :functions: crypto_aead_encrypt
+
+.. kernel-doc:: include/crypto/aead.h
+   :functions: crypto_aead_decrypt
+
+Asynchronous AEAD Request Handle
+
+
+.. kernel-doc:: include/crypto/aead.h
+   :doc: Asynchronous AEAD Request Handle
+
+.. kernel-doc:: include/crypto/aead.h
+   :functions: crypto_aead_reqsize
+
+.. kernel-doc:: include/crypto/aead.h
+   :functions: aead_request_set_tfm
+
+.. kernel-doc:: include/crypto/aead.h
+   :functions: aead_request_alloc
+
+.. kernel-doc:: include/crypto/aead.h
+   :functions: aead_request_free
+
+.. kernel-doc:: include/crypto/aead.h
+   :functions: aead_request_set_callback
+
+.. kernel-doc:: include/crypto/aead.h
+   :functions: aead_request_set_crypt
+
+.. kernel-doc:: include/crypto/aead.h
+   :functions: aead_request_set_ad
diff --git a/Documentation/crypto/api-akcipher.rst 
b/Documentation/crypto/api-akcipher.rst
new file mode 100644
index 000..305e616
--- /dev/null
+++ b/Documentation/crypto/api-akcipher.rst
@@ -0,0 +1,56 @@
+Asymmetric Cipher Algorithm Definitions
+---
+
+.. kernel-doc:: include/crypto/akcipher.h
+   :functions: akcipher_alg
+
+.. kernel-doc:: include/crypto/akcipher.h
+   :functions: akcipher_request
+
+Asymmetric Cipher API
+-
+
+.. kernel-doc:: include/crypto/akcipher.h
+   :doc: Generic Public Key API
+
+.. kernel-doc:: include/crypto/akcipher.h
+   :functions: crypto_alloc_akcipher
+
+.. kernel-doc:: include/crypto/akcipher.h
+   :functions: crypto_free_akcipher
+
+.. kernel-doc:: include/crypto/akcipher.h
+   :functions: crypto_akcipher_set_pub_key
+
+.. kernel-doc:: include/crypto/akcipher.h
+   :functions: crypto_akcipher_set_priv_key
+
+Asymmetric Cipher Request Handle
+
+
+.. kernel-doc:: include/crypto/akcipher.h
+   :functions: akcipher_request_alloc
+
+.. kernel-doc:: 

[PATCH v2 5/8] crypto: doc - add KPP documentation

2016-10-20 Thread Stephan Mueller
Add the KPP API documentation to the kernel crypto API Sphinx
documentation. This addition includes the documentation of the
ECDH and DH helpers which are needed to create the approrpiate input
data for the crypto_kpp_set_secret function.

Signed-off-by: Stephan Mueller 
---
 Documentation/crypto/api-kpp.rst  | 92 +++
 Documentation/crypto/api.rst  |  1 +
 Documentation/crypto/architecture.rst |  6 +++
 include/crypto/dh.h   | 58 ++
 include/crypto/ecdh.h | 58 ++
 include/crypto/kpp.h  | 15 --
 6 files changed, 227 insertions(+), 3 deletions(-)
 create mode 100644 Documentation/crypto/api-kpp.rst

diff --git a/Documentation/crypto/api-kpp.rst b/Documentation/crypto/api-kpp.rst
new file mode 100644
index 000..d87be92
--- /dev/null
+++ b/Documentation/crypto/api-kpp.rst
@@ -0,0 +1,92 @@
+Key-agreement Protocol Primitives (KPP) Cipher Algorithm Definitions
+
+
+.. kernel-doc:: include/crypto/kpp.h
+   :functions: kpp_request
+
+.. kernel-doc:: include/crypto/kpp.h
+   :functions: crypto_kpp
+
+.. kernel-doc:: include/crypto/kpp.h
+   :functions: kpp_alg
+
+.. kernel-doc:: include/crypto/kpp.h
+   :functions: kpp_secret
+
+Key-agreement Protocol Primitives (KPP) Cipher API
+--
+
+.. kernel-doc:: include/crypto/kpp.h
+   :doc: Generic Key-agreement Protocol Primitives API
+
+.. kernel-doc:: include/crypto/kpp.h
+   :functions: crypto_alloc_kpp
+
+.. kernel-doc:: include/crypto/kpp.h
+   :functions: crypto_free_kpp
+
+.. kernel-doc:: include/crypto/kpp.h
+   :functions: crypto_kpp_set_secret
+
+.. kernel-doc:: include/crypto/kpp.h
+   :functions: crypto_kpp_generate_public_key
+
+.. kernel-doc:: include/crypto/kpp.h
+   :functions: crypto_kpp_compute_shared_secret
+
+.. kernel-doc:: include/crypto/kpp.h
+   :functions: crypto_kpp_maxsize
+
+Key-agreement Protocol Primitives (KPP) Cipher Request Handle
+-
+
+.. kernel-doc:: include/crypto/kpp.h
+   :functions: kpp_request_alloc
+
+.. kernel-doc:: include/crypto/kpp.h
+   :functions: kpp_request_free
+
+.. kernel-doc:: include/crypto/kpp.h
+   :functions: kpp_request_set_callback
+
+.. kernel-doc:: include/crypto/kpp.h
+   :functions: kpp_request_set_input
+
+.. kernel-doc:: include/crypto/kpp.h
+   :functions: kpp_request_set_output
+
+ECDH Helper Functions
+-
+
+.. kernel-doc:: include/crypto/ecdh.h
+   :doc: ECDH Helper Functions
+
+.. kernel-doc:: include/crypto/ecdh.h
+   :functions: ecdh
+
+.. kernel-doc:: include/crypto/ecdh.h
+   :functions: crypto_ecdh_key_len
+
+.. kernel-doc:: include/crypto/ecdh.h
+   :functions: crypto_ecdh_encode_key
+
+.. kernel-doc:: include/crypto/ecdh.h
+   :functions: crypto_ecdh_decode_key
+
+DH Helper Functions
+---
+
+.. kernel-doc:: include/crypto/dh.h
+   :doc: DH Helper Functions
+
+.. kernel-doc:: include/crypto/dh.h
+   :functions: dh
+
+.. kernel-doc:: include/crypto/dh.h
+   :functions: crypto_dh_key_len
+
+.. kernel-doc:: include/crypto/dh.h
+   :functions: crypto_dh_encode_key
+
+.. kernel-doc:: include/crypto/dh.h
+   :functions: crypto_dh_decode_key
diff --git a/Documentation/crypto/api.rst b/Documentation/crypto/api.rst
index f2bbeb0..2e51919 100644
--- a/Documentation/crypto/api.rst
+++ b/Documentation/crypto/api.rst
@@ -22,3 +22,4 @@ the IV. Different IV generators are available.
api-digest
api-rng
api-akcipher
+   api-kpp
diff --git a/Documentation/crypto/architecture.rst 
b/Documentation/crypto/architecture.rst
index 34e396b..ca2d09b 100644
--- a/Documentation/crypto/architecture.rst
+++ b/Documentation/crypto/architecture.rst
@@ -161,6 +161,9 @@ applicable to a cipher, it is not displayed:
   entry below for the specification of the IV generator type used by
   the cipher implementation)
 
+   -  kpp for a Key-agreement Protocol Primitive (KPP) cipher such as
+  an ECDH or DH implementation
+
 -  blocksize: blocksize of cipher in bytes
 
 -  keysize: key size in bytes
@@ -219,6 +222,9 @@ the aforementioned cipher types:
together with an IV generator (see geniv field in the /proc/crypto
listing for the known IV generators)
 
+-  CRYPTO_ALG_TYPE_KPP Key-agreement Protocol Primitive (KPP) such as
+   an ECDH or DH implementation
+
 -  CRYPTO_ALG_TYPE_DIGEST Raw message digest
 
 -  CRYPTO_ALG_TYPE_HASH Alias for CRYPTO_ALG_TYPE_DIGEST
diff --git a/include/crypto/dh.h b/include/crypto/dh.h
index 5102a8f..6b424ad 100644
--- a/include/crypto/dh.h
+++ b/include/crypto/dh.h
@@ -13,6 +13,27 @@
 #ifndef _CRYPTO_DH_
 #define _CRYPTO_DH_
 
+/**
+ * DOC: DH Helper Functions
+ *
+ * To use DH with the KPP cipher API, the following data structure and
+ * functions should be used.
+ *
+ * To use DH with KPP, the following 

[PATCH v2 7/8] crypto: doc - clarify AEAD memory structure

2016-10-20 Thread Stephan Mueller
The previous description have been misleading and partially incorrect.

Reported-by: Harsh Jain 
Signed-off-by: Stephan Mueller 
---
 crypto/algif_aead.c   | 14 ++
 include/crypto/aead.h | 36 
 2 files changed, 14 insertions(+), 36 deletions(-)

diff --git a/crypto/algif_aead.c b/crypto/algif_aead.c
index 80a0f1a..a0d8377 100644
--- a/crypto/algif_aead.c
+++ b/crypto/algif_aead.c
@@ -551,18 +551,8 @@ static int aead_recvmsg_sync(struct socket *sock, struct 
msghdr *msg, int flags)
lock_sock(sk);
 
/*
-* AEAD memory structure: For encryption, the tag is appended to the
-* ciphertext which implies that the memory allocated for the ciphertext
-* must be increased by the tag length. For decryption, the tag
-* is expected to be concatenated to the ciphertext. The plaintext
-* therefore has a memory size of the ciphertext minus the tag length.
-*
-* The memory structure for cipher operation has the following
-* structure:
-*  AEAD encryption input:  assoc data || plaintext
-*  AEAD encryption output: cipherntext || auth tag
-*  AEAD decryption input:  assoc data || ciphertext || auth tag
-*  AEAD decryption output: plaintext
+* Please see documentation of aead_request_set_crypt for the
+* description of the AEAD memory structure expected from the caller.
 */
 
if (ctx->more) {
diff --git a/include/crypto/aead.h b/include/crypto/aead.h
index e725155..03b9762 100644
--- a/include/crypto/aead.h
+++ b/include/crypto/aead.h
@@ -483,30 +483,18 @@ static inline void aead_request_set_callback(struct 
aead_request *req,
  * destination is the ciphertext. For a decryption operation, the use is
  * reversed - the source is the ciphertext and the destination is the 
plaintext.
  *
- * For both src/dst the layout is associated data, plain/cipher text,
- * authentication tag.
- *
- * The content of the AD in the destination buffer after processing
- * will either be untouched, or it will contain a copy of the AD
- * from the source buffer.  In order to ensure that it always has
- * a copy of the AD, the user must copy the AD over either before
- * or after processing.  Of course this is not relevant if the user
- * is doing in-place processing where src == dst.
- *
- * IMPORTANT NOTE AEAD requires an authentication tag (MAC). For decryption,
- *   the caller must concatenate the ciphertext followed by the
- *   authentication tag and provide the entire data stream to the
- *   decryption operation (i.e. the data length used for the
- *   initialization of the scatterlist and the data length for the
- *   decryption operation is identical). For encryption, however,
- *   the authentication tag is created while encrypting the data.
- *   The destination buffer must hold sufficient space for the
- *   ciphertext and the authentication tag while the encryption
- *   invocation must only point to the plaintext data size. The
- *   following code snippet illustrates the memory usage
- *   buffer = kmalloc(ptbuflen + (enc ? authsize : 0));
- *   sg_init_one(, buffer, ptbuflen + (enc ? authsize : 0));
- *   aead_request_set_crypt(req, , , ptbuflen, iv);
+ * The memory structure for cipher operation has the following structure:
+ *
+ * - AEAD encryption input:  assoc data || plaintext
+ * - AEAD encryption output: assoc data || cipherntext || auth tag
+ * - AEAD decryption input:  assoc data || ciphertext || auth tag
+ * - AEAD decryption output: assoc data || plaintext
+ *
+ * Albeit the kernel requires the presence of the AAD buffer, however,
+ * the kernel does not fill the AAD buffer in the output case. If the
+ * caller wants to have that data buffer filled, the caller must either
+ * use an in-place cipher operation (i.e. same memory location for
+ * input/output memory location).
  */
 static inline void aead_request_set_crypt(struct aead_request *req,
  struct scatterlist *src,
-- 
2.7.4


--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 3/8] crypto: doc - fix source comments for Sphinx

2016-10-20 Thread Stephan Mueller
Update comments to avoid any complaints from Sphinx during compilation.

Signed-off-by: Stephan Mueller 
---
 include/crypto/aead.h | 14 +++---
 include/crypto/hash.h |  2 +-
 include/crypto/skcipher.h |  4 ++--
 include/linux/crypto.h|  4 ++--
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/include/crypto/aead.h b/include/crypto/aead.h
index 12f8432..e725155 100644
--- a/include/crypto/aead.h
+++ b/include/crypto/aead.h
@@ -55,14 +55,14 @@
  * The scatter list pointing to the input data must contain:
  *
  * * for RFC4106 ciphers, the concatenation of
- * associated authentication data || IV || plaintext or ciphertext. Note, the
- * same IV (buffer) is also set with the aead_request_set_crypt call. Note,
- * the API call of aead_request_set_ad must provide the length of the AAD and
- * the IV. The API call of aead_request_set_crypt only points to the size of
- * the input plaintext or ciphertext.
+ *   associated authentication data || IV || plaintext or ciphertext. Note, the
+ *   same IV (buffer) is also set with the aead_request_set_crypt call. Note,
+ *   the API call of aead_request_set_ad must provide the length of the AAD and
+ *   the IV. The API call of aead_request_set_crypt only points to the size of
+ *   the input plaintext or ciphertext.
  *
  * * for "normal" AEAD ciphers, the concatenation of
- * associated authentication data || plaintext or ciphertext.
+ *   associated authentication data || plaintext or ciphertext.
  *
  * It is important to note that if multiple scatter gather list entries form
  * the input data mentioned above, the first entry must not point to a NULL
@@ -452,7 +452,7 @@ static inline void aead_request_free(struct aead_request 
*req)
  * completes
  *
  * The callback function is registered with the aead_request handle and
- * must comply with the following template
+ * must comply with the following template::
  *
  * void callback_function(struct crypto_async_request *req, int error)
  */
diff --git a/include/crypto/hash.h b/include/crypto/hash.h
index 2660588..216a2b8 100644
--- a/include/crypto/hash.h
+++ b/include/crypto/hash.h
@@ -605,7 +605,7 @@ static inline struct ahash_request *ahash_request_cast(
  * the cipher operation completes.
  *
  * The callback function is registered with the _request handle and
- * must comply with the following template
+ * must comply with the following template::
  *
  * void callback_function(struct crypto_async_request *req, int error)
  */
diff --git a/include/crypto/skcipher.h b/include/crypto/skcipher.h
index cc4d98a..750b14f 100644
--- a/include/crypto/skcipher.h
+++ b/include/crypto/skcipher.h
@@ -516,7 +516,7 @@ static inline void skcipher_request_zero(struct 
skcipher_request *req)
  * skcipher_request_set_callback() - set asynchronous callback function
  * @req: request handle
  * @flags: specify zero or an ORing of the flags
- * CRYPTO_TFM_REQ_MAY_BACKLOG the request queue may back log and
+ *CRYPTO_TFM_REQ_MAY_BACKLOG the request queue may back log and
  *increase the wait queue beyond the initial maximum size;
  *CRYPTO_TFM_REQ_MAY_SLEEP the request processing may sleep
  * @compl: callback function pointer to be registered with the request handle
@@ -533,7 +533,7 @@ static inline void skcipher_request_zero(struct 
skcipher_request *req)
  * cipher operation completes.
  *
  * The callback function is registered with the skcipher_request handle and
- * must comply with the following template
+ * must comply with the following template::
  *
  * void callback_function(struct crypto_async_request *req, int error)
  */
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index 7cee555..faf8127 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -960,7 +960,7 @@ static inline void ablkcipher_request_free(struct 
ablkcipher_request *req)
  * ablkcipher_request_set_callback() - set asynchronous callback function
  * @req: request handle
  * @flags: specify zero or an ORing of the flags
- * CRYPTO_TFM_REQ_MAY_BACKLOG the request queue may back log and
+ *CRYPTO_TFM_REQ_MAY_BACKLOG the request queue may back log and
  *increase the wait queue beyond the initial maximum size;
  *CRYPTO_TFM_REQ_MAY_SLEEP the request processing may sleep
  * @compl: callback function pointer to be registered with the request handle
@@ -977,7 +977,7 @@ static inline void ablkcipher_request_free(struct 
ablkcipher_request *req)
  * cipher operation completes.
  *
  * The callback function is registered with the ablkcipher_request handle and
- * must comply with the following template
+ * must comply with the following template::
  *
  * void callback_function(struct crypto_async_request *req, int error)
  */
-- 
2.7.4


--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  

[PATCH v2 8/8] crypto: doc - optimize compilation

2016-10-20 Thread Stephan Mueller
The :functions: definition allows the specification of multiple
function references which prevents parsing the header file multiple
times.

Reported-by: Jani Nikula 
Signed-off-by: Stephan Mueller 
---
 Documentation/crypto/api-aead.rst |  51 +---
 Documentation/crypto/api-akcipher.rst |  42 +-
 Documentation/crypto/api-digest.rst   |  95 +
 Documentation/crypto/api-kpp.rst  |  64 ++
 Documentation/crypto/api-rng.rst  |  20 +
 Documentation/crypto/api-skcipher.rst | 152 ++
 6 files changed, 23 insertions(+), 401 deletions(-)

diff --git a/Documentation/crypto/api-aead.rst 
b/Documentation/crypto/api-aead.rst
index 78a7ce4..d15256f 100644
--- a/Documentation/crypto/api-aead.rst
+++ b/Documentation/crypto/api-aead.rst
@@ -5,40 +5,13 @@ Authenticated Encryption With Associated Data (AEAD) 
Algorithm Definitions
:doc: Authenticated Encryption With Associated Data (AEAD) Cipher API
 
 .. kernel-doc:: include/crypto/aead.h
-   :functions: aead_request
-
-.. kernel-doc:: include/crypto/aead.h
-   :functions: aead_alg
+   :functions: aead_request aead_alg
 
 Authenticated Encryption With Associated Data (AEAD) Cipher API
 ---
 
 .. kernel-doc:: include/crypto/aead.h
-   :functions: crypto_alloc_aead
-
-.. kernel-doc:: include/crypto/aead.h
-   :functions: crypto_free_aead
-
-.. kernel-doc:: include/crypto/aead.h
-   :functions: crypto_aead_ivsize
-
-.. kernel-doc:: include/crypto/aead.h
-   :functions: crypto_aead_authsize
-
-.. kernel-doc:: include/crypto/aead.h
-   :functions: crypto_aead_blocksize
-
-.. kernel-doc:: include/crypto/aead.h
-   :functions: crypto_aead_setkey
-
-.. kernel-doc:: include/crypto/aead.h
-   :functions: crypto_aead_setauthsize
-
-.. kernel-doc:: include/crypto/aead.h
-   :functions: crypto_aead_encrypt
-
-.. kernel-doc:: include/crypto/aead.h
-   :functions: crypto_aead_decrypt
+   :functions: crypto_alloc_aead crypto_free_aead crypto_aead_ivsize 
crypto_aead_authsize crypto_aead_blocksize crypto_aead_setkey 
crypto_aead_setauthsize crypto_aead_encrypt crypto_aead_decrypt
 
 Asynchronous AEAD Request Handle
 
@@ -47,22 +20,4 @@ Asynchronous AEAD Request Handle
:doc: Asynchronous AEAD Request Handle
 
 .. kernel-doc:: include/crypto/aead.h
-   :functions: crypto_aead_reqsize
-
-.. kernel-doc:: include/crypto/aead.h
-   :functions: aead_request_set_tfm
-
-.. kernel-doc:: include/crypto/aead.h
-   :functions: aead_request_alloc
-
-.. kernel-doc:: include/crypto/aead.h
-   :functions: aead_request_free
-
-.. kernel-doc:: include/crypto/aead.h
-   :functions: aead_request_set_callback
-
-.. kernel-doc:: include/crypto/aead.h
-   :functions: aead_request_set_crypt
-
-.. kernel-doc:: include/crypto/aead.h
-   :functions: aead_request_set_ad
+   :functions: crypto_aead_reqsize aead_request_set_tfm aead_request_alloc 
aead_request_free aead_request_set_callback aead_request_set_crypt 
aead_request_set_ad
diff --git a/Documentation/crypto/api-akcipher.rst 
b/Documentation/crypto/api-akcipher.rst
index 49e0ab6..40aa874 100644
--- a/Documentation/crypto/api-akcipher.rst
+++ b/Documentation/crypto/api-akcipher.rst
@@ -2,10 +2,7 @@ Asymmetric Cipher Algorithm Definitions
 ---
 
 .. kernel-doc:: include/crypto/akcipher.h
-   :functions: akcipher_alg
-
-.. kernel-doc:: include/crypto/akcipher.h
-   :functions: akcipher_request
+   :functions: akcipher_alg akcipher_request
 
 Asymmetric Cipher API
 -
@@ -14,43 +11,10 @@ Asymmetric Cipher API
:doc: Generic Public Key API
 
 .. kernel-doc:: include/crypto/akcipher.h
-   :functions: crypto_alloc_akcipher
-
-.. kernel-doc:: include/crypto/akcipher.h
-   :functions: crypto_free_akcipher
-
-.. kernel-doc:: include/crypto/akcipher.h
-   :functions: crypto_akcipher_set_pub_key
-
-.. kernel-doc:: include/crypto/akcipher.h
-   :functions: crypto_akcipher_set_priv_key
-
-.. kernel-doc:: include/crypto/akcipher.h
-   :functions: crypto_akcipher_maxsize
-
-.. kernel-doc:: include/crypto/akcipher.h
-   :functions: crypto_akcipher_encrypt
-
-.. kernel-doc:: include/crypto/akcipher.h
-   :functions: crypto_akcipher_decrypt
-
-.. kernel-doc:: include/crypto/akcipher.h
-   :functions: crypto_akcipher_sign
-
-.. kernel-doc:: include/crypto/akcipher.h
-   :functions: crypto_akcipher_verify
+   :functions: crypto_alloc_akcipher crypto_free_akcipher 
crypto_akcipher_set_pub_key crypto_akcipher_set_priv_key 
crypto_akcipher_maxsize crypto_akcipher_encrypt crypto_akcipher_decrypt 
crypto_akcipher_sign crypto_akcipher_verify
 
 Asymmetric Cipher Request Handle
 
 
 .. kernel-doc:: include/crypto/akcipher.h
-   :functions: akcipher_request_alloc
-
-.. kernel-doc:: include/crypto/akcipher.h
-   :functions: akcipher_request_free
-
-.. kernel-doc:: 

Re: [PATCH v9 1/8] crypto: add asynchronous compression api

2016-10-20 Thread Herbert Xu
On Thu, Sep 29, 2016 at 11:18:55AM +0100, Giovanni Cabiddu wrote:
>
> + if (nla_put(skb, CRYPTOCFGA_REPORT_COMPRESS,
> + sizeof(struct crypto_report_comp), ))
> + goto nla_put_failure;

This bit doesn't compile for me.  Please fix up and resubmit.

../crypto/crypto_user.c: In function ‘crypto_report_acomp’:
../crypto/crypto_user.c:117:29: error: storage size of ‘racomp’ isn’t known
../crypto/crypto_user.c:121:19: error: ‘CRYPTOCFGA_REPORT_ACOMPRESS’ undeclared 
(first use in this function)
../crypto/crypto_user.c:121:19: note: each undeclared identifier is reported 
only once for each function it appears in
../crypto/crypto_user.c:122:14: error: invalid application of ‘sizeof’ to 
incomplete type ‘struct crypto_report_acomp’
../crypto/crypto_user.c:117:29: warning: unused variable ‘racomp’ 
[-Wunused-variable]

Thanks,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/6] chcr: Remove malloc/free

2016-10-20 Thread Herbert Xu
On Thu, Oct 13, 2016 at 04:39:35PM +0530, Harsh Jain wrote:
> Remove malloc/free in crypto operation and allocate memory via cra_ctxsize.
> Added new structure chcr_wr to populate Work Request Header.
> Fixes: 324429d74127 (chcr: Support for Chelsio's Crypto Hardware)

Do you mean the reqsize as opposed to ctxsize since the latter is
shared by all tfm users?

In any case, your patch doesn't seem to change the size setting?

Cheers,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH][TRIVIAL] crypto: ccp - fix typo "CPP"

2016-10-20 Thread Gary R Hook

On 10/20/2016 02:20 PM, Paul Bolle wrote:

The abbreviation for Cryptographic Coprocessor is "CCP".

Signed-off-by: Paul Bolle 


Acked-by: Gary R Hook 


---
 include/linux/ccp.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/ccp.h b/include/linux/ccp.h
index a7653339fedb..c71dd8fa5764 100644
--- a/include/linux/ccp.h
+++ b/include/linux/ccp.h
@@ -11,8 +11,8 @@
  * published by the Free Software Foundation.
  */

-#ifndef __CPP_H__
-#define __CPP_H__
+#ifndef __CCP_H__
+#define __CCP_H__

 #include 
 #include 
@@ -553,7 +553,7 @@ enum ccp_engine {
 #define CCP_CMD_PASSTHRU_NO_DMA_MAP0x0002

 /**
- * struct ccp_cmd - CPP operation request
+ * struct ccp_cmd - CCP operation request
  * @entry: list element (ccp driver use only)
  * @work: work element used for callbacks (ccp driver use only)
  * @ccp: CCP device to be run on (ccp driver use only)



--
This is my day job. Follow me at:
IG/Twitter/Facebook: @grhookphoto
IG/Twitter/Facebook: @grhphotographer
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH][TRIVIAL] crypto: ccp - fix typo "CPP"

2016-10-20 Thread Paul Bolle
The abbreviation for Cryptographic Coprocessor is "CCP".

Signed-off-by: Paul Bolle 
---
 include/linux/ccp.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/ccp.h b/include/linux/ccp.h
index a7653339fedb..c71dd8fa5764 100644
--- a/include/linux/ccp.h
+++ b/include/linux/ccp.h
@@ -11,8 +11,8 @@
  * published by the Free Software Foundation.
  */
 
-#ifndef __CPP_H__
-#define __CPP_H__
+#ifndef __CCP_H__
+#define __CCP_H__
 
 #include 
 #include 
@@ -553,7 +553,7 @@ enum ccp_engine {
 #define CCP_CMD_PASSTHRU_NO_DMA_MAP0x0002
 
 /**
- * struct ccp_cmd - CPP operation request
+ * struct ccp_cmd - CCP operation request
  * @entry: list element (ccp driver use only)
  * @work: work element used for callbacks (ccp driver use only)
  * @ccp: CCP device to be run on (ccp driver use only)
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] hwrng: meson: Remove unneeded platform MODULE_ALIAS

2016-10-20 Thread Kevin Hilman
Javier Martinez Canillas  writes:

> The Amlogic Meson is a DT-only platform, which means the devices are
> registered via OF and not using the legacy platform devices support.
>
> So there's no need to have a MODULE_ALIAS("platform:meson-rng") since
> the reported uevent MODALIAS to user-space will always be the OF one.
>
> Signed-off-by: Javier Martinez Canillas 

Acked-by: Kevin Hilman 

> ---
>
>  drivers/char/hw_random/meson-rng.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/char/hw_random/meson-rng.c 
> b/drivers/char/hw_random/meson-rng.c
> index 51864a509be7..119d698439ae 100644
> --- a/drivers/char/hw_random/meson-rng.c
> +++ b/drivers/char/hw_random/meson-rng.c
> @@ -122,7 +122,6 @@ static struct platform_driver meson_rng_driver = {
>  
>  module_platform_driver(meson_rng_driver);
>  
> -MODULE_ALIAS("platform:meson-rng");
>  MODULE_DESCRIPTION("Meson H/W Random Number Generator driver");
>  MODULE_AUTHOR("Lawrence Mok ");
>  MODULE_AUTHOR("Neil Armstrong ");
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 0/8] Add support for SafeXcel IP-76 to OMAP RNG

2016-10-20 Thread Romain Perier

Hello,

Le 26/09/2016 à 12:01, Romain Perier a écrit :



Le 16/09/2016 14:52, Romain Perier a écrit :

Hello,

Le 16/09/2016 12:08, Romain Perier a écrit :

The driver omap-rng has a lot of similarity with the IP block SafeXcel
IP-76. A lot of registers are the same and the way that the driver works
is very closed the description of the TRNG EIP76 in its datasheet.

This series refactorize the driver, add support for generating bigger
output random data and add a device variant for SafeXcel IP-76, found
in Armada 8K.

Romain Perier (8):
   dt-bindings: Add vendor prefix for INSIDE Secure
   dt-bindings: omap-rng: Document SafeXcel IP-76 device variant
   hwrng: omap - Switch to non-obsolete read API implementation
   hwrng: omap - Remove global definition of hwrng
   hwrng: omap - Add support for 128-bit output of data
   hwrng: omap - Don't prefix the probe message with OMAP
   hwrng: omap - Add device variant for SafeXcel IP-76 found in
Armada 8K
   arm64: dts: marvell: add TRNG description for Armada 8K CP

  Documentation/devicetree/bindings/rng/omap_rng.txt |  14 +-
  .../devicetree/bindings/vendor-prefixes.txt|   1 +
  .../boot/dts/marvell/armada-cp110-master.dtsi  |   8 +
  .../arm64/boot/dts/marvell/armada-cp110-slave.dtsi |   8 +
  drivers/char/hw_random/Kconfig |   2 +-
  drivers/char/hw_random/omap-rng.c  | 162
-
  6 files changed, 152 insertions(+), 43 deletions(-)



If possible, I would like to get "Tested-by" tags by the omap guys
before this set of patches is merged, to be sure that there are no
regressions for the OMAP variant.

Thanks,


Added omap ML to Cc:

Romain,


Without any feedbacks from the OMAP guys, could you merge please ? 
Regressions can be detected in "next" and then fixed.


Regards,
Romain
--
Romain Perier, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html