Skip to content

Commit 201cf52

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 201cf52

File tree

1 file changed

+30
-8
lines changed

1 file changed

+30
-8
lines changed

boot/zephyr/Kconfig

Lines changed: 30 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
@@ -269,6 +286,7 @@ config BOOT_SIGNATURE_TYPE_ECDSA_P256
269286
if BOOT_SIGNATURE_TYPE_ECDSA_P256
270287
choice BOOT_ECDSA_IMPLEMENTATION
271288
prompt "Ecdsa implementation"
289+
default BOOT_ECDSA_PSA
272290
default BOOT_ECDSA_TINYCRYPT
273291

274292
config BOOT_ECDSA_TINYCRYPT
@@ -282,6 +300,18 @@ config BOOT_ECDSA_CC310
282300
select NRF_CC310_BL
283301
select NRFXLIB_CRYPTO
284302
select BOOT_USE_CC310
303+
304+
config BOOT_ECDSA_PSA
305+
bool "Use psa cryptoo"
306+
select BOOT_USE_PSA_CRYPTO
307+
select PSA_CRYPTO_CLIENT
308+
select PSA_CRYPTO_C
309+
select BOOT_KEY_IMPORT_BYPASS_ASN
310+
select BOOT_IMG_HASH_ALG_SHA256_ALLOW
311+
select BOOT_IMG_HASH_ALG_SHA512_ALLOW
312+
select PSA_WANT_ALG_ECDSA
313+
select BOOT_ECDSA_PSA_DEPENDENCIES
314+
285315
endchoice # Ecdsa implementation
286316
endif
287317

@@ -345,14 +375,6 @@ config BOOT_ED25519_PSA
345375

346376
endchoice
347377

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.
356378
endif
357379

358380
endchoice

0 commit comments

Comments
 (0)