Commit 64e7003c authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull crypto updates from Herbert Xu:
 "API:
   - Optimise away self-test overhead when they are disabled
   - Support symmetric encryption via keyring keys in af_alg
   - Flip hwrng default_quality, the default is now maximum entropy

  Algorithms:
   - Add library version of aesgcm
   - CFI fixes for assembly code
   - Add arm/arm64 accelerated versions of sm3/sm4

  Drivers:
   - Remove assumption on arm64 that kmalloc is DMA-aligned
   - Fix selftest failures in rockchip
   - Add support for RK3328/RK3399 in rockchip
   - Add deflate support in qat
   - Merge ux500 into stm32
   - Add support for TEE for PCI ID 0x14CA in ccp
   - Add mt7986 support in mtk
   - Add MaxLinear platform support in inside-secure
   - Add NPCM8XX support in npcm"

* tag 'v6.2-p1' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (184 commits)
  crypto: ux500/cryp - delete driver
  crypto: stm32/cryp - enable for use with Ux500
  crypto: stm32 - enable drivers to be used on Ux500
  dt-bindings: crypto: Let STM32 define Ux500 CRYP
  hwrng: geode - Fix PCI device refcount leak
  hwrng: amd - Fix PCI device refcount leak
  crypto: qce - Set DMA alignment explicitly
  crypto: octeontx2 - Set DMA alignment explicitly
  crypto: octeontx - Set DMA alignment explicitly
  crypto: keembay - Set DMA alignment explicitly
  crypto: safexcel - Set DMA alignment explicitly
  crypto: hisilicon/hpre - Set DMA alignment explicitly
  crypto: chelsio - Set DMA alignment explicitly
  crypto: ccree - Set DMA alignment explicitly
  crypto: ccp - Set DMA alignment explicitly
  crypto: cavium - Set DMA alignment explicitly
  crypto: img-hash - Fix variable dereferenced before check 'hdev->req'
  crypto: arm64/ghash-ce - use frame_push/pop macros consistently
  crypto: arm64/crct10dif - use frame_push/pop macros consistently
  crypto: arm64/aes-modes - use frame_push/pop macros consistently
  ...
parents 48ea09cd 453de3eb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -172,7 +172,7 @@ Here are schematics of how these functions are called when operated from
other part of the kernel. Note that the .setkey() call might happen
before or after any of these schematics happen, but must not happen
during any of these are in-flight. Please note that calling .init()
followed immediately by .finish() is also a perfectly valid
followed immediately by .final() is also a perfectly valid
transformation.

::
+12 −3
Original line number Diff line number Diff line
@@ -131,9 +131,9 @@ from the kernel crypto API. If the buffer is too small for the message
digest, the flag MSG_TRUNC is set by the kernel.

In order to set a message digest key, the calling application must use
the setsockopt() option of ALG_SET_KEY. If the key is not set the HMAC
operation is performed without the initial HMAC state change caused by
the key.
the setsockopt() option of ALG_SET_KEY or ALG_SET_KEY_BY_KEY_SERIAL. If the
key is not set the HMAC operation is performed without the initial HMAC state
change caused by the key.

Symmetric Cipher API
--------------------
@@ -382,6 +382,15 @@ mentioned optname:

   -  the RNG cipher type to provide the seed

- ALG_SET_KEY_BY_KEY_SERIAL -- Setting the key via keyring key_serial_t.
   This operation behaves the same as ALG_SET_KEY. The decrypted
   data is copied from a keyring key, and uses that data as the
   key for symmetric encryption.

   The passed in key_serial_t must have the KEY_(POS|USR|GRP|OTH)_SEARCH
   permission set, otherwise -EPERM is returned. Supports key types: user,
   logon, encrypted, and trusted.

-  ALG_SET_AEAD_AUTHSIZE -- Setting the authentication tag size for
   AEAD ciphers. For a encryption operation, the authentication tag of
   the given size will be generated. For a decryption operation, the
+127 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/crypto/rockchip,rk3288-crypto.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Rockchip Electronics Security Accelerator

maintainers:
  - Heiko Stuebner <heiko@sntech.de>

properties:
  compatible:
    enum:
      - rockchip,rk3288-crypto
      - rockchip,rk3328-crypto
      - rockchip,rk3399-crypto

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  clocks:
    minItems: 3
    maxItems: 4

  clock-names:
    minItems: 3
    maxItems: 4

  resets:
    minItems: 1
    maxItems: 3

  reset-names:
    minItems: 1
    maxItems: 3

allOf:
  - if:
      properties:
        compatible:
          contains:
            const: rockchip,rk3288-crypto
    then:
      properties:
        clocks:
          minItems: 4
        clock-names:
          items:
            - const: aclk
            - const: hclk
            - const: sclk
            - const: apb_pclk
        resets:
          maxItems: 1
        reset-names:
          items:
            - const: crypto-rst
  - if:
      properties:
        compatible:
          contains:
            const: rockchip,rk3328-crypto
    then:
      properties:
        clocks:
          maxItems: 3
        clock-names:
          items:
            - const: hclk_master
            - const: hclk_slave
            - const: sclk
        resets:
          maxItems: 1
        reset-names:
          items:
            - const: crypto-rst
  - if:
      properties:
        compatible:
          contains:
            const: rockchip,rk3399-crypto
    then:
      properties:
        clocks:
          maxItems: 3
        clock-names:
          items:
            - const: hclk_master
            - const: hclk_slave
            - const: sclk
        resets:
          minItems: 3
        reset-names:
          items:
            - const: master
            - const: slave
            - const: crypto-rst

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

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    #include <dt-bindings/clock/rk3288-cru.h>
    crypto@ff8a0000 {
      compatible = "rockchip,rk3288-crypto";
      reg = <0xff8a0000 0x4000>;
      interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
      clocks = <&cru ACLK_CRYPTO>, <&cru HCLK_CRYPTO>,
               <&cru SCLK_CRYPTO>, <&cru ACLK_DMAC1>;
      clock-names = "aclk", "hclk", "sclk", "apb_pclk";
      resets = <&cru SRST_CRYPTO>;
      reset-names = "crypto-rst";
    };
+0 −28
Original line number Diff line number Diff line
Rockchip Electronics And Security Accelerator

Required properties:
- compatible: Should be "rockchip,rk3288-crypto"
- reg: Base physical address of the engine and length of memory mapped
       region
- interrupts: Interrupt number
- clocks: Reference to the clocks about crypto
- clock-names: "aclk" used to clock data
	       "hclk" used to clock data
	       "sclk" used to clock crypto accelerator
	       "apb_pclk" used to clock dma
- resets: Must contain an entry for each entry in reset-names.
	  See ../reset/reset.txt for details.
- reset-names: Must include the name "crypto-rst".

Examples:

	crypto: cypto-controller@ff8a0000 {
		compatible = "rockchip,rk3288-crypto";
		reg = <0xff8a0000 0x4000>;
		interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
		clocks = <&cru ACLK_CRYPTO>, <&cru HCLK_CRYPTO>,
			 <&cru SCLK_CRYPTO>, <&cru ACLK_DMAC1>;
		clock-names = "aclk", "hclk", "sclk", "apb_pclk";
		resets = <&cru SRST_CRYPTO>;
		reset-names = "crypto-rst";
	};
+19 −0
Original line number Diff line number Diff line
@@ -6,12 +6,18 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#

title: STMicroelectronics STM32 CRYP bindings

description: The STM32 CRYP block is built on the CRYP block found in
  the STn8820 SoC introduced in 2007, and subsequently used in the U8500
  SoC in 2010.

maintainers:
  - Lionel Debieve <lionel.debieve@foss.st.com>

properties:
  compatible:
    enum:
      - st,stn8820-cryp
      - stericsson,ux500-cryp
      - st,stm32f756-cryp
      - st,stm32mp1-cryp

@@ -27,6 +33,19 @@ properties:
  resets:
    maxItems: 1

  dmas:
    items:
      - description: mem2cryp DMA channel
      - description: cryp2mem DMA channel

  dma-names:
    items:
      - const: mem2cryp
      - const: cryp2mem

  power-domains:
    maxItems: 1

required:
  - compatible
  - reg
Loading