crypto: sm3 - Refactor code and harden security This patch series refactors the SM3 driver to improve code clarity, performance, and compatibility. Key changes include simplifying CPU feature verification using x86_match_cpu() and boot_cpu_has(), optimizing the sm3_generic_block_fn() assembly implementation for GCC compliance, and adjusting the cra_priority to ensure the GMI driver takes precedence over sm3-avx on specific kernel branches. Security is enhanced by replacing manual zeroing with memzero_explicit() for state cleanup. Additionally, support for legacy ZX-C processors is removed due to unreliable feature detection via FMS. crypto: sm4 - Refactor mode handling and optimize performance This patch series addresses critical issues in the SM4 driver's mode implementations and optimizes performance. Fixes include resolving last-block processing in CTR, OFB, and CFB modes by updating IVs or using ECB workarounds, correcting block size definitions for OFB/CFB (now 1 byte), and removing redundant IV size declarations in ECB mode. The assembly implementation of rep_xcrypt() is optimized for GCC compliance, and cra_priority is updated to prioritize the GMI driver over sm4-aesni-avx2 across multiple kernel branches. Legacy ZX-C processor support is dropped due to unreliable GMI feature detection.
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/6264