Skip to content

Commit 1fc7b2c

Browse files
committed
zephyr: Enable building ECDSA PSA variant
Adds Kconfig option CONFIG_BOOT_ECDSA_PSA that allows to switch ECDSA to PSA backend. Signed-off-by: Artur Hadasz <[email protected]>
1 parent 461e060 commit 1fc7b2c

File tree

1 file changed

+28
-8
lines changed

1 file changed

+28
-8
lines changed

boot/zephyr/Kconfig

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,14 @@ config BOOT_X25519_PSA_DEPENDENCIES
113113

114114
endif # BOOT_ENCRYPT_IMAGE
115115

116+
config BOOT_ECDSA_PSA_DEPENDENCIES
117+
bool
118+
select PSA_WANT_ALG_ECDSA
119+
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT
120+
select PSA_WANT_ECC_SECP_R1_256
121+
help
122+
Dependencies for ECDSA signature
123+
116124
if MBEDTLS_ENABLE_HEAP
117125

118126
config MBEDTLS_HEAP_SIZE
@@ -222,6 +230,15 @@ config BOOT_IMG_HASH_ALG_SHA512
222230

223231
endchoice # BOOT_IMG_HASH_ALG
224232

233+
config BOOT_KEY_IMPORT_BYPASS_ASN
234+
bool "Directly access key value without ASN.1 parsing"
235+
help
236+
Originally, public keys compiled into MCUboot were
237+
stored in ASN.1 encoded format. Enabling this option
238+
bypasses the ASN.1 decoding and directly accesses the key
239+
in ASN.1 bitstream; this reduces MCUboot code by removing
240+
the ASN.1 processing.
241+
225242
config BOOT_SIGNATURE_TYPE_PURE_ALLOW
226243
bool
227244
help
@@ -282,6 +299,17 @@ config BOOT_ECDSA_CC310
282299
select NRF_CC310_BL
283300
select NRFXLIB_CRYPTO
284301
select BOOT_USE_CC310
302+
303+
config BOOT_ECDSA_PSA
304+
bool "Use psa cryptoo"
305+
select BOOT_USE_PSA_CRYPTO
306+
select PSA_CRYPTO_CLIENT
307+
select PSA_CRYPTO_C
308+
select BOOT_KEY_IMPORT_BYPASS_ASN
309+
select BOOT_IMG_HASH_ALG_SHA256_ALLOW
310+
select BOOT_IMG_HASH_ALG_SHA512_ALLOW
311+
select BOOT_ECDSA_PSA_DEPENDENCIES
312+
285313
endchoice # Ecdsa implementation
286314
endif
287315

@@ -345,14 +373,6 @@ config BOOT_ED25519_PSA
345373

346374
endchoice
347375

348-
config BOOT_KEY_IMPORT_BYPASS_ASN
349-
bool "Directly access key value without ASN.1 parsing"
350-
help
351-
Originally, public keys compiled into MCUboot were
352-
stored in ASN.1 encoded format. Enabling this option
353-
bypasses the ASN.1 decoding and directly accesses the key
354-
in ASN.1 bitstream; this reduces MCUboot code by removing
355-
the ASN.1 processing.
356376
endif
357377

358378
endchoice

0 commit comments

Comments
 (0)