tinycrypto: add unix as compile flags to use dev/random

Add UNIX platform flag to tinycrypto build configuration to enable access to /dev/random for secure random number generation.

Signed-off-by: makejian <makejian@xiaomi.com>
This commit is contained in:
makejian 2025-01-21 22:31:27 +08:00 committed by Donny(董九柱)
parent ed7bb51b14
commit 056ba984e8
2 changed files with 4 additions and 3 deletions

View file

@ -64,6 +64,7 @@ if(CONFIG_TINYCRYPT)
# Sources
# ############################################################################
list(APPEND CFLAGS -Dunix)
set(CSRCS
${TINYCRYPT_DIR}/lib/source/utils.c ${TINYCRYPT_DIR}/lib/source/ecc.c
${TINYCRYPT_DIR}/lib/source/ecc_platform_specific.c)
@ -120,7 +121,7 @@ if(CONFIG_TINYCRYPT)
if(CONFIG_TINYCRYPT_TEST)
list(APPEND CSRCS ${TINYCRYPT_DIR}/tests/test_ecc_utils.c)
list(APPEND INCDIR ${TINYCRYPT_DIR}/tests/include)
set(CFLAGS -Dhex2bin=ltp_hex2bin -DENABLE_TESTS)
list(APPEND CFLAGS -DENABLE_TESTS)
nuttx_add_application(
NAME

View file

@ -48,6 +48,7 @@ distclean::
$(Q) rm -rf $(TINYCRYPT_UNPACKNAME)
endif
CFLAGS += ${DEFINE_PREFIX}unix
CSRCS += tinycrypt/lib/source/utils.c
ifeq ($(CONFIG_TINYCRYPT_ECC),y)
@ -105,8 +106,7 @@ endif
ifeq ($(CONFIG_TINYCRYPT_TEST),y)
CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/crypto/tinycrypt/tinycrypt/tests/include
CFLAGS +=-Dhex2bin=ltp_hex2bin
CFLAGS +=-DENABLE_TESTS
CFLAGS += -DENABLE_TESTS
CSRCS += tinycrypt/tests/test_ecc_utils.c
PRIORITY = $(CONFIG_TINYCRYPT_TEST_PRIORITY)
STACKSIZE = $(CONFIG_TINYCRYPT_TEST_STACKSIZE)