Skip to content

Commit e4db874

Browse files
committed
feat(linuxkm): register single-block aes cipher
1 parent e6a6e1c commit e4db874

4 files changed

Lines changed: 337 additions & 2 deletions

File tree

‎configure.ac‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12899,7 +12899,7 @@ fi
1289912899
AC_ARG_ENABLE([linuxkm-lkcapi-register],
1290012900
[AS_HELP_STRING([--enable-linuxkm-lkcapi-register],[Register wolfCrypt implementations with the Linux Kernel Crypto API backplane.
1290112901
Possible values are "none" or a comma-separated combination of "all", "all-kconfig", "sysfs-nodes-only", "cbc(aes)", "cfb(aes)",
12902-
"gcm(aes)", "rfc4106(gcm(aes))", "xts(aes)", "ctr(aes)", "ofb(aes)", "ecb(aes)", "all-aes", "sha1", "sha2", "sha3", "all-sha",
12902+
"gcm(aes)", "rfc4106(gcm(aes))", "xts(aes)", "ctr(aes)", "ofb(aes)", "ecb(aes)", "aes", "all-aes", "sha1", "sha2", "sha3", "all-sha",
1290312903
"hmac(sha1)", "hmac(sha2)", "hmac(sha3)", "all-hmac", "stdrng", "stdrng-default", "ecdsa", "ecdh", "rsa", "dh", "ed", "falcon",
1290412904
"mldsa", "mlkem", "slhdsa", "lms", "xmss", "frodokem", and negations of
1290512905
the foregoing algorithms by prefixing "-".
@@ -12950,6 +12950,8 @@ then
1295012950
'ecb(aes)') AM_CFLAGS="$AM_CFLAGS -DLINUXKM_LKCAPI_REGISTER_AESECB -DHAVE_AES_ECB" ;;
1295112951
'cmac(aes)') test "$ENABLED_CMAC" != "no" || AC_MSG_ERROR([linuxkm-lkcapi-register ${lkcapi_alg}: AES-CMAC implementation not enabled.])
1295212952
AM_CFLAGS="$AM_CFLAGS -DLINUXKM_LKCAPI_REGISTER_AESCMAC -DHAVE_AES_ECB" ;;
12953+
'aes') test "$ENABLED_AES" != "no" || AC_MSG_ERROR([linuxkm-lkcapi-register ${lkcapi_alg}: AES is disabled.])
12954+
AM_CFLAGS="$AM_CFLAGS -DLINUXKM_LKCAPI_REGISTER_AESDIRECT -DWOLFSSL_AES_DIRECT" ;;
1295312955
'all-aes') test "$ENABLED_AES" != "no" || AC_MSG_ERROR([linuxkm-lkcapi-register ${lkcapi_alg}: AES is disabled.])
1295412956
AM_CFLAGS="$AM_CFLAGS -DLINUXKM_LKCAPI_REGISTER_AES_ALL" ;;
1295512957
'sha1') test "$ENABLED_SHA" != "no" || AC_MSG_ERROR([linuxkm-lkcapi-register ${lkcapi_alg}: SHA-1 implementation not enabled.])
@@ -13017,6 +13019,7 @@ then
1301713019
'-ofb(aes)') AM_CFLAGS="$AM_CFLAGS -DLINUXKM_LKCAPI_DONT_REGISTER_AESOFB" ;;
1301813020
'-ecb(aes)') AM_CFLAGS="$AM_CFLAGS -DLINUXKM_LKCAPI_DONT_REGISTER_AESECB" ;;
1301913021
'-cmac(aes)') AM_CFLAGS="$AM_CFLAGS -DLINUXKM_LKCAPI_DONT_REGISTER_AESCMAC" ;;
13022+
'-aes') AM_CFLAGS="$AM_CFLAGS -DLINUXKM_LKCAPI_DONT_REGISTER_AESDIRECT" ;;
1302013023
'-all-aes') AM_CFLAGS="$AM_CFLAGS -DLINUXKM_LKCAPI_DONT_REGISTER_AES_ALL" ;;
1302113024
'-sha1') AM_CFLAGS="$AM_CFLAGS -DLINUXKM_LKCAPI_DONT_REGISTER_SHA1" ;;
1302213025
'-sha2') AM_CFLAGS="$AM_CFLAGS -DLINUXKM_LKCAPI_DONT_REGISTER_SHA2" ;;

‎linuxkm/linuxkm_wc_port.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,9 @@
805805
#include <crypto/internal/hash.h>
806806
#include <crypto/internal/rng.h>
807807
#include <crypto/internal/skcipher.h>
808+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 12, 0)
809+
#include <crypto/internal/cipher.h>
810+
#endif
808811
#include <crypto/internal/akcipher.h>
809812
#include <crypto/internal/kpp.h>
810813
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)

0 commit comments

Comments
 (0)