From 518e455dceef7c0c67ff8ec108f5d99458b48206 Mon Sep 17 00:00:00 2001 From: Lingao Meng Date: Wed, 23 Aug 2023 11:43:26 +0800 Subject: [PATCH] add macro for ecc application may use micro-ecc for some ecc operation, which may be faster than tinycrypt, due to assamble code, but both of them have same function defination, cause build error on there case. Signed-off-by: Lingao Meng --- crypto/tinycrypt/Kconfig | 6 ++++++ crypto/tinycrypt/Makefile | 3 +++ 2 files changed, 9 insertions(+) diff --git a/crypto/tinycrypt/Kconfig b/crypto/tinycrypt/Kconfig index 155a40214..bfec69d64 100644 --- a/crypto/tinycrypt/Kconfig +++ b/crypto/tinycrypt/Kconfig @@ -43,9 +43,14 @@ config TINYCRYPT_SHA256_HMAC_PRNG This option enables support for pseudo-random number generator. +config TINYCRYPT_ECC + bool + default n + config TINYCRYPT_ECC_DH bool "ECC_DH anonymous key agreement protocol" default n + select TINYCRYPT_ECC ---help--- This option enables support for the Elliptic curve Diffie-Hellman anonymous key agreement protocol. @@ -56,6 +61,7 @@ config TINYCRYPT_ECC_DH config TINYCRYPT_ECC_DSA bool "ECC_DSA digital signature algorithm" default n + select TINYCRYPT_ECC ---help--- This option enables support for the Elliptic Curve Digital Signature Algorithm (ECDSA). diff --git a/crypto/tinycrypt/Makefile b/crypto/tinycrypt/Makefile index c0a58f4f8..2faba8219 100644 --- a/crypto/tinycrypt/Makefile +++ b/crypto/tinycrypt/Makefile @@ -47,8 +47,11 @@ distclean:: endif CSRCS += tinycrypt/lib/source/utils.c + +ifeq ($(CONFIG_TINYCRYPT_ECC),y) CSRCS += tinycrypt/lib/source/ecc.c CSRCS += tinycrypt/lib/source/ecc_platform_specific.c +endif ifeq ($(CONFIG_TINYCRYPT_ECC_DH),y) CSRCS += tinycrypt/lib/source/ecc_dh.c