Skip to content

Commit

Permalink
nrf_security: drivers: cracen Removing sicrypo for ed25519
Browse files Browse the repository at this point in the history
Update the removes the sicrypto drivers when using ed25519
with cracen. Adds the functionality to cracenpsa
Also does the same for ed25519ph, as their
dependencies were interwoven

Signed-off-by: Dag Erik Gjørvad <[email protected]>
  • Loading branch information
degjorva committed Jan 9, 2025
1 parent 16a31d6 commit be1e5f3
Show file tree
Hide file tree
Showing 7 changed files with 312 additions and 301 deletions.
7 changes: 0 additions & 7 deletions subsys/nrf_security/Kconfig.psa.nordic
Original file line number Diff line number Diff line change
Expand Up @@ -400,10 +400,3 @@ config PSA_WANT_KEY_TYPE_SRP_PUBLIC_KEY
bool "SRP public key support" if !MBEDTLS_PROMPTLESS
help
SRP public key support.

comment "Nordic added alternative cracen driver"

config PSA_WANT_NO_SI_CRYPTO
bool "Running supported crypto operations without sicrypto" if !MBEDTLS_PROMPTLESS
help
Using alternative high level driver for cracen when supported
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 All @@ -78,12 +80,6 @@ if(CONFIG_PSA_NEED_CRACEN_ECJPAKE_SECP_R1_256)
)
endif()

if(CONFIG_PSA_NEED_NO_SI_CRYPTO_ED25519)
list(APPEND cracen_driver_sources
${CMAKE_CURRENT_LIST_DIR}/src/ed25519.c
)
endif()

if(CONFIG_PSA_NEED_CRACEN_SRP_6)
list(APPEND cracen_driver_sources
${CMAKE_CURRENT_LIST_DIR}/src/srp.c
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,13 +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 *ed25519, char *signature,
const uint8_t *message);
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);
size_t message_length, const char *signature);

int create_ed25519_pubkey(const uint8_t *ed25519,
uint8_t *pubkey);

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 be1e5f3

Please sign in to comment.