Commit ab5c60b7 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull crypto updates from Herbert Xu:
 "API:
   - Add support for allocating transforms on a specific NUMA Node
   - Introduce the flag CRYPTO_ALG_ALLOCATES_MEMORY for storage users

  Algorithms:
   - Drop PMULL based ghash on arm64
   - Fixes for building with clang on x86
   - Add sha256 helper that does the digest in one go
   - Add SP800-56A rev 3 validation checks to dh

  Drivers:
   - Permit users to specify NUMA node in hisilicon/zip
   - Add support for i.MX6 in imx-rngc
   - Add sa2ul crypto driver
   - Add BA431 hwrng driver
   - Add Ingenic JZ4780 and X1000 hwrng driver
   - Spread IRQ affinity in inside-secure and marvell/cesa"

* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (157 commits)
  crypto: sa2ul - Fix inconsistent IS_ERR and PTR_ERR
  hwrng: core - remove redundant initialization of variable ret
  crypto: x86/curve25519 - Remove unused carry variables
  crypto: ingenic - Add hardware RNG for Ingenic JZ4780 and X1000
  dt-bindings: RNG: Add Ingenic RNG bindings.
  crypto: caam/qi2 - add module alias
  crypto: caam - add more RNG hw error codes
  crypto: caam/jr - remove incorrect reference to caam_jr_register()
  crypto: caam - silence .setkey in case of bad key length
  crypto: caam/qi2 - create ahash shared descriptors only once
  crypto: caam/qi2 - fix error reporting for caam_hash_alloc
  crypto: caam - remove deadcode on 32-bit platforms
  crypto: ccp - use generic power management
  crypto: xts - Replace memcpy() invocation with simple assignment
  crypto: marvell/cesa - irq balance
  crypto: inside-secure - irq balance
  crypto: ecc - SP800-56A rev 3 local public key validation
  crypto: dh - SP800-56A rev 3 local public key validation
  crypto: dh - check validity of Z before export
  lib/mpi: Add mpi_sub_ui()
  ...
parents 5577416c 3cbfe807
Loading
Loading
Loading
Loading
+3 −15
Original line number Diff line number Diff line
@@ -27,22 +27,11 @@ padata_instance structure for overall control of how jobs are to be run::

    #include <linux/padata.h>

    struct padata_instance *padata_alloc_possible(const char *name);
    struct padata_instance *padata_alloc(const char *name);

'name' simply identifies the instance.

There are functions for enabling and disabling the instance::

    int padata_start(struct padata_instance *pinst);
    void padata_stop(struct padata_instance *pinst);

These functions are setting or clearing the "PADATA_INIT" flag; if that flag is
not set, other functions will refuse to work.  padata_start() returns zero on
success (flag set) or -EINVAL if the padata cpumask contains no active CPU
(flag not set).  padata_stop() clears the flag and blocks until the padata
instance is unused.

Finally, complete padata initialization by allocating a padata_shell::
Then, complete padata initialization by allocating a padata_shell::

   struct padata_shell *padata_alloc_shell(struct padata_instance *pinst);

@@ -155,11 +144,10 @@ submitted.
Destroying
----------

Cleaning up a padata instance predictably involves calling the three free
Cleaning up a padata instance predictably involves calling the two free
functions that correspond to the allocation in reverse::

    void padata_free_shell(struct padata_shell *ps);
    void padata_stop(struct padata_instance *pinst);
    void padata_free(struct padata_instance *pinst);

It is the user's responsibility to ensure all outstanding jobs are complete
+1 −1
Original line number Diff line number Diff line
@@ -169,7 +169,7 @@ Portions of this API were derived from the following projects:

and;
  
  Nettle (http://www.lysator.liu.se/~nisse/nettle/)
  Nettle (https://www.lysator.liu.se/~nisse/nettle/)
    Niels Möller

Original developers of the crypto algorithms:
+2 −2
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ user space, however. This includes the difference between synchronous
and asynchronous invocations. The user space API call is fully
synchronous.

[1] http://www.chronox.de/libkcapi.html
[1] https://www.chronox.de/libkcapi.html

User Space API General Remarks
------------------------------
@@ -384,4 +384,4 @@ Please see [1] for libkcapi which provides an easy-to-use wrapper around
the aforementioned Netlink kernel interface. [1] also contains a test
application that invokes all libkcapi API calls.

[1] http://www.chronox.de/libkcapi.html
[1] https://www.chronox.de/libkcapi.html
+76 −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/ti,sa2ul.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: K3 SoC SA2UL crypto module

maintainers:
  - Tero Kristo <t-kristo@ti.com>

properties:
  compatible:
    enum:
      - ti,j721e-sa2ul
      - ti,am654-sa2ul

  reg:
    maxItems: 1

  power-domains:
    maxItems: 1

  dmas:
    items:
      - description: TX DMA Channel
      - description: RX DMA Channel #1
      - description: RX DMA Channel #2

  dma-names:
    items:
      - const: tx
      - const: rx1
      - const: rx2

  dma-coherent: true

  "#address-cells":
    const: 2

  "#size-cells":
    const: 2

  ranges:
    description:
      Address translation for the possible RNG child node for SA2UL

patternProperties:
  "^rng@[a-f0-9]+$":
    type: object
    description:
      Child RNG node for SA2UL

required:
  - compatible
  - reg
  - power-domains
  - dmas
  - dma-names
  - dma-coherent

additionalProperties: false

examples:
  - |
    #include <dt-bindings/soc/ti,sci_pm_domain.h>

    main_crypto: crypto@4e00000 {
        compatible = "ti,j721-sa2ul";
        reg = <0x0 0x4e00000 0x0 0x1200>;
        power-domains = <&k3_pds 264 TI_SCI_PD_EXCLUSIVE>;
        dmas = <&main_udmap 0xc000>, <&main_udmap 0x4000>,
               <&main_udmap 0x4001>;
        dma-names = "tx", "rx1", "rx2";
        dma-coherent;
    };
+3 −0
Original line number Diff line number Diff line
@@ -5,6 +5,9 @@ Required properties:
               "fsl,imx21-rnga"
               "fsl,imx31-rnga" (backward compatible with "fsl,imx21-rnga")
               "fsl,imx25-rngb"
               "fsl,imx6sl-rngb" (backward compatible with "fsl,imx25-rngb")
               "fsl,imx6sll-rngb" (backward compatible with "fsl,imx25-rngb")
               "fsl,imx6ull-rngb" (backward compatible with "fsl,imx25-rngb")
               "fsl,imx35-rngc"
- reg : offset and length of the register set of this block
- interrupts : the interrupt number for the RNG block
Loading