[crypto] allow selecting randomized ECDSA instead of deterministic (#7894)

There is no hard dependency in the Thread specification which requires
the use of deterministic signatures. On the contrary, looking at the
tinycrypt implementation, that one issues randomized ECDSA signatures
and seems to be quite happy with that.

This change does not change the default behaviour, which is to use
deterministic ECDSA when using the default MbedTLS backend. It does
however make it possible for platforms which have qualified hardware
entropy to select 'plain' ECDSA instead, which gives both a performance
and code size improvement on those platforms.
This commit is contained in:
Steven Cooreman
2022-08-08 10:27:12 -07:00
committed by GitHub
parent cbbed06931
commit 0b41ae0a30
6 changed files with 50 additions and 2 deletions
@@ -254,4 +254,15 @@
#define OPENTHREAD_CONFIG_SRP_CLIENT_BUFFERS_MAX_SERVICES 20
#endif
/**
* @def OPENTHREAD_CONFIG_DETERMINISTIC_ECDSA_ENABLE
*
* Define to 1 to generate ECDSA signatures determinsitically
* according to RFC 6979 instead of randomly.
*
*/
#ifndef OPENTHREAD_CONFIG_DETERMINISTIC_ECDSA_ENABLE
#define OPENTHREAD_CONFIG_DETERMINISTIC_ECDSA_ENABLE 1
#endif
#endif // OPENTHREAD_CORE_SIMULATION_CONFIG_H_