mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
pkg/qdsa: use pseudomodules to select implementation
This commit is contained in:
parent
6769101c34
commit
37b0e30a71
@ -9,12 +9,28 @@ config PACKAGE_QDSA
|
|||||||
bool "qDSA Digital Signatures package"
|
bool "qDSA Digital Signatures package"
|
||||||
depends on TEST_KCONFIG
|
depends on TEST_KCONFIG
|
||||||
depends on !HAS_ARCH_16BIT
|
depends on !HAS_ARCH_16BIT
|
||||||
select MODULE_QDSA_ASM if HAS_ARCH_AVR8 || CPU_CORE_CORTEX_M23
|
|
||||||
select MODULE_QDSA_ASM if CPU_CORE_CORTEX_M0 || CPU_CORE_CORTEX_M0PLUS
|
|
||||||
help
|
help
|
||||||
Small and Secure Digital Signatures with Curve-based
|
Small and Secure Digital Signatures with Curve-based
|
||||||
Diffie-Hellman Key Pairs.
|
Diffie-Hellman Key Pairs.
|
||||||
|
|
||||||
|
if PACKAGE_QDSA
|
||||||
|
|
||||||
config MODULE_QDSA_ASM
|
config MODULE_QDSA_ASM
|
||||||
bool
|
bool
|
||||||
|
default y if HAS_ARCH_AVR8 || CPU_CORE_CORTEX_M23
|
||||||
|
default y if CPU_CORE_CORTEX_M0 || CPU_CORE_CORTEX_M0PLUS
|
||||||
depends on TEST_KCONFIG
|
depends on TEST_KCONFIG
|
||||||
|
|
||||||
|
config MODULE_QDSA_IMPL_ARM
|
||||||
|
bool
|
||||||
|
default y if CPU_CORE_CORTEX_M23 || CPU_CORE_CORTEX_M0 || CPU_CORE_CORTEX_M0PLUS
|
||||||
|
|
||||||
|
config MODULE_QDSA_IMPL_AVR
|
||||||
|
bool
|
||||||
|
default y if HAS_ARCH_AVR8
|
||||||
|
|
||||||
|
config MODULE_QDSA_IMPL_CREF
|
||||||
|
bool
|
||||||
|
default y if !MODULE_QDSA_IMPL_ARM && !MODULE_QDSA_IMPL_AVR
|
||||||
|
|
||||||
|
endif # PACKAGE_QDSA
|
||||||
|
@ -6,4 +6,4 @@ PKG_LICENSE=PD
|
|||||||
include $(RIOTBASE)/pkg/pkg.mk
|
include $(RIOTBASE)/pkg/pkg.mk
|
||||||
|
|
||||||
all:
|
all:
|
||||||
$(QQ)"$(MAKE)" -C $(PKG_SOURCE_DIR)/$(QDSA_IMPL)
|
$(QQ)"$(MAKE)" -C $(PKG_SOURCE_DIR)/$(patsubst qdsa_impl_%,%,$(filter qdsa_impl_%,$(USEMODULE)))
|
||||||
|
@ -6,5 +6,15 @@ ifneq (,$(filter arch_avr8,$(FEATURES_USED)))
|
|||||||
USEMODULE += qdsa_asm
|
USEMODULE += qdsa_asm
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq (,$(filter qdsa_impl_%,$(USEMODULE)))
|
||||||
|
ifneq (,$(filter cortex-m23 cortex-m0%,$(CPU_CORE)))
|
||||||
|
USEMODULE += qdsa_impl_arm
|
||||||
|
else ifneq (,$(filter arch_avr8,$(FEATURES_USED)))
|
||||||
|
USEMODULE += qdsa_impl_avr
|
||||||
|
else
|
||||||
|
USEMODULE += qdsa_impl_cref
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
# qDsa is not 16 bit compatible
|
# qDsa is not 16 bit compatible
|
||||||
FEATURES_BLACKLIST += arch_16bit
|
FEATURES_BLACKLIST += arch_16bit
|
||||||
|
@ -1,16 +1,8 @@
|
|||||||
ifneq (,$(filter cortex-m23 cortex-m0%,$(CPU_CORE)))
|
PSEUDOMODULES += qdsa_impl_arm
|
||||||
QDSA_IMPL ?= arm
|
PSEUDOMODULES += qdsa_impl_avr
|
||||||
else
|
PSEUDOMODULES += qdsa_impl_cref
|
||||||
ifneq (,$(filter arch_avr8,$(FEATURES_USED)))
|
|
||||||
QDSA_IMPL ?= avr
|
|
||||||
else
|
|
||||||
QDSA_IMPL ?= cref
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
export QDSA_IMPL
|
INCLUDES += -I$(PKGDIRBASE)/qdsa/$(patsubst qdsa_impl_%,%,$(filter qdsa_impl_%,$(USEMODULE)))
|
||||||
|
|
||||||
INCLUDES += -I$(PKGDIRBASE)/qdsa/$(QDSA_IMPL)
|
|
||||||
|
|
||||||
ifeq (cortex-m0plus,$(CPU_CORE))
|
ifeq (cortex-m0plus,$(CPU_CORE))
|
||||||
# There are problems with the LLVM assembler and the Cortex-M0+ instruction
|
# There are problems with the LLVM assembler and the Cortex-M0+ instruction
|
||||||
|
Loading…
Reference in New Issue
Block a user