Skip to content

Commit 8857433

Browse files
mikexhealyherbertx
authored andcommitted
crypto: keembay - Add support for Keem Bay OCS AES/SM4
Add support for the AES/SM4 crypto engine included in the Offload and Crypto Subsystem (OCS) of the Intel Keem Bay SoC, thus enabling hardware-acceleration for the following transformations: - ecb(aes), cbc(aes), ctr(aes), cts(cbc(aes)), gcm(aes) and cbc(aes); supported for 128-bit and 256-bit keys. - ecb(sm4), cbc(sm4), ctr(sm4), cts(cbc(sm4)), gcm(sm4) and cbc(sm4); supported for 128-bit keys. The driver passes crypto manager self-tests, including the extra tests (CRYPTO_MANAGER_EXTRA_TESTS=y). Signed-off-by: Mike Healy <[email protected]> Co-developed-by: Daniele Alessandrelli <[email protected]> Signed-off-by: Daniele Alessandrelli <[email protected]> Acked-by: Mark Gross <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent c7e34aa commit 8857433

File tree

8 files changed

+3388
-0
lines changed

8 files changed

+3388
-0
lines changed

MAINTAINERS

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8958,6 +8958,16 @@ M: Deepak Saxena <[email protected]>
89588958
S: Maintained
89598959
F: drivers/char/hw_random/ixp4xx-rng.c
89608960

8961+
INTEL KEEM BAY OCS AES/SM4 CRYPTO DRIVER
8962+
M: Daniele Alessandrelli <[email protected]>
8963+
S: Maintained
8964+
F: Documentation/devicetree/bindings/crypto/intel,keembay-ocs-aes.yaml
8965+
F: drivers/crypto/keembay/Kconfig
8966+
F: drivers/crypto/keembay/Makefile
8967+
F: drivers/crypto/keembay/keembay-ocs-aes-core.c
8968+
F: drivers/crypto/keembay/ocs-aes.c
8969+
F: drivers/crypto/keembay/ocs-aes.h
8970+
89618971
INTEL MANAGEMENT ENGINE (mei)
89628972
M: Tomas Winkler <[email protected]>
89638973

drivers/crypto/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -900,4 +900,6 @@ config CRYPTO_DEV_SA2UL
900900
used for crypto offload. Select this if you want to use hardware
901901
acceleration for cryptographic algorithms on these devices.
902902

903+
source "drivers/crypto/keembay/Kconfig"
904+
903905
endif # CRYPTO_HW

drivers/crypto/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,4 @@ obj-$(CONFIG_CRYPTO_DEV_ARTPEC6) += axis/
5151
obj-$(CONFIG_CRYPTO_DEV_ZYNQMP_AES) += xilinx/
5252
obj-y += hisilicon/
5353
obj-$(CONFIG_CRYPTO_DEV_AMLOGIC_GXL) += amlogic/
54+
obj-y += keembay/

drivers/crypto/keembay/Kconfig

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
config CRYPTO_DEV_KEEMBAY_OCS_AES_SM4
2+
tristate "Support for Intel Keem Bay OCS AES/SM4 HW acceleration"
3+
depends on OF || COMPILE_TEST
4+
select CRYPTO_SKCIPHER
5+
select CRYPTO_AEAD
6+
select CRYPTO_ENGINE
7+
help
8+
Support for Intel Keem Bay Offload and Crypto Subsystem (OCS) AES and
9+
SM4 cihper hardware acceleration for use with Crypto API.
10+
11+
Provides HW acceleration for the following transformations:
12+
cbc(aes), ctr(aes), ccm(aes), gcm(aes), cbc(sm4), ctr(sm4), ccm(sm4)
13+
and gcm(sm4).
14+
15+
Optionally, support for the following transformations can also be
16+
enabled: ecb(aes), cts(cbc(aes)), ecb(sm4) and cts(cbc(sm4)).
17+
18+
config CRYPTO_DEV_KEEMBAY_OCS_AES_SM4_ECB
19+
bool "Support for Intel Keem Bay OCS AES/SM4 ECB HW acceleration"
20+
depends on CRYPTO_DEV_KEEMBAY_OCS_AES_SM4
21+
help
22+
Support for Intel Keem Bay Offload and Crypto Subsystem (OCS)
23+
AES/SM4 ECB mode hardware acceleration for use with Crypto API.
24+
25+
Provides OCS version of ecb(aes) and ecb(sm4)
26+
27+
Intel does not recommend use of ECB mode with AES/SM4.
28+
29+
config CRYPTO_DEV_KEEMBAY_OCS_AES_SM4_CTS
30+
bool "Support for Intel Keem Bay OCS AES/SM4 CTS HW acceleration"
31+
depends on CRYPTO_DEV_KEEMBAY_OCS_AES_SM4
32+
help
33+
Support for Intel Keem Bay Offload and Crypto Subsystem (OCS)
34+
AES/SM4 CBC with CTS mode hardware acceleration for use with
35+
Crypto API.
36+
37+
Provides OCS version of cts(cbc(aes)) and cts(cbc(sm4)).
38+
39+
Intel does not recommend use of CTS mode with AES/SM4.

drivers/crypto/keembay/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#
2+
# Makefile for Intel Keem Bay OCS Crypto API Linux drivers
3+
#
4+
obj-$(CONFIG_CRYPTO_DEV_KEEMBAY_OCS_AES_SM4) += keembay-ocs-aes.o
5+
keembay-ocs-aes-objs := keembay-ocs-aes-core.o ocs-aes.o

0 commit comments

Comments
 (0)