Skip to content

Commit

Permalink
nrf_security: drivers: cracen: Remove sicrypto for ed25519
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
degjorva committed Jan 17, 2025
1 parent 8fde9ff commit 66dcd8a
Show file tree
Hide file tree
Showing 6 changed files with 453 additions and 129 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ endif()
if(CONFIG_PSA_NEED_CRACEN_ASYMMETRIC_SIGNATURE_DRIVER)
list(APPEND cracen_driver_sources
${CMAKE_CURRENT_LIST_DIR}/src/sign.c
${CMAKE_CURRENT_LIST_DIR}/src/ed25519.c
)
endif()

Expand All @@ -61,6 +62,7 @@ endif()

if(CONFIG_PSA_NEED_CRACEN_KEY_MANAGEMENT_DRIVER OR CONFIG_PSA_NEED_CRACEN_KMU_DRIVER OR CONFIG_MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS)
list(APPEND cracen_driver_sources
${CMAKE_CURRENT_LIST_DIR}/src/ed25519.c
${CMAKE_CURRENT_LIST_DIR}/src/key_management.c
)
endif()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,4 +361,20 @@ psa_status_t cracen_spake2p_get_shared_key(cracen_spake2p_operation_t *operation

psa_status_t cracen_spake2p_abort(cracen_spake2p_operation_t *operation);

int ed25519_sign(const uint8_t *privkey, char *signature,
const uint8_t *message, size_t message_length);

int ed25519_verify(const uint8_t *pubkey, const char *message,
size_t message_length, const char *signature);


int ed25519ph_sign(const uint8_t *privkey, char *signature,
const uint8_t *message, size_t message_length, int ismessage);

int ed25519ph_verify(const uint8_t *pubkey, const char *message,
size_t message_length, const char *signature, int ismessage);

int ed25519_create_pubkey(const uint8_t *privkey,
uint8_t *pubkey);

#endif /* CRACEN_PSA_H */
Loading

0 comments on commit 66dcd8a

Please sign in to comment.