mbox series

[v1,0/4] Add spacc crypto driver support

Message ID 20240328182652.3587727-1-pavitrakumarm@vayavyalabs.com
Headers show
Series Add spacc crypto driver support | expand

Message

Pavitrakumar Managutte March 28, 2024, 6:26 p.m. UTC
Add the driver for SPAcc(Security Protocol Accelerator), which is a
crypto acceleration IP from Synopsys. The SPAcc supports many cipher,
hash, aead algorithms and various modes.The driver currently supports
below,

aead:
- ccm(sm4)
- ccm(aes)
- gcm(sm4)
- gcm(aes)
- rfc8998(gcm(sm4))
- rfc7539(chacha20,poly1305)

cipher:
- cbc(sm4)
- ecb(sm4)
- ofb(sm4)
- cfb(sm4)
- ctr(sm4)
- cbc(aes)
- ecb(aes)
- ctr(aes)
- xts(aes)
- cts(cbc(aes))
- cbc(des)
- ecb(des)
- cbc(des3_ede)
- ecb(des3_ede)
- chacha20
- xts(sm4)
- cts(cbc(sm4))
- ecb(kasumi)
- f8(kasumi)
- snow3g_uea2
- cs1(cbc(aes))
- cs2(cbc(aes))
- cs1(cbc(sm4))
- cs2(cbc(sm4))
- f8(sm4)

hash:
- michael_mic
- sm3
- hmac(sm3)
- sha3-512
- sha3-384
- sha3-256
- sha3-224
- hmac(sha512)
- hmac(sha384)
- hmac(sha256)
- hmac(sha224)
- sha512
- sha384
- sha256
- sha224
- sha1
- hmac(sha1)
- md5
- hmac(md5)
- cmac(sm4)
- xcbc(aes)
- cmac(aes)
- xcbc(sm4) 
- sha512-224
- hmac(sha512-224)
- sha512-256
- hmac(sha512-256)
- mac(kasumi_f9)
- mac(snow3g)
- mac(zuc)
- sslmac(sha1)
- shake128
- shake256
- cshake128
- cshake256
- kcmac128
- kcmac256
- kcmacxof128
- kcmacxof256
- sslmac(md5)

Pavitrakumar M (4):
  Add SPAcc driver to Linux kernel
  Add SPACC Kconfig and Makefile
  Add SPAcc dts overlay
  Enable Driver compilation in crypto Kconfig and Makefile file

 arch/arm64/boot/dts/xilinx/Makefile           |    3 +
 .../arm64/boot/dts/xilinx/snps-dwc-spacc.dtso |   35 +
 drivers/crypto/Kconfig                        |    1 +
 drivers/crypto/Makefile                       |    1 +
 drivers/crypto/dwc-spacc/Kconfig              |   95 +
 drivers/crypto/dwc-spacc/Makefile             |   16 +
 drivers/crypto/dwc-spacc/spacc_aead.c         | 1382 ++++++++
 drivers/crypto/dwc-spacc/spacc_ahash.c        | 1183 +++++++
 drivers/crypto/dwc-spacc/spacc_core.c         | 2917 +++++++++++++++++
 drivers/crypto/dwc-spacc/spacc_core.h         |  839 +++++
 drivers/crypto/dwc-spacc/spacc_device.c       |  324 ++
 drivers/crypto/dwc-spacc/spacc_device.h       |  236 ++
 drivers/crypto/dwc-spacc/spacc_hal.c          |  365 +++
 drivers/crypto/dwc-spacc/spacc_hal.h          |  113 +
 drivers/crypto/dwc-spacc/spacc_interrupt.c    |  204 ++
 drivers/crypto/dwc-spacc/spacc_manager.c      |  670 ++++
 drivers/crypto/dwc-spacc/spacc_skcipher.c     |  754 +++++
 17 files changed, 9138 insertions(+)
 create mode 100644 arch/arm64/boot/dts/xilinx/snps-dwc-spacc.dtso
 create mode 100644 drivers/crypto/dwc-spacc/Kconfig
 create mode 100644 drivers/crypto/dwc-spacc/Makefile
 create mode 100644 drivers/crypto/dwc-spacc/spacc_aead.c
 create mode 100644 drivers/crypto/dwc-spacc/spacc_ahash.c
 create mode 100644 drivers/crypto/dwc-spacc/spacc_core.c
 create mode 100644 drivers/crypto/dwc-spacc/spacc_core.h
 create mode 100644 drivers/crypto/dwc-spacc/spacc_device.c
 create mode 100644 drivers/crypto/dwc-spacc/spacc_device.h
 create mode 100644 drivers/crypto/dwc-spacc/spacc_hal.c
 create mode 100644 drivers/crypto/dwc-spacc/spacc_hal.h
 create mode 100644 drivers/crypto/dwc-spacc/spacc_interrupt.c
 create mode 100644 drivers/crypto/dwc-spacc/spacc_manager.c
 create mode 100644 drivers/crypto/dwc-spacc/spacc_skcipher.c


base-commit: 6a8dbd71a70620c42d4fa82509204ba18231f28d

Comments

Easwar Hariharan March 29, 2024, 6:01 p.m. UTC | #1
On 3/28/2024 11:26 AM, Pavitrakumar M wrote:
> Signed-off-by: shwetar <shwetar@vayavyalabs.com>
> Signed-off-by: Pavitrakumar M <pavitrakumarm@vayavyalabs.com>
> Acked-by: Ruud Derwig <Ruud.Derwig@synopsys.com>
> ---
>  drivers/crypto/dwc-spacc/Kconfig  | 95 +++++++++++++++++++++++++++++++
>  drivers/crypto/dwc-spacc/Makefile | 16 ++++++
>  2 files changed, 111 insertions(+)
>  create mode 100644 drivers/crypto/dwc-spacc/Kconfig
>  create mode 100644 drivers/crypto/dwc-spacc/Makefile
> 
> diff --git a/drivers/crypto/dwc-spacc/Kconfig b/drivers/crypto/dwc-spacc/Kconfig
> new file mode 100644
> index 000000000000..9eb41a295f9d
> --- /dev/null
> +++ b/drivers/crypto/dwc-spacc/Kconfig
> @@ -0,0 +1,95 @@
> +# SPDX-License-Identifier: GPL-2.0-only
> +
> +config CRYPTO_DEV_SPACC
> +	tristate "Support for dw_spacc Security protocol accelerators"
> +	depends on HAS_DMA
> +	default m
> +
> +	help
> +	  This enables support for the HASH/CRYP/AEAD hw accelerator which can be found
> +	  on dw_spacc IP.

<snip>

Thanks for addressing this from v0. For this patch:

Reviewed-by: Easwar Hariharan <eahariha@linux.microsoft.com>

Thanks,
Easwar
Herbert Xu April 5, 2024, 7:08 a.m. UTC | #2
On Thu, Mar 28, 2024 at 11:56:48PM +0530, Pavitrakumar M wrote:
> Add the driver for SPAcc(Security Protocol Accelerator), which is a
> crypto acceleration IP from Synopsys. The SPAcc supports many cipher,
> hash, aead algorithms and various modes.The driver currently supports
> below,
> 
> aead:
> - ccm(sm4)
> - ccm(aes)
> - gcm(sm4)
> - gcm(aes)
> - rfc8998(gcm(sm4))
> - rfc7539(chacha20,poly1305)
> 
> cipher:
> - cbc(sm4)
> - ecb(sm4)
> - ofb(sm4)
> - cfb(sm4)
> - ctr(sm4)
> - cbc(aes)
> - ecb(aes)
> - ctr(aes)
> - xts(aes)
> - cts(cbc(aes))
> - cbc(des)
> - ecb(des)
> - cbc(des3_ede)
> - ecb(des3_ede)
> - chacha20
> - xts(sm4)
> - cts(cbc(sm4))
> - ecb(kasumi)
> - f8(kasumi)
> - snow3g_uea2
> - cs1(cbc(aes))
> - cs2(cbc(aes))
> - cs1(cbc(sm4))
> - cs2(cbc(sm4))
> - f8(sm4)
> 
> hash:
> - michael_mic
> - sm3
> - hmac(sm3)
> - sha3-512
> - sha3-384
> - sha3-256
> - sha3-224
> - hmac(sha512)
> - hmac(sha384)
> - hmac(sha256)
> - hmac(sha224)
> - sha512
> - sha384
> - sha256
> - sha224
> - sha1
> - hmac(sha1)
> - md5
> - hmac(md5)
> - cmac(sm4)
> - xcbc(aes)
> - cmac(aes)
> - xcbc(sm4) 
> - sha512-224
> - hmac(sha512-224)
> - sha512-256
> - hmac(sha512-256)
> - mac(kasumi_f9)
> - mac(snow3g)
> - mac(zuc)
> - sslmac(sha1)
> - shake128
> - shake256
> - cshake128
> - cshake256
> - kcmac128
> - kcmac256
> - kcmacxof128
> - kcmacxof256
> - sslmac(md5)

We don't add hardware implementations without software counterparts.
So please prune your list of algorithms according to this rule.

Thanks,
Pavitrakumar Managutte April 11, 2024, 5:31 a.m. UTC | #3
Sure Herbert,
  I have removed all those that dont have software implementation and
pushing v2 patch.

wwr,
PK

On Fri, Apr 5, 2024 at 12:38 PM Herbert Xu <herbert@gondor.apana.org.au> wrote:
>
> On Thu, Mar 28, 2024 at 11:56:48PM +0530, Pavitrakumar M wrote:
> > Add the driver for SPAcc(Security Protocol Accelerator), which is a
> > crypto acceleration IP from Synopsys. The SPAcc supports many cipher,
> > hash, aead algorithms and various modes.The driver currently supports
> > below,
> >
> > aead:
> > - ccm(sm4)
> > - ccm(aes)
> > - gcm(sm4)
> > - gcm(aes)
> > - rfc8998(gcm(sm4))
> > - rfc7539(chacha20,poly1305)
> >
> > cipher:
> > - cbc(sm4)
> > - ecb(sm4)
> > - ofb(sm4)
> > - cfb(sm4)
> > - ctr(sm4)
> > - cbc(aes)
> > - ecb(aes)
> > - ctr(aes)
> > - xts(aes)
> > - cts(cbc(aes))
> > - cbc(des)
> > - ecb(des)
> > - cbc(des3_ede)
> > - ecb(des3_ede)
> > - chacha20
> > - xts(sm4)
> > - cts(cbc(sm4))
> > - ecb(kasumi)
> > - f8(kasumi)
> > - snow3g_uea2
> > - cs1(cbc(aes))
> > - cs2(cbc(aes))
> > - cs1(cbc(sm4))
> > - cs2(cbc(sm4))
> > - f8(sm4)
> >
> > hash:
> > - michael_mic
> > - sm3
> > - hmac(sm3)
> > - sha3-512
> > - sha3-384
> > - sha3-256
> > - sha3-224
> > - hmac(sha512)
> > - hmac(sha384)
> > - hmac(sha256)
> > - hmac(sha224)
> > - sha512
> > - sha384
> > - sha256
> > - sha224
> > - sha1
> > - hmac(sha1)
> > - md5
> > - hmac(md5)
> > - cmac(sm4)
> > - xcbc(aes)
> > - cmac(aes)
> > - xcbc(sm4)
> > - sha512-224
> > - hmac(sha512-224)
> > - sha512-256
> > - hmac(sha512-256)
> > - mac(kasumi_f9)
> > - mac(snow3g)
> > - mac(zuc)
> > - sslmac(sha1)
> > - shake128
> > - shake256
> > - cshake128
> > - cshake256
> > - kcmac128
> > - kcmac256
> > - kcmacxof128
> > - kcmacxof256
> > - sslmac(md5)
>
> We don't add hardware implementations without software counterparts.
> So please prune your list of algorithms according to this rule.
>
> Thanks,
> --
> Email: Herbert Xu <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt