On 2026-07-20T04:13:44, James Hilliard <[email protected]> wrote:
> crypto: allwinner: add sun8i-ce ECDSA verifier
>
> The H6 and H616 Crypto Engines include an ECC engine which can verify
> ECDSA signatures. Add a UCLASS_ECDSA child for the sun8i-ce parent so FIT
> signature verification can use the hardware block from U-Boot proper and
> SPL.
>
> The CE takes explicit curve parameters for each operation. Provide tables
> for the curves accepted by U-Boot's FIT ECDSA parser: secp224r1,
> prime256v1, secp384r1 and secp521r1. Derive each curve's a = p - 3
> parameter from p instead of storing duplicate constants. Make each curve
> independently selectable for U-Boot proper and SPL. SRAM-constrained
> builds can keep only the curves they need. The task input layout follows
> the ECC verify buffer order used by Allwinner's CE implementation.
>
> The CE input buffer uses fixed-width curve fields. Reuse the parameter
> packing logic for the message digest as well, so wider digests are
> truncated to the leftmost curve-width bytes according to ECDSA rules.
> Map the private input and result through the parent's cacheline-safe DMA
> objects. Round result storage to complete cachelines while keeping the
> descriptor output curve-sized. Submit ECC work on the dedicated asymmetric
> completion channel. After retirement, unmap the result and input exactly
> once before inspecting the result.
>
> Signed-off-by: James Hilliard <[email protected]>
>
> drivers/crypto/allwinner/sun8i-ce/Kconfig          |  94 +++++
>  drivers/crypto/allwinner/sun8i-ce/Makefile         |   1 +
>  drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c  |   6 +
>  drivers/crypto/allwinner/sun8i-ce/sun8i-ce-ecdsa.c | 382 
> +++++++++++++++++++++
>  drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h       |   3 +
>  5 files changed, 486 insertions(+)

Reviewed-by: Simon Glass <[email protected]>

Reply via email to