Skip to content

Enable ECDSA FIT verification for stm32mp

Alexandru Gagniuc u-boot 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5dm: crypto: Define UCLASS API for ECDSA signature verificationinclude/crypto/ecdsa-uclass.h include/dm/uclass-id.h+40 -01 reply
1/5dm: crypto: Define UCLASS API for ECDSA signature verification+0 -01 reply
2/5lib: ecdsa: Add skeleton to implement ecdsa verification in u-bootinclude/image.h include/u-boot/rsa.h lib/Kconfig +4 more+45 -61 reply
2/5lib: ecdsa: Add skeleton to implement ecdsa verification in u-boot+0 -00 replies
3/5lib: ecdsa: Implement signature verification for crypto_algo APIlib/ecdsa/ecdsa-verify.c+116 -12 replies
3/5lib: ecdsa: Implement signature verification for crypto_algo API+0 -00 replies
4/5arm: stm32mp1: Implement ECDSA signature verificationarch/arm/mach-stm32mp/Kconfig arch/arm/mach-stm32mp/Makefile arch/arm/mach-stm32mp/ecdsa_romapi.c+116 -00 replies
5/5Kconfig: FIT_SIGNATURE should not select RSA_VERIFYcommon/Kconfig.boot+4 -41 reply

Reviews trailers per patch

3 of 8 patches have a Reviewed-by or Acked-by.

PatchSimon Glass
1/5
1/5
2/5
2/5
3/5R-b
3/5R-b
4/5
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/5] Enable ECDSA FIT verification for stm32mp

This series is Part II of the ECDSA saga. It applies on top of [1]:
* [PATCH v4 0/6] Add support for ECDSA image signing (with test)

I've designed the UCLASS_ECDSA such that it aligns with the ROM API of the stm32mp. Instead of splitting the verification into
(1) curve operations and (2) modular exponentiation, I've concatenated everything in a 'verify' step. It would be impossible to split the steps and use the stm32mp ROM for verification.

Should more granular control be required, this API could be extended at a later time. Until we have more hardware supporting ECDSA, this is purely speculative.

The ROM API of the stm32mp is passed in 'r0' when the FSBL is called. While we can save 'r0' in SPL, this series does not implement a mechanism to pass this to u-boot. Thus the ROM API, and ECDSA verification are only available for SPL. Although extending this to u-boot by adding the ROM address to the FDT blob, implementing and verifying this is beyond the scope of this series.

[1] https://lists.denx.de/pipermail/u-boot/2021-January/436935.html

Alexandru Gagniuc (5):
dm: crypto: Define UCLASS API for ECDSA signature verification
lib: ecdsa: Add skeleton to implement ecdsa verification in u-boot
lib: ecdsa: Implement signature verification for crypto_algo API
arm: stm32mp1: Implement ECDSA signature verification
Kconfig: FIT_SIGNATURE should not select RSA_VERIFY

 arch/arm/mach-stm32mp/Kconfig        |   9 ++
 arch/arm/mach-stm32mp/Makefile       |   1 +
 arch/arm/mach-stm32mp/ecdsa_romapi.c | 106 ++++++++++++++++++++++
 common/Kconfig.boot                  |   8 +-
 include/crypto/ecdsa-uclass.h        |  39 ++++++++
 include/dm/uclass-id.h               |   1 +
 include/image.h                      |  10 +--
 include/u-boot/rsa.h                 |   2 +-
 lib/Kconfig                          |   1 +
 lib/Makefile                         |   1 +
 lib/ecdsa/Kconfig                    |  23 +++++
 lib/ecdsa/Makefile                   |   1 +
 lib/ecdsa/ecdsa-verify.c             | 128 +++++++++++++++++++++++++++
 13 files changed, 320 insertions(+), 10 deletions(-)
 create mode 100644 arch/arm/mach-stm32mp/ecdsa_romapi.c
 create mode 100644 include/crypto/ecdsa-uclass.h
 create mode 100644 lib/ecdsa/Kconfig
 create mode 100644 lib/ecdsa/Makefile
 create mode 100644 lib/ecdsa/ecdsa-verify.c
Signature · 1 line
2.26.2