For ESP32-H2 case, the hardware k mode is always enforced through efuse settings (done in startup code). For ESP32-P4 case, the software k mode is not supported in the peripheral itself and code was redundant.
MBEDTLS_PRIVATE
MBEDTLS_ALLOW_PRIVATE_ACCESS