From 0db4edb0499803f81492f88d25de60ae1ae66fcd Mon Sep 17 00:00:00 2001 From: T Pratham Date: Mon, 21 Sep 2026 14:53:54 +0530 Subject: [PATCH 1/2] feat(linux): Update crypto docs to merge DTHEv2 and SA2UL into one DTHEv2 has now enabled all fetaures available with SA2/3UL. The crypto docs were initially split on the introduction of DTHEv2 since a large part of it was hidden with bunch of ifconfigs. Usage and testing wise, both hardware accelerators don't differ much and the parity in the docs was only because of staggered feature enablement in DTHEv2. The final section missing from DTHEv2 was IPSec testing. With DTHEv2 now supporting that as well, the doc is nearly identical with SA2UL. So, now merge the SA2UL_OMAP.rst and DTHEv2.rst back into Crypto.rst. Change the necessary tocs as well. Signed-off-by: T Pratham --- configs/AM335X/AM335X_linux_toc.txt | 2 +- configs/AM437X/AM437X_linux_toc.txt | 2 +- configs/AM57X/AM57X_linux_toc.txt | 2 +- configs/AM62AX/AM62AX_linux_toc.txt | 2 +- configs/AM62DX/AM62DX_linux_toc.txt | 2 +- configs/AM62LX/AM62LX_linux_toc.txt | 2 +- configs/AM62PX/AM62PX_linux_toc.txt | 2 +- configs/AM62X/AM62X_linux_toc.txt | 2 +- configs/AM64X/AM64X_linux_toc.txt | 2 +- configs/AM65X/AM65X_linux_toc.txt | 2 +- configs/AM67/AM67_linux_toc.txt | 2 +- configs/AM67A/AM67A_linux_toc.txt | 2 +- configs/AM68/AM68_linux_toc.txt | 2 +- configs/AM68A/AM68A_linux_toc.txt | 2 +- configs/AM69/AM69_linux_toc.txt | 2 +- configs/AM69A/AM69A_linux_toc.txt | 2 +- configs/DRA821A/DRA821A_linux_toc.txt | 2 +- configs/J7200/J7200_linux_toc.txt | 2 +- configs/J721E/J721E_linux_toc.txt | 2 +- configs/J721S2/J721S2_linux_toc.txt | 2 +- configs/J722S/J722S_linux_toc.txt | 2 +- configs/J742S2/J742S2_linux_toc.txt | 2 +- configs/J784S4/J784S4_linux_toc.txt | 2 +- configs/TDA4VM/TDA4VM_linux_toc.txt | 2 +- .../linux/Release_Specific_Release_Notes.rst | 2 +- .../Kernel/Kernel_Drivers/Crypto/Crypto.rst | 600 ++++++++++++++++++ .../Kernel/Kernel_Drivers/Crypto/DTHEv2.rst | 375 ----------- .../Kernel_Drivers/Crypto/SA2UL_OMAP.rst | 498 --------------- ...Foundational_Components_Kernel_Drivers.rst | 3 +- 29 files changed, 626 insertions(+), 900 deletions(-) create mode 100644 source/linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/Crypto.rst delete mode 100644 source/linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/DTHEv2.rst delete mode 100644 source/linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/SA2UL_OMAP.rst diff --git a/configs/AM335X/AM335X_linux_toc.txt b/configs/AM335X/AM335X_linux_toc.txt index f33232602..1cc93febf 100644 --- a/configs/AM335X/AM335X_linux_toc.txt +++ b/configs/AM335X/AM335X_linux_toc.txt @@ -50,7 +50,7 @@ linux/Foundational_Components_Kernel linux/Foundational_Components_Kernel_Drivers linux/Foundational_Components/Kernel/Kernel_Drivers/ADC linux/Foundational_Components/Kernel/Kernel_Drivers/Audio -linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/SA2UL_OMAP +linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/Crypto linux/Foundational_Components/Kernel/Kernel_Drivers/DCAN linux/Foundational_Components/Kernel/Kernel_Drivers/Display/LCDC linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO diff --git a/configs/AM437X/AM437X_linux_toc.txt b/configs/AM437X/AM437X_linux_toc.txt index a74fad450..7a3e7befc 100644 --- a/configs/AM437X/AM437X_linux_toc.txt +++ b/configs/AM437X/AM437X_linux_toc.txt @@ -50,7 +50,7 @@ linux/Foundational_Components_Kernel_Drivers linux/Foundational_Components/Kernel/Kernel_Drivers/ADC linux/Foundational_Components/Kernel/Kernel_Drivers/Audio linux/Foundational_Components/Kernel/Kernel_Drivers/Camera/VPFE -linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/SA2UL_OMAP +linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/Crypto linux/Foundational_Components/Kernel/Kernel_Drivers/DCAN linux/Foundational_Components/Kernel/Kernel_Drivers/Display/DSS linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO diff --git a/configs/AM57X/AM57X_linux_toc.txt b/configs/AM57X/AM57X_linux_toc.txt index 356c0425f..2eba9a5c4 100644 --- a/configs/AM57X/AM57X_linux_toc.txt +++ b/configs/AM57X/AM57X_linux_toc.txt @@ -50,7 +50,7 @@ linux/Foundational_Components/Kernel/Kernel_Drivers/ADC linux/Foundational_Components/Kernel/Kernel_Drivers/Audio linux/Foundational_Components/Kernel/Kernel_Drivers/Camera/VPFE linux/Foundational_Components/Kernel/Kernel_Drivers/Camera/VIP -linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/SA2UL_OMAP +linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/Crypto linux/Foundational_Components/Kernel/Kernel_Drivers/DCAN linux/Foundational_Components/Kernel/Kernel_Drivers/Display/DSS linux/Foundational_Components/Kernel/Kernel_Drivers/Display/LCDC diff --git a/configs/AM62AX/AM62AX_linux_toc.txt b/configs/AM62AX/AM62AX_linux_toc.txt index 0591fbe6d..7c0dd77e0 100644 --- a/configs/AM62AX/AM62AX_linux_toc.txt +++ b/configs/AM62AX/AM62AX_linux_toc.txt @@ -54,7 +54,7 @@ linux/Foundational_Components_Kernel linux/Foundational_Components_Kernel_Drivers linux/Foundational_Components/Kernel/Kernel_Drivers/Audio linux/Foundational_Components/Kernel/Kernel_Drivers/Camera/CSI2RX_AM62AX -linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/SA2UL_OMAP +linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/Crypto linux/Foundational_Components/Kernel/Kernel_Drivers/DDR linux/Foundational_Components/Kernel/Kernel_Drivers/ECAP linux/Foundational_Components/Kernel/Kernel_Drivers/Display/DSS7 diff --git a/configs/AM62DX/AM62DX_linux_toc.txt b/configs/AM62DX/AM62DX_linux_toc.txt index 49de07843..4cd294bd0 100644 --- a/configs/AM62DX/AM62DX_linux_toc.txt +++ b/configs/AM62DX/AM62DX_linux_toc.txt @@ -46,7 +46,7 @@ linux/Foundational_Components/U-Boot/Apps-SPL-Debug-OpenOCD linux/Foundational_Components_Kernel linux/Foundational_Components_Kernel_Drivers linux/Foundational_Components/Kernel/Kernel_Drivers/Audio -linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/SA2UL_OMAP +linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/Crypto linux/Foundational_Components/Kernel/Kernel_Drivers/EQEP linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO linux/Foundational_Components/Kernel/Kernel_Drivers/I2C diff --git a/configs/AM62LX/AM62LX_linux_toc.txt b/configs/AM62LX/AM62LX_linux_toc.txt index 336f87921..c8647031b 100644 --- a/configs/AM62LX/AM62LX_linux_toc.txt +++ b/configs/AM62LX/AM62LX_linux_toc.txt @@ -49,7 +49,7 @@ linux/Foundational_Components/U-Boot/Apps-SPL-Debug-OpenOCD linux/Foundational_Components_Kernel linux/Foundational_Components_Kernel_Drivers linux/Foundational_Components/Kernel/Kernel_Drivers/Audio -linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/DTHEv2 +linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/Crypto linux/Foundational_Components/Kernel/Kernel_Drivers/Display/DSS7 linux/Foundational_Components/Kernel/Kernel_Drivers/ECAP linux/Foundational_Components/Kernel/Kernel_Drivers/EQEP diff --git a/configs/AM62PX/AM62PX_linux_toc.txt b/configs/AM62PX/AM62PX_linux_toc.txt index ea88d28b6..10d8c1c0d 100644 --- a/configs/AM62PX/AM62PX_linux_toc.txt +++ b/configs/AM62PX/AM62PX_linux_toc.txt @@ -55,7 +55,7 @@ linux/Foundational_Components_Kernel_Drivers #linux/Foundational_Components/Kernel/Kernel_Drivers/ADC linux/Foundational_Components/Kernel/Kernel_Drivers/Audio linux/Foundational_Components/Kernel/Kernel_Drivers/Camera/CSI2RX_AM62PX -linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/SA2UL_OMAP +linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/Crypto linux/Foundational_Components/Kernel/Kernel_Drivers/DDR linux/Foundational_Components/Kernel/Kernel_Drivers/ECAP linux/Foundational_Components/Kernel/Kernel_Drivers/Display/DSS7 diff --git a/configs/AM62X/AM62X_linux_toc.txt b/configs/AM62X/AM62X_linux_toc.txt index 07b01f227..387e36fe4 100644 --- a/configs/AM62X/AM62X_linux_toc.txt +++ b/configs/AM62X/AM62X_linux_toc.txt @@ -54,7 +54,7 @@ linux/Foundational_Components_Kernel_Drivers #linux/Foundational_Components/Kernel/Kernel_Drivers/ADC linux/Foundational_Components/Kernel/Kernel_Drivers/Audio linux/Foundational_Components/Kernel/Kernel_Drivers/Camera/CSI2RX_AM62X -linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/SA2UL_OMAP +linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/Crypto linux/Foundational_Components/Kernel/Kernel_Drivers/DDR linux/Foundational_Components/Kernel/Kernel_Drivers/ECAP linux/Foundational_Components/Kernel/Kernel_Drivers/Display/DSS7 diff --git a/configs/AM64X/AM64X_linux_toc.txt b/configs/AM64X/AM64X_linux_toc.txt index c8ed786b6..774e7ad64 100644 --- a/configs/AM64X/AM64X_linux_toc.txt +++ b/configs/AM64X/AM64X_linux_toc.txt @@ -47,7 +47,7 @@ linux/Foundational_Components/U-Boot/Apps-TroubleShooting linux/Foundational_Components_Kernel linux/Foundational_Components_Kernel_Drivers linux/Foundational_Components/Kernel/Kernel_Drivers/ADC -linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/SA2UL_OMAP +linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/Crypto linux/Foundational_Components/Kernel/Kernel_Drivers/DDR linux/Foundational_Components/Kernel/Kernel_Drivers/DM-Timer linux/Foundational_Components/Kernel/Kernel_Drivers/EQEP diff --git a/configs/AM65X/AM65X_linux_toc.txt b/configs/AM65X/AM65X_linux_toc.txt index 59112de7a..cfce90d5b 100644 --- a/configs/AM65X/AM65X_linux_toc.txt +++ b/configs/AM65X/AM65X_linux_toc.txt @@ -49,7 +49,7 @@ linux/Foundational_Components_Kernel_Drivers linux/Foundational_Components/Kernel/Kernel_Drivers/ADC linux/Foundational_Components/Kernel/Kernel_Drivers/Audio linux/Foundational_Components/Kernel/Kernel_Drivers/Camera/CAL -linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/SA2UL_OMAP +linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/Crypto linux/Foundational_Components/Kernel/Kernel_Drivers/DCAN linux/Foundational_Components/Kernel/Kernel_Drivers/Display/DSS7 linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO diff --git a/configs/AM67/AM67_linux_toc.txt b/configs/AM67/AM67_linux_toc.txt index be8507d39..3b91fa333 100644 --- a/configs/AM67/AM67_linux_toc.txt +++ b/configs/AM67/AM67_linux_toc.txt @@ -46,7 +46,7 @@ linux/Foundational_Components_Kernel_Drivers linux/Foundational_Components/Kernel/Kernel_Drivers/ADC linux/Foundational_Components/Kernel/Kernel_Drivers/Audio linux/Foundational_Components/Kernel/Kernel_Drivers/Camera/CSI2RX_J722S -linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/SA2UL_OMAP +linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/Crypto linux/Foundational_Components/Kernel/Kernel_Drivers/Display/DSS7 linux/Foundational_Components/Kernel/Kernel_Drivers/E5010_JPEG_Encoder linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO diff --git a/configs/AM67A/AM67A_linux_toc.txt b/configs/AM67A/AM67A_linux_toc.txt index 33b1db8f6..21cd798d6 100644 --- a/configs/AM67A/AM67A_linux_toc.txt +++ b/configs/AM67A/AM67A_linux_toc.txt @@ -47,7 +47,7 @@ linux/Foundational_Components_Kernel_Drivers linux/Foundational_Components/Kernel/Kernel_Drivers/ADC linux/Foundational_Components/Kernel/Kernel_Drivers/Audio linux/Foundational_Components/Kernel/Kernel_Drivers/Camera/CSI2RX_J722S -linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/SA2UL_OMAP +linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/Crypto linux/Foundational_Components/Kernel/Kernel_Drivers/Display/DSS7 linux/Foundational_Components/Kernel/Kernel_Drivers/E5010_JPEG_Encoder linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO diff --git a/configs/AM68/AM68_linux_toc.txt b/configs/AM68/AM68_linux_toc.txt index ee53444e6..c4abddb3e 100644 --- a/configs/AM68/AM68_linux_toc.txt +++ b/configs/AM68/AM68_linux_toc.txt @@ -49,7 +49,7 @@ linux/Foundational_Components_Kernel_Drivers linux/Foundational_Components/Kernel/Kernel_Drivers/ADC linux/Foundational_Components/Kernel/Kernel_Drivers/Audio linux/Foundational_Components/Kernel/Kernel_Drivers/Camera/CSI2RX_J721S2 -linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/SA2UL_OMAP +linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/Crypto linux/Foundational_Components/Kernel/Kernel_Drivers/Display/DSS7 linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO linux/Foundational_Components/Kernel/Kernel_Drivers/HYPERFLASH diff --git a/configs/AM68A/AM68A_linux_toc.txt b/configs/AM68A/AM68A_linux_toc.txt index f275352a9..3b6006806 100644 --- a/configs/AM68A/AM68A_linux_toc.txt +++ b/configs/AM68A/AM68A_linux_toc.txt @@ -49,7 +49,7 @@ linux/Foundational_Components_Kernel_Drivers linux/Foundational_Components/Kernel/Kernel_Drivers/ADC linux/Foundational_Components/Kernel/Kernel_Drivers/Audio linux/Foundational_Components/Kernel/Kernel_Drivers/Camera/CSI2RX_J721S2 -linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/SA2UL_OMAP +linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/Crypto linux/Foundational_Components/Kernel/Kernel_Drivers/Display/DSS7 linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO linux/Foundational_Components/Kernel/Kernel_Drivers/HYPERFLASH diff --git a/configs/AM69/AM69_linux_toc.txt b/configs/AM69/AM69_linux_toc.txt index 404c58488..619d51e06 100644 --- a/configs/AM69/AM69_linux_toc.txt +++ b/configs/AM69/AM69_linux_toc.txt @@ -49,7 +49,7 @@ linux/Foundational_Components_Kernel_Drivers linux/Foundational_Components/Kernel/Kernel_Drivers/ADC linux/Foundational_Components/Kernel/Kernel_Drivers/Audio linux/Foundational_Components/Kernel/Kernel_Drivers/Camera/CSI2RX_J784S4 -linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/SA2UL_OMAP +linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/Crypto linux/Foundational_Components/Kernel/Kernel_Drivers/Display/DSS7 linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO linux/Foundational_Components/Kernel/Kernel_Drivers/HYPERFLASH diff --git a/configs/AM69A/AM69A_linux_toc.txt b/configs/AM69A/AM69A_linux_toc.txt index 1fb0f5df3..7b064eff3 100644 --- a/configs/AM69A/AM69A_linux_toc.txt +++ b/configs/AM69A/AM69A_linux_toc.txt @@ -49,7 +49,7 @@ linux/Foundational_Components_Kernel_Drivers linux/Foundational_Components/Kernel/Kernel_Drivers/ADC linux/Foundational_Components/Kernel/Kernel_Drivers/Audio linux/Foundational_Components/Kernel/Kernel_Drivers/Camera/CSI2RX_J784S4 -linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/SA2UL_OMAP +linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/Crypto linux/Foundational_Components/Kernel/Kernel_Drivers/Display/DSS7 linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO linux/Foundational_Components/Kernel/Kernel_Drivers/HYPERFLASH diff --git a/configs/DRA821A/DRA821A_linux_toc.txt b/configs/DRA821A/DRA821A_linux_toc.txt index 18a0fd6c3..39eb5a986 100644 --- a/configs/DRA821A/DRA821A_linux_toc.txt +++ b/configs/DRA821A/DRA821A_linux_toc.txt @@ -43,7 +43,7 @@ linux/Foundational_Components/U-Boot/Apps-TroubleShooting linux/Foundational_Components_Kernel linux/Foundational_Components_Kernel_Drivers linux/Foundational_Components/Kernel/Kernel_Drivers/ADC -linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/SA2UL_OMAP +linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/Crypto linux/Foundational_Components/Kernel/Kernel_Drivers/MCAN linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO linux/Foundational_Components/Kernel/Kernel_Drivers/I2C diff --git a/configs/J7200/J7200_linux_toc.txt b/configs/J7200/J7200_linux_toc.txt index 559609ad6..6b5794571 100644 --- a/configs/J7200/J7200_linux_toc.txt +++ b/configs/J7200/J7200_linux_toc.txt @@ -49,7 +49,7 @@ linux/Foundational_Components/U-Boot/Apps-TroubleShooting linux/Foundational_Components_Kernel linux/Foundational_Components_Kernel_Drivers linux/Foundational_Components/Kernel/Kernel_Drivers/ADC -linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/SA2UL_OMAP +linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/Crypto linux/Foundational_Components/Kernel/Kernel_Drivers/DDR linux/Foundational_Components/Kernel/Kernel_Drivers/DM-Timer linux/Foundational_Components/Kernel/Kernel_Drivers/MCAN diff --git a/configs/J721E/J721E_linux_toc.txt b/configs/J721E/J721E_linux_toc.txt index 9e6d06c17..1f0054d29 100644 --- a/configs/J721E/J721E_linux_toc.txt +++ b/configs/J721E/J721E_linux_toc.txt @@ -51,7 +51,7 @@ linux/Foundational_Components_Kernel_Drivers linux/Foundational_Components/Kernel/Kernel_Drivers/ADC linux/Foundational_Components/Kernel/Kernel_Drivers/Audio linux/Foundational_Components/Kernel/Kernel_Drivers/Camera/CSI2RX_J721E -linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/SA2UL_OMAP +linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/Crypto linux/Foundational_Components/Kernel/Kernel_Drivers/DDR linux/Foundational_Components/Kernel/Kernel_Drivers/Display/DSS7 linux/Foundational_Components/Kernel/Kernel_Drivers/DM-Timer diff --git a/configs/J721S2/J721S2_linux_toc.txt b/configs/J721S2/J721S2_linux_toc.txt index ac3a08b5b..1f85e0994 100644 --- a/configs/J721S2/J721S2_linux_toc.txt +++ b/configs/J721S2/J721S2_linux_toc.txt @@ -51,7 +51,7 @@ linux/Foundational_Components_Kernel_Drivers linux/Foundational_Components/Kernel/Kernel_Drivers/ADC linux/Foundational_Components/Kernel/Kernel_Drivers/Audio linux/Foundational_Components/Kernel/Kernel_Drivers/Camera/CSI2RX_J721S2 -linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/SA2UL_OMAP +linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/Crypto linux/Foundational_Components/Kernel/Kernel_Drivers/Display/DSS7 linux/Foundational_Components/Kernel/Kernel_Drivers/DM-Timer linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO diff --git a/configs/J722S/J722S_linux_toc.txt b/configs/J722S/J722S_linux_toc.txt index 1db71c708..c18bea676 100644 --- a/configs/J722S/J722S_linux_toc.txt +++ b/configs/J722S/J722S_linux_toc.txt @@ -50,7 +50,7 @@ linux/Foundational_Components_Kernel_Drivers linux/Foundational_Components/Kernel/Kernel_Drivers/ADC linux/Foundational_Components/Kernel/Kernel_Drivers/Audio linux/Foundational_Components/Kernel/Kernel_Drivers/Camera/CSI2RX_J722S -linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/SA2UL_OMAP +linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/Crypto linux/Foundational_Components/Kernel/Kernel_Drivers/Display/DSS7 linux/Foundational_Components/Kernel/Kernel_Drivers/DM-Timer linux/Foundational_Components/Kernel/Kernel_Drivers/E5010_JPEG_Encoder diff --git a/configs/J742S2/J742S2_linux_toc.txt b/configs/J742S2/J742S2_linux_toc.txt index 6b71787c3..b5fd64fb7 100644 --- a/configs/J742S2/J742S2_linux_toc.txt +++ b/configs/J742S2/J742S2_linux_toc.txt @@ -49,7 +49,7 @@ linux/Foundational_Components_Kernel_Drivers linux/Foundational_Components/Kernel/Kernel_Drivers/ADC linux/Foundational_Components/Kernel/Kernel_Drivers/Audio linux/Foundational_Components/Kernel/Kernel_Drivers/Camera/CSI2RX_J784S4 -linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/SA2UL_OMAP +linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/Crypto linux/Foundational_Components/Kernel/Kernel_Drivers/Display/DSS7 linux/Foundational_Components/Kernel/Kernel_Drivers/DM-Timer linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO diff --git a/configs/J784S4/J784S4_linux_toc.txt b/configs/J784S4/J784S4_linux_toc.txt index 98a2252b4..9ed2cf83d 100644 --- a/configs/J784S4/J784S4_linux_toc.txt +++ b/configs/J784S4/J784S4_linux_toc.txt @@ -50,7 +50,7 @@ linux/Foundational_Components_Kernel_Drivers linux/Foundational_Components/Kernel/Kernel_Drivers/ADC linux/Foundational_Components/Kernel/Kernel_Drivers/Audio linux/Foundational_Components/Kernel/Kernel_Drivers/Camera/CSI2RX_J784S4 -linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/SA2UL_OMAP +linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/Crypto linux/Foundational_Components/Kernel/Kernel_Drivers/Display/DSS7 linux/Foundational_Components/Kernel/Kernel_Drivers/DM-Timer linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO diff --git a/configs/TDA4VM/TDA4VM_linux_toc.txt b/configs/TDA4VM/TDA4VM_linux_toc.txt index 41ff0cee8..c923525fa 100644 --- a/configs/TDA4VM/TDA4VM_linux_toc.txt +++ b/configs/TDA4VM/TDA4VM_linux_toc.txt @@ -50,7 +50,7 @@ linux/Foundational_Components_Kernel_Drivers linux/Foundational_Components/Kernel/Kernel_Drivers/ADC linux/Foundational_Components/Kernel/Kernel_Drivers/Audio linux/Foundational_Components/Kernel/Kernel_Drivers/Camera/CSI2RX_J721E -linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/SA2UL_OMAP +linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/Crypto linux/Foundational_Components/Kernel/Kernel_Drivers/Display/DSS7 linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO linux/Foundational_Components/Kernel/Kernel_Drivers/HYPERFLASH diff --git a/source/devices/AM62LX/linux/Release_Specific_Release_Notes.rst b/source/devices/AM62LX/linux/Release_Specific_Release_Notes.rst index b64e030c1..6de147b82 100644 --- a/source/devices/AM62LX/linux/Release_Specific_Release_Notes.rst +++ b/source/devices/AM62LX/linux/Release_Specific_Release_Notes.rst @@ -82,7 +82,7 @@ What's new - U-Boot: :ref:`User and Reduced Bootmode OTP Programming ` - U-Boot: :ref:`Key writer lite Programming ` - Uboot: :ref:`A53 SPL Falcon boot ` - - Kernel: :ref:`DTHEv2 Crypto Accelerator ` + - Kernel: :ref:`DTHEv2 Crypto Accelerator ` - RT Kernel : Real-Time Linux Interrupt Latency numbers here - :ref:`RT Interrupt Latencies ` - Support for Wifi with M2 CC33xx cards - :ref:`How to Enable M.2-CC33xx in Linux ` - Out-of-Box experience based on LVGL (Light and Versatile Graphics Library) - :ref:`TI LVGL Demo - User Guide ` diff --git a/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/Crypto.rst b/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/Crypto.rst new file mode 100644 index 000000000..541db1a6c --- /dev/null +++ b/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/Crypto.rst @@ -0,0 +1,600 @@ +.. _crypto-accelerator: + +###### +Crypto +###### + +************ +Introduction +************ + +The Crypto API Driver is a set of Linux drivers that provide access to the +hardware cryptographic accelerators. These drivers are available built-in +in the kernel in the current SDK release. + +The following is a list of supported hardware accelerated algorithms: + +.. ifconfig:: CONFIG_crypto in ('DTHEv2') + + .. list-table:: DTHEv2 Hardware Cryptography Support + :header-rows: 1 + + * - Device Family + - Encryption + - Encryption with Authentication + - Hash Algorithms + - MAC Algorithms + + * - AM62LX + - AES (ECB, CBC, XTS, CTR) + - AES-GCM, AES-CCM + - MD5, SHA224, SHA256, SHA384, SHA512 + - HMAC(MD5), HMAC(SHA224), HMAC(SHA256), HMAC(SHA384), HMAC(SHA512) + +.. ifconfig:: CONFIG_crypto not in ('DTHEv2') + + .. list-table:: SA2UL/SA3UL Hardware Cryptography Support + :header-rows: 1 + + * - Device Family + - Encryption + - Encryption with Authentication + - Hash Algorithms + - MAC Algorithms + + * - AM335X + - AES, DES + - + - MD5, SHA1, SHA224, SHA256 + - + + * - AM437X + - AES, DES, 3DES + - + - MD5, SHA1, SHA224, SHA256, SHA384, SHA512 + - + + * - AM57x / DRA7 + - AES, DES, 3DES + - + - + - + + * - AM65x / J721e / J7200 + - AES (CBC, ECB), 3DES (CBC, ECB) + - AES-GCM, AUTHENC(HMAC-SHA1, CBC-AES), AUTHENC(HMAC-SHA256, CBC-AES) + - SHA1, SHA256, SHA512 + - HMAC(SHA1, SHA256, SHA512), CMAC(AES) + + * - J721S2 / J784S4 / J742S2 + - AES (CBC, ECB), 3DES (CBC, ECB) + - AES-GCM, AUTHENC(HMAC-SHA1, CBC-AES), AUTHENC(HMAC-SHA256, CBC-AES) + - SHA1, SHA256, SHA512 + - HMAC(SHA1, SHA256, SHA512), CMAC(AES) + + * - AM68 / AM69 + - AES (CBC, ECB), 3DES (CBC, ECB) + - AES-GCM, AUTHENC(HMAC-SHA1, CBC-AES), AUTHENC(HMAC-SHA256, CBC-AES) + - SHA1, SHA256, SHA512 + - HMAC(SHA1, SHA256, SHA512), CMAC(AES) + + * - AM64X / J722S + - AES (CBC, ECB) + - AES-GCM, AUTHENC(HMAC-SHA256, CBC-AES) + - SHA256, SHA512 + - CMAC(AES) + + * - AM62X / AM62A / AM62D / AM62P + - AES (CBC, ECB) + - AES-GCM, AUTHENC(HMAC-SHA256, CBC-AES) + - SHA256, SHA512 + - CMAC(AES) + +***************************** +Crypto Implementation Options +***************************** + +Users can implement cryptographic operations by using one of the following approaches: + +1. **Hardware Accelerator** + + - Offloads crypto operations to dedicated hardware engine + - Frees up CPU cycles for other tasks + - In general lower throughput but optimized for multi-tasking systems + +2. **ARM CPU with Cryptographic Extension (ARM CE)** + + - Uses ARM core's built-in cryptographic hardware level instruction extensions + - Delivers higher throughput (faster than hardware accelerator) + - Might require high CPU usage + +Choosing the Right Implementation +================================= + +**Use Hardware Accelerator when:** + +- **Multi-tasking systems** - system runs computation heavy services that need CPU resources alongside crypto operations +- **Functional safety/security requirements** - ASIL or safety-critical applications require offloading crypto operations away from Linux kernel to reduce attack surface and ensure isolation +- **Compliance/regulatory requirements** - FIPS certification, Common Criteria, or TEE integration mandates hardware acceleration + +**Use ARM CPU (CE) when:** + +- **Maximum throughput required** - Need high throughput for bulk data encryption, video transcoding, or media processing +- **Dedicated crypto workload** - Crypto is the primary task and high CPU usage is acceptable +- **Small/infrequent operations** - One-time encryption with small data blocks where accelerator overhead is minimal + +**Performance Comparison** : For a detailed comparison of hardware accelerator performance against ARM Cryptographic Extension (CE) and baseline ARM CPU, see :ref:`crypto-performance` in the Linux Performance Guide. + +******************** +Building the Drivers +******************** + +For devices with available cryptographic hardware accelerators, a Linux +driver and additionally a Cryptodev kernel module (for OpenSSL) is used +to access them. Other devices use the pure software implementation of these +cryptographic operations. + + +.. ifconfig:: CONFIG_crypto in ('DTHEv2') + + |__PART_FAMILY_DEVICE_NAMES__| SoC supports a hardware accelerator called + DATA TRANSFORM AND HASHING ENGINE (DTHE) v2 for crypto operations. + +.. ifconfig:: CONFIG_crypto in ('sa2ul') + + |__PART_FAMILY_DEVICE_NAMES__| SoCs support a hardware accelerator called + Security Accelerator 2/3 Ultra Light (SA2UL/SA3UL) for crypto operations. + +The kernel configuration has already been set up in the SDK and no further +configuration is needed for the drivers to be built-in to the kernel. + +For reference, the configuration details are shown below. The +configuration of the cryptographic drivers is done under the +Hardware crypto devices sub-menu of the Cryptographic API menu in the +kernel configuration. + +.. ifconfig:: CONFIG_crypto in ('DTHEv2') + + .. code-block:: text + + Symbol: CRYPTO_DEV_TI_DTHEV2 [=m] + | Type : tristate + | Prompt: Support for TI security accelerator + | Location: + | -> Cryptographic API (CRYPTO [=y]) + | (1) -> Hardware crypto devices (CRYPTO_HW [=y]) + + To check if DTHEv2 module is properly installed, + run the below command from the Linux command prompt: + + .. code-block:: console + + lsmod | grep dthev2 + + Output should show something similar to below: + + .. code-block:: text + + dthev2 262144 0 + +.. ifconfig:: CONFIG_crypto in ('sa2ul') + + .. code-block:: text + + Symbol: CRYPTO_DEV_SA2UL [=m] + | Type : tristate + | Prompt: Support for TI security accelerator + | Location: + | -> Cryptographic API (CRYPTO [=y]) + | (1) -> Hardware crypto devices (CRYPTO_HW [=y]) + + To check if sa2ul module is properly installed, + run the below command from the Linux command prompt: + + .. code-block:: console + + lsmod | grep sa2ul + + Output should show something similar to below: + + .. code-block:: text + + sa2ul 262144 0 + +.. ifconfig:: CONFIG_crypto in ('omap') + + .. code-block:: text + + --- Cryptographic API + [*] Hardware crypto devices ---> + --- Hardware crypto devices + <*> Support for OMAP MD5/SHA1/SHA2 hw accelerator + <*> Support for OMAP AES hw engine + <*> Support for OMAP DES3DES hw engine + + Messages printed during bootup will indicate that initialization of the + crypto modules has taken place. + + .. code-block:: console + + [ 2.120565] omap-sham 53100000.sham: hw accel on OMAP rev 4.3 + [ 2.160584] mmc1: BKOPS_EN bit is not set + [ 2.173466] omap-aes 53500000.aes: OMAP AES hw accel rev: 3.2 + [ 2.180241] edma-dma-engine edma-dma-engine.0: allocated channel for 0:5 + [ 2.187808] edma-dma-engine edma-dma-engine.0: allocated channel for 0:6 + + For reference, the RNG configuration details are shown below. + + In the configuration menu, scroll down to Device Drivers and hit enter. + Now scroll to Character devices and hit enter. + + .. code-block:: text + + Device Drivers ---> + Character devices ---> + < > Hardware Random Number Generator Core support + < > OMAP Random Number Generator support + + Messages printed during bootup will indicate that initialization of the + RNG module has taken place. + + .. code-block:: console + + [ 1.660514] omap_rng 48310000.rng: OMAP Random Number Generator ver. 20 + +.. rubric:: Build the Cryptodev kernel module using SDK + :name: build-the-cryptodev-kernel-module-using-sdk + +For using OpenSSL to access the Crypto Hardware Accelerator Drivers +above, the Cryptodev is required (can be built as module). The framework +is not officially in the kernel and was ported to Linux under the name +"cryptodev". It is built as part of the SDK and no further configuration is needed. + +****************************************************** +Using Cryptographic Hardware Accelerators from OpenSSL +****************************************************** + +In order to use these drivers from OpenSSL, a +special driver is available which abstracts the access to these +accelerators through Cryprodev module. + +Cryptodev is itself a special device driver which provides a general +interface for higher level applications such as OpenSSL to access +hardware accelerators. + +The filesystem which comes with the SDK comes built with the Cryptodev +kernel modules and the TI driver which directly accesses the hardware +accelerators is built into the kernel. + +The following shows the command used to query the system for the state of +the cryptodev module. + +.. code-block:: console + + root@evm:~# lsmod | grep cryptodev + cryptodev 11962 0 + +The following example demonstrates the OpenSSL built-in speed +test to demonstrate performance. The addition of the parameter **-engine +devcrypto** tells OpenSSL to use the Cryptodev driver if it exists. + +.. code-block:: console + + root@evm:~# openssl speed -evp aes-128-cbc -engine devcrypto + engine "devcrypto" set. + Doing AES-128-CBC ops for 3s on 16 size blocks: 108107 AES-128-CBC ops in 0.16s + Doing AES-128-CBC ops for 3s on 64 size blocks: 103730 AES-128-CBC ops in 0.20s + Doing AES-128-CBC ops for 3s on 256 size blocks: 15181 AES-128-CBC ops in 0.03s + Doing AES-128-CBC ops for 3s on 1024 size blocks: 15879 AES-128-CBC ops in 0.03s + Doing AES-128-CBC ops for 3s on 8192 size blocks: 4879 AES-128-CBC ops in 0.02s + version: 3.2.3 + built on: Tue Sep 3 12:52:35 2024 UTC + options: bn(64,64) + compiler: aarch64-oe-linux-gcc -mbranch-protection=standard --sysroot=recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fcanon-prefix-map -fmacro-prefix-map= -fdebug-prefix-map= -fmacro-prefix-mapG + CPUINFO: OPENSSL_armcap=0xbd + The 'numbers' are in 1000s of bytes per second processed. + type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes + AES-128-CBC 10810.70k 33193.60k 129544.53k 542003.20k 1998438.40k + +Using the Linux time -v function gives more information about CPU usage +during the test. + +.. code-block:: console + + root@evm:~# time -v openssl speed -evp aes-128-cbc -engine devcrypto + Engine "devcrypto" set. + Doing AES-128-CBC ops for 3s on 16 size blocks: 108799 AES-128-CBC ops in 0.17s + Doing AES-128-CBC ops for 3s on 64 size blocks: 102699 AES-128-CBC ops in 0.18s + Doing AES-128-CBC ops for 3s on 256 size blocks: 16166 AES-128-CBC ops in 0.03s + Doing AES-128-CBC ops for 3s on 1024 size blocks: 15080 AES-128-CBC ops in 0.03s + Doing AES-128-CBC ops for 3s on 8192 size blocks: 4838 AES-128-CBC ops in 0.03s + version: 3.2.3 + built on: Tue Sep 3 12:52:35 2024 UTC + options: bn(64,64) + compiler: aarch64-oe-linux-gcc -mbranch-protection=standard --sysroot=recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fcanon-prefix-map -fmacro-prefix-map= -fdebug-prefix-map= -fmacro-prefix-mapG + CPUINFO: OPENSSL_armcap=0xbd + The 'numbers' are in 1000s of bytes per second processed. + type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes + AES-128-CBC 10239.91k 36515.20k 137949.87k 514730.67k 1321096.53k + Command being timed: "openssl speed -evp aes-128-cbc -engine devcrypto" + User time (seconds): 0.46 + System time (seconds): 5.89 + Percent of CPU this job got: 42% + Elapsed (wall clock) time (h:mm:ss or m:ss): 0m 15.06s + Average shared text size (kbytes): 0 + Average unshared data size (kbytes): 0 + Average stack size (kbytes): 0 + Average total size (kbytes): 0 + Maximum resident set size (kbytes): 7104 + Average resident set size (kbytes): 0 + Major (requiring I/O) page faults: 0 + Minor (reclaiming a frame) page faults: 479 + Voluntary context switches: 36143 + Involuntary context switches: 211570 + Swaps: 0 + File system inputs: 0 + File system outputs: 0 + Socket messages sent: 0 + Socket messages received: 0 + Signals delivered: 0 + Page size (bytes): 4096 + Exit status: 0 + +When the cryptodev driver is removed, OpenSSL reverts to the software +implementation of the crypto algorithm. The performance using the +software only implementation can be compared to the previous test. + +.. code-block:: console + + root@evm:~# modprobe -r cryptodev + root@evm:~# time -v openssl speed -evp aes-128-cbc + Doing AES-128-CBC ops for 3s on 16 size blocks: 697674 AES-128-CBC ops in 2.99s + Doing AES-128-CBC ops for 3s on 64 size blocks: 187556 AES-128-CBC ops in 3.00s + Doing AES-128-CBC ops for 3s on 256 size blocks: 47922 AES-128-CBC ops in 3.00s + Doing AES-128-CBC ops for 3s on 1024 size blocks: 12049 AES-128-CBC ops in 3.00s + Doing AES-128-CBC ops for 3s on 8192 size blocks: 1509 AES-128-CBC ops in 3.00s + version: 3.2.3 + built on: Tue Sep 3 12:52:35 2024 UTC + options: bn(64,64) + compiler: aarch64-oe-linux-gcc -mbranch-protection=standard --sysroot=recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fcanon-prefix-map -fmacro-prefix-map= -fdebug-prefix-map= -fmacro-prefix-mapG + CPUINFO: OPENSSL_armcap=0xbd + The 'numbers' are in 1000s of bytes per second processed. + type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes + AES-128-CBC 3733.37k 4001.19k 4089.34k 4112.73k 4120.58k + Command being timed: "openssl speed -evp aes-128-cbc" + User time (seconds): 15.03 + System time (seconds): 0.00 + Percent of CPU this job got: 99% + Elapsed (wall clock) time (h:mm:ss or m:ss): 0m 15.07s + Average shared text size (kbytes): 0 + Average unshared data size (kbytes): 0 + Average stack size (kbytes): 0 + Average total size (kbytes): 0 + Maximum resident set size (kbytes): 7216 + Average resident set size (kbytes): 0 + Major (requiring I/O) page faults: 1 + Minor (reclaiming a frame) page faults: 484 + Voluntary context switches: 13 + Involuntary context switches: 35 + Swaps: 0 + File system inputs: 0 + File system outputs: 0 + Socket messages sent: 0 + Socket messages received: 0 + Signals delivered: 0 + Page size (bytes): 4096 + Exit status: 0 + +****************************************************************** +Using the True Random Number Generator (TRNG) Hardware Accelerator +****************************************************************** + +In the default SDK, OP-TEE controls the TRNG engine and firewalls its +hardware registers, blocking outside access. To use TRNG from Linux instead, +disable the OP-TEE driver and enable the RNG node in the Linux device tree. + +Using TRNG from OP-TEE requires no further configuration. Verify the optee-rng +driver loads: + +.. ifconfig:: CONFIG_crypto in ('sa2ul', 'DTHEv2') + + Check that the optee-rng driver is loaded: + + .. code-block:: console + + root@evm:~# cat /sys/class/misc/hw_random/rng_current + optee-rng + +The hwrng device should now show up in the filesystem. + +.. code-block:: console + + root@evm:~# ls -l /dev/hwrng + crw------- 1 root root 10, 183 Jan 1 2000 /dev/hwrng + +Use :command:`cat` on this device to generate random numbers. + +.. code-block:: console + + root@evm:~# cat /dev/hwrng | od -x + 0000000 b2bd ae08 4477 be48 4836 bf64 5d92 01c9 + 0000020 0cb6 7ac5 16f9 8616 a483 7dfd 6bf4 3aa5 + 0000040 d693 db24 d917 5ee7 feb7 34c3 34e9 e7a5 + 0000060 36b7 ea85 fc17 0e66 555c 0934 7a0c 4c69 + 0000100 523b 9f21 1546 fddb d58b e5ed 142a 6712 + 0000120 8d76 8f80 a6d2 30d8 d107 32bc 7f45 f997 + 0000140 9d5d 0d0c f1f0 64f9 a77f 408f b0c1 f5a0 + 0000160 39c6 f0ae 4b59 1a76 84a7 a364 8964 f557 + root@evm:~# + +Test the random number generator on the target. + +.. code-block:: console + + root@evm:~# cat /dev/hwrng | rngtest -c 1000 + rngtest 6.16 + Copyright (c) 2004 by Henrique de Moraes Holschuh + This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + rngtest: starting FIPS tests... + rngtest: bits received from input: 20000032 + rngtest: FIPS 140-2 successes: 999 + rngtest: FIPS 140-2 failures: 1 + rngtest: FIPS 140-2(2001-10-10) Monobit: 0 + rngtest: FIPS 140-2(2001-10-10) Poker: 0 + rngtest: FIPS 140-2(2001-10-10) Runs: 1 + rngtest: FIPS 140-2(2001-10-10) Long run: 0 + rngtest: FIPS 140-2(2001-10-10) Continuous run: 0 + rngtest: input channel speed: (min=788.218; avg=4070.983; max=2790178.571)Kibits/s + rngtest: FIPS tests speed: (min=846.755; avg=15388.376; max=21920.595)Kibits/s + rngtest: Program run time: 6072670 microseconds + +Note that the results may be slightly different on your system, since, +after all, we're dealing with a random number generator. Any appreciable +number of errors typically indicates a bad random number generator. + +If you're satisfied the random number generator is working correctly, +you can use :program:`rngd` (the random number generator daemon) to feed the +:file:`/dev/random` entropy pool. + +**************************** +Hardware Accelerator testing +**************************** + +Testing using the :program:`tcrypt` module +========================================== + +.. ifconfig:: CONFIG_crypto not in ('DTHEv2') + + .. code-block:: console + + root@evm:~# modprobe tcrypt mode=500 sec=1 + [ 3006.234145] testing speed of async ecb(aes) (ecb-aes-sa2ul) encryption + [ 3006.242891] tcrypt: test 0 (128 bit key, 16 byte blocks): 87335 operations in 1 seconds (1397360 bytes) + [ 3007.251651] tcrypt: test 1 (128 bit key, 64 byte blocks): 87669 operations in 1 seconds (5610816 bytes) + [ 3008.259651] tcrypt: test 2 (128 bit key, 256 byte blocks): 87481 operations in 1 seconds (22395136 bytes) + [ 3009.267828] tcrypt: test 3 (128 bit key, 1024 byte blocks): 58076 operations in 1 seconds (59469824 bytes) + [ 3010.275914] tcrypt: test 4 (128 bit key, 8192 byte blocks): 22556 operations in 1 seconds (184778752 bytes) + [ 3011.284006] tcrypt: test 5 (192 bit key, 16 byte blocks): 80305 operations in 1 seconds (1284880 bytes) + [ 3012.291648] tcrypt: test 6 (192 bit key, 64 byte blocks): 84537 operations in 1 seconds (5410368 bytes) + [ 3013.299648] tcrypt: test 7 (192 bit key, 256 byte blocks): 90540 operations in 1 seconds (23178240 bytes) + [ 3014.307834] tcrypt: test 8 (192 bit key, 1024 byte blocks): 56054 operations in 1 seconds (57399296 bytes) + [ 3015.315915] tcrypt: test 9 (192 bit key, 8192 byte blocks): 20701 operations in 1 seconds (169582592 bytes) + [ 3016.324006] tcrypt: test 10 (256 bit key, 16 byte blocks): 81816 operations in 1 seconds (1309056 bytes) + [ 3017.331736] tcrypt: test 11 (256 bit key, 64 byte blocks): 82418 operations in 1 seconds (5274752 bytes) + [ 3018.339739] tcrypt: test 12 (256 bit key, 256 byte blocks): 87217 operations in 1 seconds (22327552 bytes) + [ 3019.347917] tcrypt: test 13 (256 bit key, 1024 byte blocks): 56534 operations in 1 seconds (57890816 bytes) + [ 3020.356012] tcrypt: test 14 (256 bit key, 8192 byte blocks): 20428 operations in 1 seconds (167346176 bytes) + [ 3021.364131] tcrypt: + [ 3021.364131] testing speed of async ecb(aes) (ecb-aes-sa2ul) decryption + [ 3021.373505] tcrypt: test 0 (128 bit key, 16 byte blocks): 81655 operations in 1 seconds (1306480 bytes) + [ 3022.379660] tcrypt: test 1 (128 bit key, 64 byte blocks): 87373 operations in 1 seconds (5591872 bytes) + [ 3023.387659] tcrypt: test 2 (128 bit key, 256 byte blocks): 81323 operations in 1 seconds (20818688 bytes) + [ 3024.395825] tcrypt: test 3 (128 bit key, 1024 byte blocks): 58990 operations in 1 seconds (60405760 bytes) + [ 3025.403928] tcrypt: test 4 (128 bit key, 8192 byte blocks): 22613 operations in 1 seconds (185245696 bytes) + [ 3026.411996] tcrypt: test 5 (192 bit key, 16 byte blocks): 79558 operations in 1 seconds (1272928 bytes) + [ 3027.419648] tcrypt: test 6 (192 bit key, 64 byte blocks): 86877 operations in 1 seconds (5560128 bytes) + [ 3028.427648] tcrypt: test 7 (192 bit key, 256 byte blocks): 80615 operations in 1 seconds (20637440 bytes) + [ 3029.435831] tcrypt: test 8 (192 bit key, 1024 byte blocks): 62007 operations in 1 seconds (63495168 bytes) + [ 3030.443907] tcrypt: test 9 (192 bit key, 8192 byte blocks): 21569 operations in 1 seconds (176693248 bytes) + [ 3031.452015] tcrypt: test 10 (256 bit key, 16 byte blocks): 86171 operations in 1 seconds (1378736 bytes) + [ 3032.459743] tcrypt: test 11 (256 bit key, 64 byte blocks): 79752 operations in 1 seconds (5104128 bytes) + [ 3033.467770] tcrypt: test 12 (256 bit key, 256 byte blocks): 84351 operations in 1 seconds (21593856 bytes) + [ 3034.475919] tcrypt: test 13 (256 bit key, 1024 byte blocks): 57082 operations in 1 seconds (58451968 bytes) + [ 3035.483995] tcrypt: test 14 (256 bit key, 8192 byte blocks): 20489 operations in 1 seconds (167845888 bytes) + [ 3036.492101] tcrypt: + ... + +.. ifconfig:: CONFIG_crypto in ('DTHEv2') + + .. code-block:: console + + root@evm:~# modprobe tcrypt mode=500 sec=1 + [ 1012.121422] tcrypt: testing speed of async ecb(aes) (ecb-aes-dthev2) encryption + [ 1012.128872] tcrypt: test 0 (128 bit key, 16 byte blocks): 4931 operations in 1 seconds (78896 bytes) + [ 1013.138110] tcrypt: test 1 (128 bit key, 64 byte blocks): 4940 operations in 1 seconds (316160 bytes) + [ 1014.146146] tcrypt: test 2 (128 bit key, 128 byte blocks): 4940 operations in 1 seconds (632320 bytes) + [ 1015.154298] tcrypt: test 3 (128 bit key, 256 byte blocks): 4940 operations in 1 seconds (1264640 bytes) + [ 1016.162329] tcrypt: test 4 (128 bit key, 1024 byte blocks): 4980 operations in 1 seconds (5099520 bytes) + [ 1017.170491] tcrypt: test 5 (128 bit key, 1424 byte blocks): 4940 operations in 1 seconds (7034560 bytes) + [ 1018.178486] tcrypt: test 6 (128 bit key, 4096 byte blocks): 4960 operations in 1 seconds (20316160 bytes) + [ 1019.186570] tcrypt: test 7 (192 bit key, 16 byte blocks): 4960 operations in 1 seconds (79360 bytes) + [ 1020.194482] tcrypt: test 8 (192 bit key, 64 byte blocks): 4940 operations in 1 seconds (316160 bytes) + [ 1021.202151] tcrypt: test 9 (192 bit key, 128 byte blocks): 5000 operations in 1 seconds (640000 bytes) + [ 1022.210225] tcrypt: test 10 (192 bit key, 256 byte blocks): 4940 operations in 1 seconds (1264640 bytes) + [ 1023.218410] tcrypt: test 11 (192 bit key, 1024 byte blocks): 5000 operations in 1 seconds (5120000 bytes) + [ 1024.226494] tcrypt: test 12 (192 bit key, 1424 byte blocks): 5000 operations in 1 seconds (7120000 bytes) + [ 1025.234490] tcrypt: test 13 (192 bit key, 4096 byte blocks): 4980 operations in 1 seconds (20398080 bytes) + [ 1026.242625] tcrypt: test 14 (256 bit key, 16 byte blocks): 4940 operations in 1 seconds (79040 bytes) + [ 1027.250155] tcrypt: test 15 (256 bit key, 64 byte blocks): 4960 operations in 1 seconds (317440 bytes) + [ 1028.258293] tcrypt: test 16 (256 bit key, 128 byte blocks): 4940 operations in 1 seconds (632320 bytes) + [ 1029.266342] tcrypt: test 17 (256 bit key, 256 byte blocks): 4940 operations in 1 seconds (1264640 bytes) + [ 1030.274405] tcrypt: test 18 (256 bit key, 1024 byte blocks): 4960 operations in 1 seconds (5079040 bytes) + [ 1031.282506] tcrypt: test 19 (256 bit key, 1424 byte blocks): 4980 operations in 1 seconds (7091520 bytes) + [ 1032.294641] tcrypt: test 20 (256 bit key, 4096 byte blocks): 4980 operations in 1 seconds (20398080 bytes) + [ 1033.302656] tcrypt: testing speed of async ecb(aes) (ecb-aes-dthev2) decryption + [ 1033.310809] tcrypt: test 0 (128 bit key, 16 byte blocks): 4940 operations in 1 seconds (79040 bytes) + [ 1034.318058] tcrypt: test 1 (128 bit key, 64 byte blocks): 4960 operations in 1 seconds (317440 bytes) + [ 1035.326153] tcrypt: test 2 (128 bit key, 128 byte blocks): 4940 operations in 1 seconds (632320 bytes) + [ 1036.334354] tcrypt: test 3 (128 bit key, 256 byte blocks): 4940 operations in 1 seconds (1264640 bytes) + [ 1037.342372] tcrypt: test 4 (128 bit key, 1024 byte blocks): 4920 operations in 1 seconds (5038080 bytes) + [ 1038.350475] tcrypt: test 5 (128 bit key, 1424 byte blocks): 4940 operations in 1 seconds (7034560 bytes) + [ 1039.358415] tcrypt: test 6 (128 bit key, 4096 byte blocks): 4940 operations in 1 seconds (20234240 bytes) + [ 1040.366508] tcrypt: test 7 (192 bit key, 16 byte blocks): 4940 operations in 1 seconds (79040 bytes) + [ 1041.374071] tcrypt: test 8 (192 bit key, 64 byte blocks): 4960 operations in 1 seconds (317440 bytes) + [ 1042.382158] tcrypt: test 9 (192 bit key, 128 byte blocks): 4960 operations in 1 seconds (634880 bytes) + [ 1043.390282] tcrypt: test 10 (192 bit key, 256 byte blocks): 4940 operations in 1 seconds (1264640 bytes) + [ 1044.398466] tcrypt: test 11 (192 bit key, 1024 byte blocks): 4940 operations in 1 seconds (5058560 bytes) + [ 1045.406558] tcrypt: test 12 (192 bit key, 1424 byte blocks): 4940 operations in 1 seconds (7034560 bytes) + [ 1046.414503] tcrypt: test 13 (192 bit key, 4096 byte blocks): 4940 operations in 1 seconds (20234240 bytes) + [ 1047.422793] tcrypt: test 14 (256 bit key, 16 byte blocks): 4960 operations in 1 seconds (79360 bytes) + [ 1048.430409] tcrypt: test 15 (256 bit key, 64 byte blocks): 4960 operations in 1 seconds (317440 bytes) + [ 1049.438295] tcrypt: test 16 (256 bit key, 128 byte blocks): 4940 operations in 1 seconds (632320 bytes) + [ 1050.446313] tcrypt: test 17 (256 bit key, 256 byte blocks): 4940 operations in 1 seconds (1264640 bytes) + [ 1051.454411] tcrypt: test 18 (256 bit key, 1024 byte blocks): 4960 operations in 1 seconds (5079040 bytes) + [ 1052.462508] tcrypt: test 19 (256 bit key, 1424 byte blocks): 4960 operations in 1 seconds (7063040 bytes) + [ 1053.470497] tcrypt: test 20 (256 bit key, 4096 byte blocks): 4960 operations in 1 seconds (20316160 bytes) + ... + +IPSec Testing +============= + +.. rubric:: Server side + +.. code-block:: console + + # iperf3 --server + + Accepted connection from 192.168.1.1, port 41266 + [ 5] local 192.168.1.1 port 5201 connected to 192.168.1.2 port 58177 + [ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams + [ 5] 0.00-1.00 sec 45.6 MBytes 382 Mbits/sec 0.021 ms 0/33017 (0%) + [ 5] 1.00-2.00 sec 47.7 MBytes 400 Mbits/sec 0.014 ms 0/34534 (0%) + [ 5] 2.00-3.00 sec 47.7 MBytes 400 Mbits/sec 0.013 ms 0/34527 (0%) + [ 5] 3.00-4.00 sec 47.7 MBytes 400 Mbits/sec 0.037 ms 0/34507 (0%) + [ 5] 4.00-5.00 sec 47.7 MBytes 400 Mbits/sec 0.021 ms 0/34540 (0%) + [ 5] 5.00-6.00 sec 47.7 MBytes 400 Mbits/sec 0.020 ms 0/34537 (0%) + [ 5] 6.00-7.00 sec 47.7 MBytes 400 Mbits/sec 0.013 ms 0/34511 (0%) + [ 5] 7.00-8.00 sec 47.7 MBytes 400 Mbits/sec 0.017 ms 0/34543 (0%) + [ 5] 8.00-9.00 sec 47.7 MBytes 400 Mbits/sec 0.012 ms 0/34518 (0%) + [ 5] 9.00-10.00 sec 47.7 MBytes 400 Mbits/sec 0.022 ms 0/34532 (0%) + [ 5] 10.00-10.04 sec 2.10 MBytes 403 Mbits/sec 0.014 ms 0/1518 (0%) + +.. rubric:: Client side + +.. code-block:: console + + # iperf3 -c 192.168.1.1 -u -b 400.0M -t 10 + Connecting to host 192.168.1.1, port 5201 + [ 5] local 192.168.1.2 port 58177 connected to 192.168.1.1 port 5201 + [ ID] Interval Transfer Bitrate Total Datagrams + [ 5] 0.00-1.00 sec 47.7 MBytes 400 Mbits/sec 34510 + [ 5] 1.00-2.00 sec 47.7 MBytes 400 Mbits/sec 34531 + [ 5] 2.00-3.00 sec 47.7 MBytes 400 Mbits/sec 34530 + [ 5] 3.00-4.00 sec 47.7 MBytes 400 Mbits/sec 34531 + [ 5] 4.00-5.00 sec 47.7 MBytes 400 Mbits/sec 34530 + [ 5] 5.00-6.00 sec 47.7 MBytes 400 Mbits/sec 34530 + [ 5] 6.00-7.00 sec 47.7 MBytes 400 Mbits/sec 34531 + [ 5] 7.00-8.00 sec 47.7 MBytes 400 Mbits/sec 34530 + [ 5] 8.00-9.00 sec 47.7 MBytes 400 Mbits/sec 34530 + [ 5] 9.00-10.00 sec 47.7 MBytes 400 Mbits/sec 34531 diff --git a/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/DTHEv2.rst b/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/DTHEv2.rst deleted file mode 100644 index 2db530a1a..000000000 --- a/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/DTHEv2.rst +++ /dev/null @@ -1,375 +0,0 @@ -.. _DTHEv2-Crypto-Accelerator: -.. _crypto-accelerator: - -###### -Crypto -###### - -************ -Introduction -************ - -The Crypto API Driver is a set of Linux drivers that provide access to -the hardware cryptographic accelerators available on AM62L devices. -These drivers are available built-in in the kernel in the current SDK release. - -Following are the Hardware accelerators supported on the following -devices: - -.. code-block:: text - - * AM62LX : Encryption - AES-ECB, AES-CBC, AES-XTS, AES-CTR - Encryption with Authentication - AES-GCM, AES-CCM - Hashing - MD5, SHA224, SHA256, SHA384, SHA512 - Message Authentication - HMAC(MD5), HMAC(SHA224), HMAC(SHA256), HMAC(SHA384), HMAC(SHA512) - - -***************************** -Crypto Implementation Options -***************************** - -Users can implement cryptographic operations by using one of the following approaches: - -1. **Hardware Accelerator (DTHEv2)** - - - Offloads crypto operations to dedicated hardware engine - - Frees up CPU cycles for other tasks - - In general lower throughput but optimized for multi-tasking systems - -2. **ARM CPU with Cryptographic Extension (ARM CE)** - - - Uses ARM core's built-in cryptographic hardware level instruction extensions - - Delivers higher throughput (faster than hardware accelerator) - - Might require high CPU usage - -Choosing the Right Implementation -================================= - -**Use Hardware Accelerator (DTHEv2) when:** - -- **Multi-tasking systems** - system runs computation heavy services that need CPU resources alongside crypto operations -- **Functional safety/security requirements** - ASIL or safety-critical applications require offloading crypto operations away from Linux kernel to reduce attack surface and ensure isolation -- **Compliance/regulatory requirements** - FIPS certification, Common Criteria, or TEE integration mandates hardware acceleration - -**Use ARM CPU (CE) when:** - -- **Maximum throughput required** - Need high throughput for bulk data encryption, video transcoding, or media processing -- **Dedicated crypto workload** - Crypto is the primary task and high CPU usage is acceptable -- **Small/infrequent operations** - One-time encryption with small data blocks where accelerator overhead is minimal - -**Performance Comparison** : For a detailed comparison of DTHEv2 accelerator performance against ARM Cryptographic Extension (CE) and baseline ARM CPU, see :ref:`crypto-performance` in the Linux Performance Guide. - - -******************** -Building the Drivers -******************** - -For devices with available cryptographic hardware accelerators, a Linux -driver and additionally a Cryptodev kernel module (for OpenSSL) is used -to access them. Other devices use the pure software implementation of these -cryptographic operations. - -|__PART_FAMILY_DEVICE_NAMES__| SoC supports a hardware accelerator called -DATA TRANSFORM AND HASHING ENGINE (DTHE) v2 for crypto operations. - -The kernel configuration has already been set up in the SDK and no further -configuration is needed for the drivers to be built-in to the kernel. - -For reference, the configuration details are shown below. The -configuration of the cryptographic drivers is done under the -Hardware crypto devices sub-menu of the Cryptographic API menu in the -kernel configuration. - -.. code-block:: text - - Symbol: CRYPTO_DEV_TI_DTHEV2 [=m] - | Type : tristate - | Prompt: Support for TI security accelerator - | Location: - | -> Cryptographic API (CRYPTO [=y]) - | (1) -> Hardware crypto devices (CRYPTO_HW [=y]) - -To check if DTHEv2 module is properly installed, -run the below command from the Linux command prompt: - -.. code-block:: console - - lsmod | grep dthev2 - -Output should show something similar to below: - -.. code-block:: text - - dthev2 262144 0 - -.. rubric:: Build the Cryptodev kernel module using SDK - :name: build-the-cryptodev-kernel-module-using-sdk - -For using OpenSSL to access the Crypto Hardware Accelerator Drivers -above, the Cryptodev is required (can be built as module). The framework -is not officially in the kernel and was ported to Linux under the name -"cryptodev". It is built as part of the SDK and no further configuration is needed. - -****************************************************** -Using Cryptographic Hardware Accelerators from OpenSSL -****************************************************** - -In order to use these drivers from OpenSSL, a -special driver is available which abstracts the access to these -accelerators through Cryprodev module. - -Cryptodev is itself a special device driver which provides a general -interface for higher level applications such as OpenSSL to access -hardware accelerators. - -The filesystem which comes with the SDK comes built with the Cryptodev -kernel modules and the TI driver which directly accesses the hardware -accelerators is built into the kernel. - -The following shows the command used to query the system for the state of -the cryptodev module. - -.. code-block:: console - - root@evm:~# lsmod | grep cryptodev - cryptodev 11962 0 - -The following example demonstrates the OpenSSL built-in speed -test to demonstrate performance. The addition of the parameter **-engine -devcrypto** tells OpenSSL to use the Cryptodev driver if it exists. - -.. code-block:: console - - root@evm:~# openssl speed -evp aes-128-cbc -engine devcrypto - Engine "devcrypto" set. - Doing AES-128-CBC ops for 3s on 16 size blocks: 37316 AES-128-CBC ops in 0.00s - Doing AES-128-CBC ops for 3s on 64 size blocks: 37305 AES-128-CBC ops in 0.00s - Doing AES-128-CBC ops for 3s on 256 size blocks: 37503 AES-128-CBC ops in 0.00s - Doing AES-128-CBC ops for 3s on 1024 size blocks: 37504 AES-128-CBC ops in 0.00s - Doing AES-128-CBC ops for 3s on 8192 size blocks: 18784 AES-128-CBC ops in 0.00s - Doing AES-128-CBC ops for 3s on 16384 size blocks: 18701 AES-128-CBC ops in 0.00s - version: 3.2.3 - built on: Tue Sep 3 12:52:35 2024 UTC - options: bn(64,64) - compiler: aarch64-oe-linux-gcc -mbranch-protection=standard --sysroot=recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fcanon-prefix-map -fmacro-prefix-map= -fdebug-prefix-map= -fmacro-prefix-mapG - CPUINFO: OPENSSL_armcap=0xbd - The 'numbers' are in 1000s of bytes per second processed. - type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes - AES-128-CBC infk infk infk infk infk infk - -Using the Linux time -v function gives more information about CPU usage -during the test. - -.. code-block:: console - - root@evm:~# time -v openssl speed -evp aes-128-cbc -engine devcrypto - Engine "devcrypto" set. - Doing AES-128-CBC ops for 3s on 16 size blocks: 37194 AES-128-CBC ops in 0.00s - Doing AES-128-CBC ops for 3s on 64 size blocks: 37406 AES-128-CBC ops in 0.00s - Doing AES-128-CBC ops for 3s on 256 size blocks: 37455 AES-128-CBC ops in 0.00s - Doing AES-128-CBC ops for 3s on 1024 size blocks: 37503 AES-128-CBC ops in 0.00s - Doing AES-128-CBC ops for 3s on 8192 size blocks: 18744 AES-128-CBC ops in 0.01s - Doing AES-128-CBC ops for 3s on 16384 size blocks: 18727 AES-128-CBC ops in 0.01s - version: 3.2.3 - built on: Tue Sep 3 12:52:35 2024 UTC - options: bn(64,64) - compiler: aarch64-oe-linux-gcc -mbranch-protection=standard --sysroot=recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fcanon-prefix-map -fmacro-prefix-map= -fdebug-prefix-map= -fmacro-prefix-mapG - CPUINFO: OPENSSL_armcap=0xbd - The 'numbers' are in 1000s of bytes per second processed. - type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes - AES-128-CBC infk infk infk infk 15355084.80k 30682316.80k - Command being timed: "openssl speed -evp aes-128-cbc -engine devcrypto" - User time (seconds): 0.02 - System time (seconds): 11.40 - Percent of CPU this job got: 62% - Elapsed (wall clock) time (h:mm:ss or m:ss): 0m 18.42s - Average shared text size (kbytes): 0 - Average unshared data size (kbytes): 0 - Average stack size (kbytes): 0 - Average total size (kbytes): 0 - Maximum resident set size (kbytes): 23760 - Average resident set size (kbytes): 0 - Major (requiring I/O) page faults: 0 - Minor (reclaiming a frame) page faults: 329 - Voluntary context switches: 187095 - Involuntary context switches: 95 - Swaps: 0 - File system inputs: 0 - File system outputs: 0 - Socket messages sent: 0 - Socket messages received: 0 - Signals delivered: 0 - Page size (bytes): 4096 - Exit status: 0 - - -When the cryptodev driver is removed, OpenSSL reverts to the software -implementation of the crypto algorithm. The performance using the -software only implementation can be compared to the previous test. - -.. code-block:: console - - root@evm:~# modprobe -r cryptodev - root@evm:~# time -v openssl speed -evp aes-128-cbc - Doing AES-128-CBC ops for 3s on 16 size blocks: 18675602 AES-128-CBC ops in 2.99s - Doing AES-128-CBC ops for 3s on 64 size blocks: 14189260 AES-128-CBC ops in 2.99s - Doing AES-128-CBC ops for 3s on 256 size blocks: 7121339 AES-128-CBC ops in 2.98s - Doing AES-128-CBC ops for 3s on 1024 size blocks: 2437075 AES-128-CBC ops in 2.99s - Doing AES-128-CBC ops for 3s on 8192 size blocks: 340806 AES-128-CBC ops in 2.98s - Doing AES-128-CBC ops for 3s on 16384 size blocks: 171986 AES-128-CBC ops in 2.98s - version: 3.2.3 - built on: Tue Sep 3 12:52:35 2024 UTC - options: bn(64,64) - compiler: aarch64-oe-linux-gcc -mbranch-protection=standard --sysroot=recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fcanon-prefix-map -fmacro-prefix-map= -fdebug-prefix-map= -fmacro-prefix-mapG - CPUINFO: OPENSSL_armcap=0xbd - The 'numbers' are in 1000s of bytes per second processed. - type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes - AES-128-CBC 99936.33k 303716.60k 611766.03k 834637.06k 936873.41k 945576.72k - Command being timed: "openssl speed -evp aes-128-cbc" - User time (seconds): 17.91 - System time (seconds): 0.04 - Percent of CPU this job got: 99% - Elapsed (wall clock) time (h:mm:ss or m:ss): 0m 18.02s - Average shared text size (kbytes): 0 - Average unshared data size (kbytes): 0 - Average stack size (kbytes): 0 - Average total size (kbytes): 0 - Maximum resident set size (kbytes): 24304 - Average resident set size (kbytes): 0 - Major (requiring I/O) page faults: 0 - Minor (reclaiming a frame) page faults: 324 - Voluntary context switches: 1 - Involuntary context switches: 24 - Swaps: 0 - File system inputs: 0 - File system outputs: 0 - Socket messages sent: 0 - Socket messages received: 0 - Signals delivered: 0 - Page size (bytes): 4096 - Exit status: 0 - -****************************************************************** -Using the True Random Number Generator (TRNG) Hardware Accelerator -****************************************************************** - -In the default SDK, OP-TEE controls the TRNG engine and firewalls its -hardware registers, blocking outside access. To use TRNG from Linux instead, -disable the OP-TEE driver and enable the RNG node in the Linux device tree. - -Using TRNG from OP-TEE requires no further configuration. Verify the optee-rng -driver loads: - -.. code-block:: console - - root@am62lxx-evm:~# cat /sys/class/misc/hw_random/rng_current - optee-rng - -The hwrng device should now show up in the filesystem. - -.. code-block:: console - - root@am62lxx-evm:~# ls -l /dev/hwrng - crw------- 1 root root 10, 183 Jan 1 2000 /dev/hwrng - -Use :command:`cat` on this device to generate random numbers. - -.. code-block:: console - - root@am62lxx-evm:~# cat /dev/hwrng | od -x - 0000000 b2bd ae08 4477 be48 4836 bf64 5d92 01c9 - 0000020 0cb6 7ac5 16f9 8616 a483 7dfd 6bf4 3aa5 - 0000040 d693 db24 d917 5ee7 feb7 34c3 34e9 e7a5 - 0000060 36b7 ea85 fc17 0e66 555c 0934 7a0c 4c69 - 0000100 523b 9f21 1546 fddb d58b e5ed 142a 6712 - 0000120 8d76 8f80 a6d2 30d8 d107 32bc 7f45 f997 - 0000140 9d5d 0d0c f1f0 64f9 a77f 408f b0c1 f5a0 - 0000160 39c6 f0ae 4b59 1a76 84a7 a364 8964 f557 - root@am62lxx-evm:~# - -Test the random number generator on the target. - -.. code-block:: console - - root@am62lxx-evm:~# cat /dev/hwrng | rngtest -c 1000 - rngtest 6.16 - Copyright (c) 2004 by Henrique de Moraes Holschuh - This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - - rngtest: starting FIPS tests... - rngtest: bits received from input: 20000032 - rngtest: FIPS 140-2 successes: 999 - rngtest: FIPS 140-2 failures: 1 - rngtest: FIPS 140-2(2001-10-10) Monobit: 0 - rngtest: FIPS 140-2(2001-10-10) Poker: 0 - rngtest: FIPS 140-2(2001-10-10) Runs: 0 - rngtest: FIPS 140-2(2001-10-10) Long run: 1 - rngtest: FIPS 140-2(2001-10-10) Continuous run: 0 - rngtest: input channel speed: (min=72.965; avg=3848.070; max=9765625.000)Kibits/s - rngtest: FIPS tests speed: (min=10.794; avg=53.373; max=54.967)Mibits/s - rngtest: Program run time: 5710839 microseconds - root@am62lxx-evm:~# - -Note that the results might be slightly different on your system, since, -after all, we are dealing with a random number generator. Any appreciable -number of errors typically indicates a bad random number generator. - -If you're satisfied the random number generator is working correctly, -you can use :program:`rngd` (the random number generator daemon) to feed the -:file:`/dev/random` entropy pool. - -**************************** -Hardware Accelerator testing -**************************** - -Testing using the :program:`tcrypt` module -========================================== - -.. code-block:: console - - root@am62lxx-evm:~# modprobe tcrypt mode=500 sec=1 - [ 1012.121422] tcrypt: testing speed of async ecb(aes) (ecb-aes-dthev2) encryption - [ 1012.128872] tcrypt: test 0 (128 bit key, 16 byte blocks): 4931 operations in 1 seconds (78896 bytes) - [ 1013.138110] tcrypt: test 1 (128 bit key, 64 byte blocks): 4940 operations in 1 seconds (316160 bytes) - [ 1014.146146] tcrypt: test 2 (128 bit key, 128 byte blocks): 4940 operations in 1 seconds (632320 bytes) - [ 1015.154298] tcrypt: test 3 (128 bit key, 256 byte blocks): 4940 operations in 1 seconds (1264640 bytes) - [ 1016.162329] tcrypt: test 4 (128 bit key, 1024 byte blocks): 4980 operations in 1 seconds (5099520 bytes) - [ 1017.170491] tcrypt: test 5 (128 bit key, 1424 byte blocks): 4940 operations in 1 seconds (7034560 bytes) - [ 1018.178486] tcrypt: test 6 (128 bit key, 4096 byte blocks): 4960 operations in 1 seconds (20316160 bytes) - [ 1019.186570] tcrypt: test 7 (192 bit key, 16 byte blocks): 4960 operations in 1 seconds (79360 bytes) - [ 1020.194482] tcrypt: test 8 (192 bit key, 64 byte blocks): 4940 operations in 1 seconds (316160 bytes) - [ 1021.202151] tcrypt: test 9 (192 bit key, 128 byte blocks): 5000 operations in 1 seconds (640000 bytes) - [ 1022.210225] tcrypt: test 10 (192 bit key, 256 byte blocks): 4940 operations in 1 seconds (1264640 bytes) - [ 1023.218410] tcrypt: test 11 (192 bit key, 1024 byte blocks): 5000 operations in 1 seconds (5120000 bytes) - [ 1024.226494] tcrypt: test 12 (192 bit key, 1424 byte blocks): 5000 operations in 1 seconds (7120000 bytes) - [ 1025.234490] tcrypt: test 13 (192 bit key, 4096 byte blocks): 4980 operations in 1 seconds (20398080 bytes) - [ 1026.242625] tcrypt: test 14 (256 bit key, 16 byte blocks): 4940 operations in 1 seconds (79040 bytes) - [ 1027.250155] tcrypt: test 15 (256 bit key, 64 byte blocks): 4960 operations in 1 seconds (317440 bytes) - [ 1028.258293] tcrypt: test 16 (256 bit key, 128 byte blocks): 4940 operations in 1 seconds (632320 bytes) - [ 1029.266342] tcrypt: test 17 (256 bit key, 256 byte blocks): 4940 operations in 1 seconds (1264640 bytes) - [ 1030.274405] tcrypt: test 18 (256 bit key, 1024 byte blocks): 4960 operations in 1 seconds (5079040 bytes) - [ 1031.282506] tcrypt: test 19 (256 bit key, 1424 byte blocks): 4980 operations in 1 seconds (7091520 bytes) - [ 1032.294641] tcrypt: test 20 (256 bit key, 4096 byte blocks): 4980 operations in 1 seconds (20398080 bytes) - [ 1033.302656] tcrypt: testing speed of async ecb(aes) (ecb-aes-dthev2) decryption - [ 1033.310809] tcrypt: test 0 (128 bit key, 16 byte blocks): 4940 operations in 1 seconds (79040 bytes) - [ 1034.318058] tcrypt: test 1 (128 bit key, 64 byte blocks): 4960 operations in 1 seconds (317440 bytes) - [ 1035.326153] tcrypt: test 2 (128 bit key, 128 byte blocks): 4940 operations in 1 seconds (632320 bytes) - [ 1036.334354] tcrypt: test 3 (128 bit key, 256 byte blocks): 4940 operations in 1 seconds (1264640 bytes) - [ 1037.342372] tcrypt: test 4 (128 bit key, 1024 byte blocks): 4920 operations in 1 seconds (5038080 bytes) - [ 1038.350475] tcrypt: test 5 (128 bit key, 1424 byte blocks): 4940 operations in 1 seconds (7034560 bytes) - [ 1039.358415] tcrypt: test 6 (128 bit key, 4096 byte blocks): 4940 operations in 1 seconds (20234240 bytes) - [ 1040.366508] tcrypt: test 7 (192 bit key, 16 byte blocks): 4940 operations in 1 seconds (79040 bytes) - [ 1041.374071] tcrypt: test 8 (192 bit key, 64 byte blocks): 4960 operations in 1 seconds (317440 bytes) - [ 1042.382158] tcrypt: test 9 (192 bit key, 128 byte blocks): 4960 operations in 1 seconds (634880 bytes) - [ 1043.390282] tcrypt: test 10 (192 bit key, 256 byte blocks): 4940 operations in 1 seconds (1264640 bytes) - [ 1044.398466] tcrypt: test 11 (192 bit key, 1024 byte blocks): 4940 operations in 1 seconds (5058560 bytes) - [ 1045.406558] tcrypt: test 12 (192 bit key, 1424 byte blocks): 4940 operations in 1 seconds (7034560 bytes) - [ 1046.414503] tcrypt: test 13 (192 bit key, 4096 byte blocks): 4940 operations in 1 seconds (20234240 bytes) - [ 1047.422793] tcrypt: test 14 (256 bit key, 16 byte blocks): 4960 operations in 1 seconds (79360 bytes) - [ 1048.430409] tcrypt: test 15 (256 bit key, 64 byte blocks): 4960 operations in 1 seconds (317440 bytes) - [ 1049.438295] tcrypt: test 16 (256 bit key, 128 byte blocks): 4940 operations in 1 seconds (632320 bytes) - [ 1050.446313] tcrypt: test 17 (256 bit key, 256 byte blocks): 4940 operations in 1 seconds (1264640 bytes) - [ 1051.454411] tcrypt: test 18 (256 bit key, 1024 byte blocks): 4960 operations in 1 seconds (5079040 bytes) - [ 1052.462508] tcrypt: test 19 (256 bit key, 1424 byte blocks): 4960 operations in 1 seconds (7063040 bytes) - [ 1053.470497] tcrypt: test 20 (256 bit key, 4096 byte blocks): 4960 operations in 1 seconds (20316160 bytes) - ... diff --git a/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/SA2UL_OMAP.rst b/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/SA2UL_OMAP.rst deleted file mode 100644 index 4768539d3..000000000 --- a/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/SA2UL_OMAP.rst +++ /dev/null @@ -1,498 +0,0 @@ -.. _SAUL-Crypto-Accelerator: -.. _crypto-accelerator: - -###### -Crypto -###### - -************ -Introduction -************ - -The Crypto API Driver is a set of Linux drivers that provide access to the -hardware cryptographic accelerators. These drivers are available built-in -in the kernel in the current SDK release. - -The following is a list of supported hardware accelerated algorithms: - -.. list-table:: SA2UL/SA3UL Hardware Cryptography Support - :header-rows: 1 - - * - Device Family - - Encryption - - Encryption with Authentication - - Hash Algorithms - - MAC Algorithms - - * - AM335X - - AES, DES - - - - MD5, SHA1, SHA224, SHA256 - - - - * - AM437X - - AES, DES, 3DES - - - - MD5, SHA1, SHA224, SHA256, SHA384, SHA512 - - - - * - AM57x / DRA7 - - AES, DES, 3DES - - - - - - - - * - AM65x / J721e / J7200 - - AES (CBC, ECB), 3DES (CBC, ECB) - - AES-GCM, AUTHENC(HMAC-SHA1, CBC-AES), AUTHENC(HMAC-SHA256, CBC-AES) - - SHA1, SHA256, SHA512 - - HMAC(SHA1, SHA256, SHA512), CMAC(AES) - - * - J721S2 / J784S4 / J742S2 - - AES (CBC, ECB), 3DES (CBC, ECB) - - AES-GCM, AUTHENC(HMAC-SHA1, CBC-AES), AUTHENC(HMAC-SHA256, CBC-AES) - - SHA1, SHA256, SHA512 - - HMAC(SHA1, SHA256, SHA512), CMAC(AES) - - * - AM68 / AM69 - - AES (CBC, ECB), 3DES (CBC, ECB) - - AES-GCM, AUTHENC(HMAC-SHA1, CBC-AES), AUTHENC(HMAC-SHA256, CBC-AES) - - SHA1, SHA256, SHA512 - - HMAC(SHA1, SHA256, SHA512), CMAC(AES) - - * - AM64X / J722S - - AES (CBC, ECB) - - AES-GCM, AUTHENC(HMAC-SHA256, CBC-AES) - - SHA256, SHA512 - - CMAC(AES) - - * - AM62X / AM62A / AM62D / AM62P - - AES (CBC, ECB) - - AES-GCM, AUTHENC(HMAC-SHA256, CBC-AES) - - SHA256, SHA512 - - CMAC(AES) - -***************************** -Crypto Implementation Options -***************************** - -Users can implement cryptographic operations by using one of the following approaches: - -1. **Hardware Accelerator** - - - Offloads crypto operations to dedicated hardware engine - - Frees up CPU cycles for other tasks - - In general lower throughput but optimized for multi-tasking systems - -2. **ARM CPU with Cryptographic Extension (ARM CE)** - - - Uses ARM core's built-in cryptographic hardware level instruction extensions - - Delivers higher throughput (faster than hardware accelerator) - - Might require high CPU usage - -Choosing the Right Implementation -================================= - -**Use Hardware Accelerator when:** - -- **Multi-tasking systems** - system runs computation heavy services that need CPU resources alongside crypto operations -- **Functional safety/security requirements** - ASIL or safety-critical applications require offloading crypto operations away from Linux kernel to reduce attack surface and ensure isolation -- **Compliance/regulatory requirements** - FIPS certification, Common Criteria, or TEE integration mandates hardware acceleration - -**Use ARM CPU (CE) when:** - -- **Maximum throughput required** - Need high throughput for bulk data encryption, video transcoding, or media processing -- **Dedicated crypto workload** - Crypto is the primary task and high CPU usage is acceptable -- **Small/infrequent operations** - One-time encryption with small data blocks where accelerator overhead is minimal - -**Performance Comparison** : For a detailed comparison of hardware accelerator performance against ARM Cryptographic Extension (CE) and baseline ARM CPU, see :ref:`crypto-performance` in the Linux Performance Guide. - -******************** -Building the Drivers -******************** - -For devices with available cryptographic hardware accelerators, a Linux -driver and additionally a Cryptodev kernel module (for OpenSSL) is used -to access them. Other devices use the pure software implementation of these -cryptographic operations. - -.. ifconfig:: CONFIG_crypto in ('sa2ul') - - |__PART_FAMILY_DEVICE_NAMES__| SoCs support a hardware accelerator called - Security Accelerator 2/3 Ultra Light (SA2UL/SA3UL) for crypto operations. - -The kernel configuration has already been set up in the SDK and no further -configuration is needed for the drivers to be built-in to the kernel. - -For reference, the configuration details are shown below. The -configuration of the cryptographic drivers is done under the -Hardware crypto devices sub-menu of the Cryptographic API menu in the -kernel configuration. - -.. ifconfig:: CONFIG_crypto in ('sa2ul') - - .. code-block:: text - - Symbol: CRYPTO_DEV_SA2UL [=m] - | Type : tristate - | Prompt: Support for TI security accelerator - | Location: - | -> Cryptographic API (CRYPTO [=y]) - | (1) -> Hardware crypto devices (CRYPTO_HW [=y]) - - To check if sa2ul module is properly installed, - run the below command from the Linux command prompt: - - .. code-block:: console - - lsmod | grep sa2ul - - Output should show something similar to below: - - .. code-block:: text - - sa2ul 262144 0 - -.. ifconfig:: CONFIG_crypto in ('omap') - - .. code-block:: text - - --- Cryptographic API - [*] Hardware crypto devices ---> - --- Hardware crypto devices - <*> Support for OMAP MD5/SHA1/SHA2 hw accelerator - <*> Support for OMAP AES hw engine - <*> Support for OMAP DES3DES hw engine - - Messages printed during bootup will indicate that initialization of the - crypto modules has taken place. - - .. code-block:: console - - [ 2.120565] omap-sham 53100000.sham: hw accel on OMAP rev 4.3 - [ 2.160584] mmc1: BKOPS_EN bit is not set - [ 2.173466] omap-aes 53500000.aes: OMAP AES hw accel rev: 3.2 - [ 2.180241] edma-dma-engine edma-dma-engine.0: allocated channel for 0:5 - [ 2.187808] edma-dma-engine edma-dma-engine.0: allocated channel for 0:6 - - For reference, the RNG configuration details are shown below. - - In the configuration menu, scroll down to Device Drivers and hit enter. - Now scroll to Character devices and hit enter. - - .. code-block:: text - - Device Drivers ---> - Character devices ---> - < > Hardware Random Number Generator Core support - < > OMAP Random Number Generator support - - Messages printed during bootup will indicate that initialization of the - RNG module has taken place. - - .. code-block:: console - - [ 1.660514] omap_rng 48310000.rng: OMAP Random Number Generator ver. 20 - -.. rubric:: Build the Cryptodev kernel module using SDK - :name: build-the-cryptodev-kernel-module-using-sdk - -For using OpenSSL to access the Crypto Hardware Accelerator Drivers -above, the Cryptodev is required (can be built as module). The framework -is not officially in the kernel and was ported to Linux under the name -"cryptodev". It is built as part of the SDK and no further configuration is needed. - -****************************************************** -Using Cryptographic Hardware Accelerators from OpenSSL -****************************************************** - -In order to use these drivers from OpenSSL, a -special driver is available which abstracts the access to these -accelerators through Cryprodev module. - -Cryptodev is itself a special device driver which provides a general -interface for higher level applications such as OpenSSL to access -hardware accelerators. - -The filesystem which comes with the SDK comes built with the Cryptodev -kernel modules and the TI driver which directly accesses the hardware -accelerators is built into the kernel. - -The following shows the command used to query the system for the state of -the cryptodev module. - - .. code-block:: console - - root@evm:~# lsmod | grep cryptodev - cryptodev 11962 0 - -The following example demonstrates the OpenSSL built-in speed -test to demonstrate performance. The addition of the parameter **-engine -devcrypto** tells OpenSSL to use the Cryptodev driver if it exists. - -.. code-block:: console - - root@evm:~# openssl speed -evp aes-128-cbc -engine devcrypto - engine "devcrypto" set. - Doing aes-128-cbc for 3s on 16 size blocks: 108107 aes-128-cbc's in 0.16s - Doing aes-128-cbc for 3s on 64 size blocks: 103730 aes-128-cbc's in 0.20s - Doing aes-128-cbc for 3s on 256 size blocks: 15181 aes-128-cbc's in 0.03s - Doing aes-128-cbc for 3s on 1024 size blocks: 15879 aes-128-cbc's in 0.03s - Doing aes-128-cbc for 3s on 8192 size blocks: 4879 aes-128-cbc's in 0.02s - OpenSSL 1.0.0b 16 Nov 2010 - built on: Thu Jan 20 10:23:44 CST 2011 - options:bn(64,32) rc4(ptr,int) des(idx,risc1,2,long) aes(partial) idea(int) blowfish(idx) - compiler: arm-none-linux-gnueabi-gcc -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -mthumb-interwork -mno-thumb -fPS - The 'numbers' are in 1000s of bytes per second processed. - type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes - aes-128-cbc 10810.70k 33193.60k 129544.53k 542003.20k 1998438.40k - root@evm:~# - -Using the Linux time -v function gives more information about CPU usage -during the test. - -.. code-block:: console - - root@evm:~# time -v openssl speed -evp aes-128-cbc -engine devcrypto - engine "devcrypto" set. - Doing aes-128-cbc for 3s on 16 size blocks: 108799 aes-128-cbc's in 0.17s - Doing aes-128-cbc for 3s on 64 size blocks: 102699 aes-128-cbc's in 0.18s - Doing aes-128-cbc for 3s on 256 size blocks: 16166 aes-128-cbc's in 0.03s - Doing aes-128-cbc for 3s on 1024 size blocks: 15080 aes-128-cbc's in 0.03s - Doing aes-128-cbc for 3s on 8192 size blocks: 4838 aes-128-cbc's in 0.03s - OpenSSL 1.0.0b 16 Nov 2010 - built on: Thu Jan 20 10:23:44 CST 2011 - options:bn(64,32) rc4(ptr,int) des(idx,risc1,2,long) aes(partial) idea(int) blowfish(idx) - compiler: arm-none-linux-gnueabi-gcc -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -mthumb-interwork -mno-thumb -fPS - The 'numbers' are in 1000s of bytes per second processed. - type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes - aes-128-cbc 10239.91k 36515.20k 137949.87k 514730.67k 1321096.53k - Command being timed: "openssl speed -evp aes-128-cbc -engine devcrypto" - User time (seconds): 0.46 - System time (seconds): 5.89 - Percent of CPU this job got: 42% - Elapsed (wall clock) time (h:mm:ss or m:ss): 0m 15.06s - Average shared text size (kbytes): 0 - Average unshared data size (kbytes): 0 - Average stack size (kbytes): 0 - Average total size (kbytes): 0 - Maximum resident set size (kbytes): 7104 - Average resident set size (kbytes): 0 - Major (requiring I/O) page faults: 0 - Minor (reclaiming a frame) page faults: 479 - Voluntary context switches: 36143 - Involuntary context switches: 211570 - Swaps: 0 - File system inputs: 0 - File system outputs: 0 - Socket messages sent: 0 - Socket messages received: 0 - Signals delivered: 0 - Page size (bytes): 4096 - Exit status: 0 - -When the cryptodev driver is removed, OpenSSL reverts to the software -implementation of the crypto algorithm. The performance using the -software only implementation can be compared to the previous test. - -.. code-block:: console - - root@evm:~# modprobe -r cryptodev - root@evm:~# time -v openssl speed -evp aes-128-cbc - Doing aes-128-cbc for 3s on 16 size blocks: 697674 aes-128-cbc's in 2.99s - Doing aes-128-cbc for 3s on 64 size blocks: 187556 aes-128-cbc's in 3.00s - Doing aes-128-cbc for 3s on 256 size blocks: 47922 aes-128-cbc's in 3.00s - Doing aes-128-cbc for 3s on 1024 size blocks: 12049 aes-128-cbc's in 3.00s - Doing aes-128-cbc for 3s on 8192 size blocks: 1509 aes-128-cbc's in 3.00s - OpenSSL 1.0.0b 16 Nov 2010 - built on: Thu Jan 20 10:23:44 CST 2011 - options:bn(64,32) rc4(ptr,int) des(idx,risc1,2,long) aes(partial) idea(int) blowfish(idx) - compiler: arm-none-linux-gnueabi-gcc -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -mthumb-interwork -mno-thumb -fPS - The 'numbers' are in 1000s of bytes per second processed. - type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes - aes-128-cbc 3733.37k 4001.19k 4089.34k 4112.73k 4120.58k - Command being timed: "openssl speed -evp aes-128-cbc" - User time (seconds): 15.03 - System time (seconds): 0.00 - Percent of CPU this job got: 99% - Elapsed (wall clock) time (h:mm:ss or m:ss): 0m 15.07s - Average shared text size (kbytes): 0 - Average unshared data size (kbytes): 0 - Average stack size (kbytes): 0 - Average total size (kbytes): 0 - Maximum resident set size (kbytes): 7216 - Average resident set size (kbytes): 0 - Major (requiring I/O) page faults: 1 - Minor (reclaiming a frame) page faults: 484 - Voluntary context switches: 13 - Involuntary context switches: 35 - Swaps: 0 - File system inputs: 0 - File system outputs: 0 - Socket messages sent: 0 - Socket messages received: 0 - Signals delivered: 0 - Page size (bytes): 4096 - Exit status: 0 - -*********************************** -Using the TRNG Hardware Accelerator -*********************************** - -In the default SDK, OP-TEE controls the TRNG engine and firewalls its -hardware registers, blocking outside access. To use TRNG from Linux instead, -disable the OP-TEE driver and enable the RNG node in the Linux device tree. - -Using TRNG from OP-TEE requires no further configuration. Verify the optee-rng -driver loads: - -.. ifconfig:: CONFIG_crypto in ('sa2ul') - - Check that the optee-rng driver is loaded: - - .. code-block:: console - - root@evm:~# cat /sys/class/misc/hw_random/rng_current - optee-rng - -The hwrng device should now show up in the filesystem. - -.. code-block:: console - - root@evm:~# ls -l /dev/hwrng - crw------- 1 root root 10, 183 Jan 1 2000 /dev/hwrng - -Use cat on this device to generate random numbers. - -.. code-block:: console - - root@evm:~# cat /dev/hwrng | od -x - 0000000 b2bd ae08 4477 be48 4836 bf64 5d92 01c9 - 0000020 0cb6 7ac5 16f9 8616 a483 7dfd 6bf4 3aa5 - 0000040 d693 db24 d917 5ee7 feb7 34c3 34e9 e7a5 - 0000060 36b7 ea85 fc17 0e66 555c 0934 7a0c 4c69 - 0000100 523b 9f21 1546 fddb d58b e5ed 142a 6712 - 0000120 8d76 8f80 a6d2 30d8 d107 32bc 7f45 f997 - 0000140 9d5d 0d0c f1f0 64f9 a77f 408f b0c1 f5a0 - 0000160 39c6 f0ae 4b59 1a76 84a7 a364 8964 f557 - root@evm:~# - -Test the random number generator on the target. - -.. code-block:: console - - root@evm:~# cat /dev/hwrng | rngtest -c 1000 - rngtest 3 - Copyright (c) 2004 by Henrique de Moraes Holschuh - This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - - rngtest: starting FIPS tests... - rngtest: bits received from input: 20000032 - rngtest: FIPS 140-2 successes: 999 - rngtest: FIPS 140-2 failures: 1 - rngtest: FIPS 140-2(2001-10-10) Monobit: 0 - rngtest: FIPS 140-2(2001-10-10) Poker: 0 - rngtest: FIPS 140-2(2001-10-10) Runs: 1 - rngtest: FIPS 140-2(2001-10-10) Long run: 0 - rngtest: FIPS 140-2(2001-10-10) Continuous run: 0 - rngtest: input channel speed: (min=788.218; avg=4070.983; max=2790178.571)Kibits/s - rngtest: FIPS tests speed: (min=846.755; avg=15388.376; max=21920.595)Kibits/s - rngtest: Program run time: 6072670 microseconds - -Note that the results may be slightly different on your system, since, -after all, we're dealing with a random number generator. Any appreciable -number of errors typically indicates a bad random number generator. - -If you're satisfied the random number generator is working correctly, -you can use **rngd** (the random number generator daemon) to feed the -/dev/random entropy pool. - -**************************** -Hardware Accelerator testing -**************************** - -Testing using the tcrypt module -=============================== - -.. code-block:: console - - # modprobe tcrypt mode=500 sec=1 - [ 3006.234145] tcrypt: - [ 3006.234145] testing speed of async ecb(aes) (ecb-aes-sa2ul) encryption - [ 3006.242891] tcrypt: test 0 (128 bit key, 16 byte blocks): 87335 operations in 1 seconds (1397360 bytes) - [ 3007.251651] tcrypt: test 1 (128 bit key, 64 byte blocks): 87669 operations in 1 seconds (5610816 bytes) - [ 3008.259651] tcrypt: test 2 (128 bit key, 256 byte blocks): 87481 operations in 1 seconds (22395136 bytes) - [ 3009.267828] tcrypt: test 3 (128 bit key, 1024 byte blocks): 58076 operations in 1 seconds (59469824 bytes) - [ 3010.275914] tcrypt: test 4 (128 bit key, 8192 byte blocks): 22556 operations in 1 seconds (184778752 bytes) - [ 3011.284006] tcrypt: test 5 (192 bit key, 16 byte blocks): 80305 operations in 1 seconds (1284880 bytes) - [ 3012.291648] tcrypt: test 6 (192 bit key, 64 byte blocks): 84537 operations in 1 seconds (5410368 bytes) - [ 3013.299648] tcrypt: test 7 (192 bit key, 256 byte blocks): 90540 operations in 1 seconds (23178240 bytes) - [ 3014.307834] tcrypt: test 8 (192 bit key, 1024 byte blocks): 56054 operations in 1 seconds (57399296 bytes) - [ 3015.315915] tcrypt: test 9 (192 bit key, 8192 byte blocks): 20701 operations in 1 seconds (169582592 bytes) - [ 3016.324006] tcrypt: test 10 (256 bit key, 16 byte blocks): 81816 operations in 1 seconds (1309056 bytes) - [ 3017.331736] tcrypt: test 11 (256 bit key, 64 byte blocks): 82418 operations in 1 seconds (5274752 bytes) - [ 3018.339739] tcrypt: test 12 (256 bit key, 256 byte blocks): 87217 operations in 1 seconds (22327552 bytes) - [ 3019.347917] tcrypt: test 13 (256 bit key, 1024 byte blocks): 56534 operations in 1 seconds (57890816 bytes) - [ 3020.356012] tcrypt: test 14 (256 bit key, 8192 byte blocks): 20428 operations in 1 seconds (167346176 bytes) - [ 3021.364131] tcrypt: - [ 3021.364131] testing speed of async ecb(aes) (ecb-aes-sa2ul) decryption - [ 3021.373505] tcrypt: test 0 (128 bit key, 16 byte blocks): 81655 operations in 1 seconds (1306480 bytes) - [ 3022.379660] tcrypt: test 1 (128 bit key, 64 byte blocks): 87373 operations in 1 seconds (5591872 bytes) - [ 3023.387659] tcrypt: test 2 (128 bit key, 256 byte blocks): 81323 operations in 1 seconds (20818688 bytes) - [ 3024.395825] tcrypt: test 3 (128 bit key, 1024 byte blocks): 58990 operations in 1 seconds (60405760 bytes) - [ 3025.403928] tcrypt: test 4 (128 bit key, 8192 byte blocks): 22613 operations in 1 seconds (185245696 bytes) - [ 3026.411996] tcrypt: test 5 (192 bit key, 16 byte blocks): 79558 operations in 1 seconds (1272928 bytes) - [ 3027.419648] tcrypt: test 6 (192 bit key, 64 byte blocks): 86877 operations in 1 seconds (5560128 bytes) - [ 3028.427648] tcrypt: test 7 (192 bit key, 256 byte blocks): 80615 operations in 1 seconds (20637440 bytes) - [ 3029.435831] tcrypt: test 8 (192 bit key, 1024 byte blocks): 62007 operations in 1 seconds (63495168 bytes) - [ 3030.443907] tcrypt: test 9 (192 bit key, 8192 byte blocks): 21569 operations in 1 seconds (176693248 bytes) - [ 3031.452015] tcrypt: test 10 (256 bit key, 16 byte blocks): 86171 operations in 1 seconds (1378736 bytes) - [ 3032.459743] tcrypt: test 11 (256 bit key, 64 byte blocks): 79752 operations in 1 seconds (5104128 bytes) - [ 3033.467770] tcrypt: test 12 (256 bit key, 256 byte blocks): 84351 operations in 1 seconds (21593856 bytes) - [ 3034.475919] tcrypt: test 13 (256 bit key, 1024 byte blocks): 57082 operations in 1 seconds (58451968 bytes) - [ 3035.483995] tcrypt: test 14 (256 bit key, 8192 byte blocks): 20489 operations in 1 seconds (167845888 bytes) - [ 3036.492101] tcrypt: - ... - -IPSec Testing -============= - -.. rubric:: Server side - -.. code-block:: console - - # iperf3 --server - - Accepted connection from 192.168.1.1, port 41266 - [ 5] local 192.168.1.1 port 5201 connected to 192.168.1.2 port 58177 - [ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams - [ 5] 0.00-1.00 sec 45.6 MBytes 382 Mbits/sec 0.021 ms 0/33017 (0%) - [ 5] 1.00-2.00 sec 47.7 MBytes 400 Mbits/sec 0.014 ms 0/34534 (0%) - [ 5] 2.00-3.00 sec 47.7 MBytes 400 Mbits/sec 0.013 ms 0/34527 (0%) - [ 5] 3.00-4.00 sec 47.7 MBytes 400 Mbits/sec 0.037 ms 0/34507 (0%) - [ 5] 4.00-5.00 sec 47.7 MBytes 400 Mbits/sec 0.021 ms 0/34540 (0%) - [ 5] 5.00-6.00 sec 47.7 MBytes 400 Mbits/sec 0.020 ms 0/34537 (0%) - [ 5] 6.00-7.00 sec 47.7 MBytes 400 Mbits/sec 0.013 ms 0/34511 (0%) - [ 5] 7.00-8.00 sec 47.7 MBytes 400 Mbits/sec 0.017 ms 0/34543 (0%) - [ 5] 8.00-9.00 sec 47.7 MBytes 400 Mbits/sec 0.012 ms 0/34518 (0%) - [ 5] 9.00-10.00 sec 47.7 MBytes 400 Mbits/sec 0.022 ms 0/34532 (0%) - [ 5] 10.00-10.04 sec 2.10 MBytes 403 Mbits/sec 0.014 ms 0/1518 (0%) - -.. rubric:: Client side - -.. code-block:: console - - # iperf3 -c 192.168.1.1 -u -b 400.0M -t 10 - Connecting to host 192.168.1.1, port 5201 - [ 5] local 192.168.1.2 port 58177 connected to 192.168.1.1 port 5201 - [ ID] Interval Transfer Bitrate Total Datagrams - [ 5] 0.00-1.00 sec 47.7 MBytes 400 Mbits/sec 34510 - [ 5] 1.00-2.00 sec 47.7 MBytes 400 Mbits/sec 34531 - [ 5] 2.00-3.00 sec ytes 400 Mbits/sec 34530 - [ 5] 3.00-4.00 sec 47.7 MBytes 400 Mbits/sec 34531 - [ 5] 4.00-5.00 sec 47.7 MBytes 400 Mbits/sec 34530 - [ 5] 5.00-6.00 sec 47.7 MBytes 400 Mbits/sec 34530 - [ 5] 6.00-7.00 sec 47.7 MBytes 400 Mbits/sec 34531 - [ 5] 7.00-8.00 sec 47.7 MBytes 400 Mbits/sec 34530 - [ 5] 8.00-9.00 sec 47.7 MBytes 400 Mbits/sec 34530 - [ 5] 9.00-10.00 sec 47.7 MBytes 400 Mbits/sec 34531 diff --git a/source/linux/Foundational_Components_Kernel_Drivers.rst b/source/linux/Foundational_Components_Kernel_Drivers.rst index aa64d72e5..3060b9125 100644 --- a/source/linux/Foundational_Components_Kernel_Drivers.rst +++ b/source/linux/Foundational_Components_Kernel_Drivers.rst @@ -16,8 +16,7 @@ Kernel Drivers Foundational_Components/Kernel/Kernel_Drivers/Camera/CSI2RX_J721S2 Foundational_Components/Kernel/Kernel_Drivers/Camera/CSI2RX_J784S4 Foundational_Components/Kernel/Kernel_Drivers/Camera/CSI2RX_J722S - Foundational_Components/Kernel/Kernel_Drivers/Crypto/DTHEv2 - Foundational_Components/Kernel/Kernel_Drivers/Crypto/SA2UL_OMAP + Foundational_Components/Kernel/Kernel_Drivers/Crypto/Crypto Foundational_Components/Kernel/Kernel_Drivers/MCAN Foundational_Components/Kernel/Kernel_Drivers/MCRC64 Foundational_Components/Kernel/Kernel_Drivers/DCAN From 2992d47bf024ac39ec866ccc549562aa77777995 Mon Sep 17 00:00:00 2001 From: T Pratham Date: Wed, 23 Sep 2026 16:38:30 +0530 Subject: [PATCH 2/2] fix(linux): Add missing CRYPTO_config and split omap from sa2ul AM57X config has been setting CRYPTO_config to empty string. Change it to omap. Next, split the supported hardware crypto table in crypto driver docs to separate SA2/3UL and OMAP devices into different tables. Signed-off-by: T Pratham --- configs/AM57X/AM57X_linux_config.txt | 2 +- .../Kernel/Kernel_Drivers/Crypto/Crypto.rst | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/configs/AM57X/AM57X_linux_config.txt b/configs/AM57X/AM57X_linux_config.txt index e19decf41..a15b2ffe2 100644 --- a/configs/AM57X/AM57X_linux_config.txt +++ b/configs/AM57X/AM57X_linux_config.txt @@ -38,4 +38,4 @@ Configuration Values 'CONFIG_icss_support' : 'yes' 'CONFIG_rt_linux_support' : 'yes' 'CONFIG_gpu_ip' : 'SGX' -'CONFIG_crypto' : '' +'CONFIG_crypto' : 'omap' diff --git a/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/Crypto.rst b/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/Crypto.rst index 541db1a6c..6d1f9b2d6 100644 --- a/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/Crypto.rst +++ b/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Crypto/Crypto.rst @@ -31,9 +31,9 @@ The following is a list of supported hardware accelerated algorithms: - MD5, SHA224, SHA256, SHA384, SHA512 - HMAC(MD5), HMAC(SHA224), HMAC(SHA256), HMAC(SHA384), HMAC(SHA512) -.. ifconfig:: CONFIG_crypto not in ('DTHEv2') +.. ifconfig:: CONFIG_crypto in ('omap') - .. list-table:: SA2UL/SA3UL Hardware Cryptography Support + .. list-table:: OMAP Hardware Cryptography Support :header-rows: 1 * - Device Family @@ -60,6 +60,17 @@ The following is a list of supported hardware accelerated algorithms: - - +.. ifconfig:: CONFIG_crypto in ('sa2ul') + + .. list-table:: SA2UL/SA3UL Hardware Cryptography Support + :header-rows: 1 + + * - Device Family + - Encryption + - Encryption with Authentication + - Hash Algorithms + - MAC Algorithms + * - AM65x / J721e / J7200 - AES (CBC, ECB), 3DES (CBC, ECB) - AES-GCM, AUTHENC(HMAC-SHA1, CBC-AES), AUTHENC(HMAC-SHA256, CBC-AES)