Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Browse files Browse the repository at this point in the history
Pull crypto updates from Herbert Xu:
 "API:
   - Add library interfaces of certain crypto algorithms for WireGuard
   - Remove the obsolete ablkcipher and blkcipher interfaces
   - Move add_early_randomness() out of rng_mutex

  Algorithms:
   - Add blake2b shash algorithm
   - Add blake2s shash algorithm
   - Add curve25519 kpp algorithm
   - Implement 4 way interleave in arm64/gcm-ce
   - Implement ciphertext stealing in powerpc/spe-xts
   - Add Eric Biggers's scalar accelerated ChaCha code for ARM
   - Add accelerated 32r2 code from Zinc for MIPS
   - Add OpenSSL/CRYPTOGRAMS poly1305 implementation for ARM and MIPS

  Drivers:
   - Fix entropy reading failures in ks-sa
   - Add support for sam9x60 in atmel
   - Add crypto accelerator for amlogic GXL
   - Add sun8i-ce Crypto Engine
   - Add sun8i-ss cryptographic offloader
   - Add a host of algorithms to inside-secure
   - Add NPCM RNG driver
   - add HiSilicon HPRE accelerator
   - Add HiSilicon TRNG driver"

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (285 commits)
  crypto: vmx - Avoid weird build failures
  crypto: lib/chacha20poly1305 - use chacha20_crypt()
  crypto: x86/chacha - only unregister algorithms if registered
  crypto: chacha_generic - remove unnecessary setkey() functions
  crypto: amlogic - enable working on big endian kernel
  crypto: sun8i-ce - enable working on big endian
  crypto: mips/chacha - select CRYPTO_SKCIPHER, not CRYPTO_BLKCIPHER
  hwrng: ks-sa - Enable COMPILE_TEST
  crypto: essiv - remove redundant null pointer check before kfree
  crypto: atmel-aes - Change data type for "lastc" buffer
  crypto: atmel-tdes - Set the IV after {en,de}crypt
  crypto: sun4i-ss - fix big endian issues
  crypto: sun4i-ss - hide the Invalid keylen message
  crypto: sun4i-ss - use crypto_ahash_digestsize
  crypto: sun4i-ss - remove dependency on not 64BIT
  crypto: sun4i-ss - Fix 64-bit size_t warnings on sun4i-ss-hash.c
  MAINTAINERS: Add maintainer for HiSilicon SEC V2 driver
  crypto: hisilicon - add DebugFS for HiSilicon SEC
  Documentation: add DebugFS doc for HiSilicon SEC
  crypto: hisilicon - add SRIOV for HiSilicon SEC
  ...
  • Loading branch information
torvalds committed Nov 26, 2019
2 parents f838767 + 4ee812f commit 642356c
Show file tree
Hide file tree
Showing 291 changed files with 47,109 additions and 11,394 deletions.
57 changes: 57 additions & 0 deletions Documentation/ABI/testing/debugfs-hisi-hpre
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
What: /sys/kernel/debug/hisi_hpre/<bdf>/cluster[0-3]/regs
Date: Sep 2019
Contact: [email protected]
Description: Dump debug registers from the HPRE cluster.
Only available for PF.

What: /sys/kernel/debug/hisi_hpre/<bdf>/cluster[0-3]/cluster_ctrl
Date: Sep 2019
Contact: [email protected]
Description: Write the HPRE core selection in the cluster into this file,
and then we can read the debug information of the core.
Only available for PF.

What: /sys/kernel/debug/hisi_hpre/<bdf>/rdclr_en
Date: Sep 2019
Contact: [email protected]
Description: HPRE cores debug registers read clear control. 1 means enable
register read clear, otherwise 0. Writing to this file has no
functional effect, only enable or disable counters clear after
reading of these registers.
Only available for PF.

What: /sys/kernel/debug/hisi_hpre/<bdf>/current_qm
Date: Sep 2019
Contact: [email protected]
Description: One HPRE controller has one PF and multiple VFs, each function
has a QM. Select the QM which below qm refers to.
Only available for PF.

What: /sys/kernel/debug/hisi_hpre/<bdf>/regs
Date: Sep 2019
Contact: [email protected]
Description: Dump debug registers from the HPRE.
Only available for PF.

What: /sys/kernel/debug/hisi_hpre/<bdf>/qm/qm_regs
Date: Sep 2019
Contact: [email protected]
Description: Dump debug registers from the QM.
Available for PF and VF in host. VF in guest currently only
has one debug register.

What: /sys/kernel/debug/hisi_hpre/<bdf>/qm/current_q
Date: Sep 2019
Contact: [email protected]
Description: One QM may contain multiple queues. Select specific queue to
show its debug registers in above qm_regs.
Only available for PF.

What: /sys/kernel/debug/hisi_hpre/<bdf>/qm/clear_enable
Date: Sep 2019
Contact: [email protected]
Description: QM debug registers(qm_regs) read clear control. 1 means enable
register read clear, otherwise 0.
Writing to this file has no functional effect, only enable or
disable counters clear after reading of these registers.
Only available for PF.
43 changes: 43 additions & 0 deletions Documentation/ABI/testing/debugfs-hisi-sec
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
What: /sys/kernel/debug/hisi_sec/<bdf>/sec_dfx
Date: Oct 2019
Contact: [email protected]
Description: Dump the debug registers of SEC cores.
Only available for PF.

What: /sys/kernel/debug/hisi_sec/<bdf>/clear_enable
Date: Oct 2019
Contact: [email protected]
Description: Enabling/disabling of clear action after reading
the SEC debug registers.
0: disable, 1: enable.
Only available for PF, and take no other effect on SEC.

What: /sys/kernel/debug/hisi_sec/<bdf>/current_qm
Date: Oct 2019
Contact: [email protected]
Description: One SEC controller has one PF and multiple VFs, each function
has a QM. This file can be used to select the QM which below
qm refers to.
Only available for PF.

What: /sys/kernel/debug/hisi_sec/<bdf>/qm/qm_regs
Date: Oct 2019
Contact: [email protected]
Description: Dump of QM related debug registers.
Available for PF and VF in host. VF in guest currently only
has one debug register.

What: /sys/kernel/debug/hisi_sec/<bdf>/qm/current_q
Date: Oct 2019
Contact: [email protected]
Description: One QM of SEC may contain multiple queues. Select specific
queue to show its debug registers in above 'qm_regs'.
Only available for PF.

What: /sys/kernel/debug/hisi_sec/<bdf>/qm/clear_enable
Date: Oct 2019
Contact: [email protected]
Description: Enabling/disabling of clear action after reading
the SEC's QM debug registers.
0: disable, 1: enable.
Only available for PF, and take no other effect on SEC.
29 changes: 1 addition & 28 deletions Documentation/crypto/api-skcipher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Block Cipher Algorithm Definitions
:doc: Block Cipher Algorithm Definitions

.. kernel-doc:: include/linux/crypto.h
:functions: crypto_alg ablkcipher_alg blkcipher_alg cipher_alg compress_alg
:functions: crypto_alg cipher_alg compress_alg

Symmetric Key Cipher API
------------------------
Expand Down Expand Up @@ -33,30 +33,3 @@ Single Block Cipher API

.. kernel-doc:: include/linux/crypto.h
:functions: crypto_alloc_cipher crypto_free_cipher crypto_has_cipher crypto_cipher_blocksize crypto_cipher_setkey crypto_cipher_encrypt_one crypto_cipher_decrypt_one

Asynchronous Block Cipher API - Deprecated
------------------------------------------

.. kernel-doc:: include/linux/crypto.h
:doc: Asynchronous Block Cipher API

.. kernel-doc:: include/linux/crypto.h
:functions: crypto_free_ablkcipher crypto_has_ablkcipher crypto_ablkcipher_ivsize crypto_ablkcipher_blocksize crypto_ablkcipher_setkey crypto_ablkcipher_reqtfm crypto_ablkcipher_encrypt crypto_ablkcipher_decrypt

Asynchronous Cipher Request Handle - Deprecated
-----------------------------------------------

.. kernel-doc:: include/linux/crypto.h
:doc: Asynchronous Cipher Request Handle

.. kernel-doc:: include/linux/crypto.h
:functions: crypto_ablkcipher_reqsize ablkcipher_request_set_tfm ablkcipher_request_alloc ablkcipher_request_free ablkcipher_request_set_callback ablkcipher_request_set_crypt

Synchronous Block Cipher API - Deprecated
-----------------------------------------

.. kernel-doc:: include/linux/crypto.h
:doc: Synchronous Block Cipher API

.. kernel-doc:: include/linux/crypto.h
:functions: crypto_alloc_blkcipher crypto_free_blkcipher crypto_has_blkcipher crypto_blkcipher_name crypto_blkcipher_ivsize crypto_blkcipher_blocksize crypto_blkcipher_setkey crypto_blkcipher_encrypt crypto_blkcipher_encrypt_iv crypto_blkcipher_decrypt crypto_blkcipher_decrypt_iv crypto_blkcipher_set_iv crypto_blkcipher_get_iv
4 changes: 0 additions & 4 deletions Documentation/crypto/architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,6 @@ the aforementioned cipher types:
- CRYPTO_ALG_TYPE_AEAD Authenticated Encryption with Associated Data
(MAC)

- CRYPTO_ALG_TYPE_BLKCIPHER Synchronous multi-block cipher

- CRYPTO_ALG_TYPE_ABLKCIPHER Asynchronous multi-block cipher

- CRYPTO_ALG_TYPE_KPP Key-agreement Protocol Primitive (KPP) such as
an ECDH or DH implementation

Expand Down
4 changes: 0 additions & 4 deletions Documentation/crypto/crypto_engine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ request by using:
When your driver receives a crypto_request, you must to transfer it to
the crypto engine via one of:

* crypto_transfer_ablkcipher_request_to_engine()

* crypto_transfer_aead_request_to_engine()

* crypto_transfer_akcipher_request_to_engine()
Expand All @@ -75,8 +73,6 @@ the crypto engine via one of:

At the end of the request process, a call to one of the following functions is needed:

* crypto_finalize_ablkcipher_request()

* crypto_finalize_aead_request()

* crypto_finalize_akcipher_request()
Expand Down
27 changes: 11 additions & 16 deletions Documentation/crypto/devel-algos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -128,25 +128,20 @@ process requests that are unaligned. This implies, however, additional
overhead as the kernel crypto API needs to perform the realignment of
the data which may imply moving of data.

Cipher Definition With struct blkcipher_alg and ablkcipher_alg
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Cipher Definition With struct skcipher_alg
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Struct blkcipher_alg defines a synchronous block cipher whereas struct
ablkcipher_alg defines an asynchronous block cipher.
Struct skcipher_alg defines a multi-block cipher, or more generally, a
length-preserving symmetric cipher algorithm.

Please refer to the single block cipher description for schematics of
the block cipher usage.
Scatterlist handling
~~~~~~~~~~~~~~~~~~~~

Specifics Of Asynchronous Multi-Block Cipher
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

There are a couple of specifics to the asynchronous interface.

First of all, some of the drivers will want to use the Generic
ScatterWalk in case the hardware needs to be fed separate chunks of the
scatterlist which contains the plaintext and will contain the
ciphertext. Please refer to the ScatterWalk interface offered by the
Linux kernel scatter / gather list implementation.
Some drivers will want to use the Generic ScatterWalk in case the
hardware needs to be fed separate chunks of the scatterlist which
contains the plaintext and will contain the ciphertext. Please refer
to the ScatterWalk interface offered by the Linux kernel scatter /
gather list implementation.

Hashing [HASH]
--------------
Expand Down
60 changes: 60 additions & 0 deletions Documentation/devicetree/bindings/crypto/allwinner,sun8i-ss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/crypto/allwinner,sun8i-ss.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Allwinner Security System v2 driver

maintainers:
- Corentin Labbe <[email protected]>

properties:
compatible:
enum:
- allwinner,sun8i-a83t-crypto
- allwinner,sun9i-a80-crypto

reg:
maxItems: 1

interrupts:
maxItems: 1

clocks:
items:
- description: Bus clock
- description: Module clock

clock-names:
items:
- const: bus
- const: mod

resets:
maxItems: 1

required:
- compatible
- reg
- interrupts
- clocks
- clock-names
- resets

additionalProperties: false

examples:
- |
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/sun8i-a83t-ccu.h>
#include <dt-bindings/reset/sun8i-a83t-ccu.h>
crypto: crypto@1c15000 {
compatible = "allwinner,sun8i-a83t-crypto";
reg = <0x01c15000 0x1000>;
interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>;
resets = <&ccu RST_BUS_SS>;
clocks = <&ccu CLK_BUS_SS>, <&ccu CLK_SS>;
clock-names = "bus", "mod";
};
52 changes: 52 additions & 0 deletions Documentation/devicetree/bindings/crypto/amlogic,gxl-crypto.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/crypto/amlogic,gxl-crypto.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Amlogic GXL Cryptographic Offloader

maintainers:
- Corentin Labbe <[email protected]>

properties:
compatible:
items:
- const: amlogic,gxl-crypto

reg:
maxItems: 1

interrupts:
items:
- description: "Interrupt for flow 0"
- description: "Interrupt for flow 1"

clocks:
maxItems: 1

clock-names:
const: blkmv

required:
- compatible
- reg
- interrupts
- clocks
- clock-names

additionalProperties: false

examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/gxbb-clkc.h>
crypto: crypto-engine@c883e000 {
compatible = "amlogic,gxl-crypto";
reg = <0x0 0xc883e000 0x0 0x36>;
interrupts = <GIC_SPI 188 IRQ_TYPE_EDGE_RISING>, <GIC_SPI 189 IRQ_TYPE_EDGE_RISING>;
clocks = <&clkc CLKID_BLKMV>;
clock-names = "blkmv";
};
2 changes: 1 addition & 1 deletion Documentation/devicetree/bindings/rng/atmel-trng.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Atmel TRNG (True Random Number Generator) block

Required properties:
- compatible : Should be "atmel,at91sam9g45-trng"
- compatible : Should be "atmel,at91sam9g45-trng" or "microchip,sam9x60-trng"
- reg : Offset and length of the register set of this block
- interrupts : the interrupt number for the TRNG block
- clocks: should contain the TRNG clk source
Expand Down
12 changes: 12 additions & 0 deletions Documentation/devicetree/bindings/rng/nuvoton,npcm-rng.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
NPCM SoC Random Number Generator

Required properties:
- compatible : "nuvoton,npcm750-rng" for the NPCM7XX BMC.
- reg : Specifies physical base address and size of the registers.

Example:

rng: rng@f000b000 {
compatible = "nuvoton,npcm750-rng";
reg = <0xf000b000 0x8>;
};
27 changes: 27 additions & 0 deletions Documentation/devicetree/bindings/rng/omap3_rom_rng.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
OMAP ROM RNG driver binding

Secure SoCs may provide RNG via secure ROM calls like Nokia N900 does. The
implementation can depend on the SoC secure ROM used.

- compatible:
Usage: required
Value type: <string>
Definition: must be "nokia,n900-rom-rng"

- clocks:
Usage: required
Value type: <prop-encoded-array>
Definition: reference to the the RNG interface clock

- clock-names:
Usage: required
Value type: <stringlist>
Definition: must be "ick"

Example:

rom_rng: rng {
compatible = "nokia,n900-rom-rng";
clocks = <&rng_ick>;
clock-names = "ick";
};
17 changes: 17 additions & 0 deletions Documentation/devicetree/bindings/rng/samsung,exynos5250-trng.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Exynos True Random Number Generator

Required properties:

- compatible : Should be "samsung,exynos5250-trng".
- reg : Specifies base physical address and size of the registers map.
- clocks : Phandle to clock-controller plus clock-specifier pair.
- clock-names : "secss" as a clock name.

Example:

rng@10830600 {
compatible = "samsung,exynos5250-trng";
reg = <0x10830600 0x100>;
clocks = <&clock CLK_SSS>;
clock-names = "secss";
};
Loading

0 comments on commit 642356c

Please sign in to comment.