Skip to content

Commit 66dcd8a

Browse files
committed
nrf_security: drivers: cracen: Remove sicrypto for ed25519
Add support for Ed25519 and Ed25519ph in cracenpsa directly using silexpk/sxsymcrypt. This bypasses sicrypto, which saves on flash usage Remove sicrypto implementation of Ed25519 from cracenpsa. Signed-off-by: Dag Erik Gjørvad <dag.erik.gjorvad@nordicsemi.no>
1 parent 8fde9ff commit 66dcd8a

File tree

6 files changed

+453
-129
lines changed

6 files changed

+453
-129
lines changed

subsys/nrf_security/src/drivers/cracen/cracenpsa/cracenpsa.cmake

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ endif()
4444
if(CONFIG_PSA_NEED_CRACEN_ASYMMETRIC_SIGNATURE_DRIVER)
4545
list(APPEND cracen_driver_sources
4646
${CMAKE_CURRENT_LIST_DIR}/src/sign.c
47+
${CMAKE_CURRENT_LIST_DIR}/src/ed25519.c
4748
)
4849
endif()
4950

@@ -61,6 +62,7 @@ endif()
6162

6263
if(CONFIG_PSA_NEED_CRACEN_KEY_MANAGEMENT_DRIVER OR CONFIG_PSA_NEED_CRACEN_KMU_DRIVER OR CONFIG_MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS)
6364
list(APPEND cracen_driver_sources
65+
${CMAKE_CURRENT_LIST_DIR}/src/ed25519.c
6466
${CMAKE_CURRENT_LIST_DIR}/src/key_management.c
6567
)
6668
endif()

subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa.h

+16
Original file line numberDiff line numberDiff line change
@@ -361,4 +361,20 @@ psa_status_t cracen_spake2p_get_shared_key(cracen_spake2p_operation_t *operation
361361

362362
psa_status_t cracen_spake2p_abort(cracen_spake2p_operation_t *operation);
363363

364+
int ed25519_sign(const uint8_t *privkey, char *signature,
365+
const uint8_t *message, size_t message_length);
366+
367+
int ed25519_verify(const uint8_t *pubkey, const char *message,
368+
size_t message_length, const char *signature);
369+
370+
371+
int ed25519ph_sign(const uint8_t *privkey, char *signature,
372+
const uint8_t *message, size_t message_length, int ismessage);
373+
374+
int ed25519ph_verify(const uint8_t *pubkey, const char *message,
375+
size_t message_length, const char *signature, int ismessage);
376+
377+
int ed25519_create_pubkey(const uint8_t *privkey,
378+
uint8_t *pubkey);
379+
364380
#endif /* CRACEN_PSA_H */

0 commit comments

Comments
 (0)