2018-01-12 02:49:13 +00:00
|
|
|
set(SRC libsodium/src/libsodium)
|
|
|
|
|
2018-03-22 06:27:10 +00:00
|
|
|
set(COMPONENT_REQUIRES "mbedtls")
|
|
|
|
|
2018-01-12 02:49:13 +00:00
|
|
|
set(COMPONENT_SRCDIRS
|
2018-02-27 04:45:30 +00:00
|
|
|
port
|
2018-01-12 02:49:13 +00:00
|
|
|
|
2018-02-27 04:45:30 +00:00
|
|
|
# Derived from libsodium/src/libsodium/Makefile.am
|
|
|
|
# (ignoring the !MINIMAL set)
|
|
|
|
${SRC}/crypto_aead/chacha20poly1305/sodium
|
|
|
|
${SRC}/crypto_aead/xchacha20poly1305/sodium
|
|
|
|
${SRC}/crypto_auth
|
|
|
|
${SRC}/crypto_auth/hmacsha256
|
|
|
|
${SRC}/crypto_auth/hmacsha512
|
|
|
|
${SRC}/crypto_auth/hmacsha512256
|
|
|
|
${SRC}/crypto_box
|
|
|
|
${SRC}/crypto_box/curve25519xsalsa20poly1305
|
|
|
|
${SRC}/crypto_core/curve25519/ref10
|
|
|
|
${SRC}/crypto_core/hchacha20
|
|
|
|
${SRC}/crypto_core/hsalsa20/ref2
|
|
|
|
${SRC}/crypto_core/hsalsa20
|
|
|
|
${SRC}/crypto_core/salsa/ref
|
|
|
|
${SRC}/crypto_generichash
|
|
|
|
${SRC}/crypto_generichash/blake2b
|
|
|
|
${SRC}/crypto_generichash/blake2b/ref
|
|
|
|
${SRC}/crypto_hash
|
|
|
|
${SRC}/crypto_hash/sha256
|
|
|
|
${SRC}/crypto_hash/sha512
|
|
|
|
${SRC}/crypto_kdf/blake2b
|
|
|
|
${SRC}/crypto_kdf
|
|
|
|
${SRC}/crypto_kx
|
|
|
|
${SRC}/crypto_onetimeauth
|
|
|
|
${SRC}/crypto_onetimeauth/poly1305
|
|
|
|
${SRC}/crypto_onetimeauth/poly1305/donna
|
|
|
|
${SRC}/crypto_pwhash/argon2
|
|
|
|
${SRC}/crypto_pwhash
|
|
|
|
${SRC}/crypto_pwhash/scryptsalsa208sha256
|
|
|
|
${SRC}/crypto_pwhash/scryptsalsa208sha256/nosse
|
|
|
|
${SRC}/crypto_scalarmult
|
|
|
|
${SRC}/crypto_scalarmult/curve25519
|
|
|
|
${SRC}/crypto_scalarmult/curve25519/ref10
|
|
|
|
${SRC}/crypto_secretbox
|
|
|
|
${SRC}/crypto_secretbox/xsalsa20poly1305
|
|
|
|
${SRC}/crypto_shorthash
|
|
|
|
${SRC}/crypto_shorthash/siphash24
|
|
|
|
${SRC}/crypto_shorthash/siphash24/ref
|
|
|
|
${SRC}/crypto_sign
|
|
|
|
${SRC}/crypto_sign/ed25519
|
|
|
|
${SRC}/crypto_sign/ed25519/ref10
|
|
|
|
${SRC}/crypto_stream/chacha20
|
|
|
|
${SRC}/crypto_stream/chacha20/ref
|
|
|
|
${SRC}/crypto_stream
|
|
|
|
${SRC}/crypto_stream/salsa20
|
|
|
|
${SRC}/crypto_stream/salsa20/ref
|
|
|
|
${SRC}/crypto_stream/xsalsa20
|
|
|
|
${SRC}/crypto_verify/sodium
|
|
|
|
${SRC}/randombytes
|
|
|
|
${SRC}/sodium
|
|
|
|
)
|
2018-01-12 02:49:13 +00:00
|
|
|
|
|
|
|
if(CONFIG_LIBSODIUM_USE_MBEDTLS_SHA)
|
2018-02-27 04:45:30 +00:00
|
|
|
set(COMPONENT_SRCDIRS ${COMPONENT_SRCDIRS}
|
|
|
|
port/crypto_hash_mbedtls
|
|
|
|
)
|
2018-01-12 02:49:13 +00:00
|
|
|
else()
|
2018-02-27 04:45:30 +00:00
|
|
|
set(COMPONENT_SRCDIRS ${COMPONENT_SRCDIRS}
|
|
|
|
${SRC}/crypto_hash/sha256/cp
|
|
|
|
${SRC}/crypto_hash/sha512/cp
|
|
|
|
)
|
2018-01-12 02:49:13 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
set(COMPONENT_ADD_INCLUDEDIRS ${SRC}/include port_include)
|
|
|
|
set(COMPONENT_PRIV_INCLUDEDIRS ${SRC}/include/sodium port_include/sodium port)
|
|
|
|
|
|
|
|
register_component()
|
|
|
|
|
2018-02-22 04:05:05 +00:00
|
|
|
component_compile_definitions(
|
2018-02-27 04:45:30 +00:00
|
|
|
CONFIGURED
|
|
|
|
NATIVE_LITTLE_ENDIAN
|
|
|
|
HAVE_WEAK_SYMBOLS
|
|
|
|
__STDC_LIMIT_MACROS
|
|
|
|
__STDC_CONSTANT_MACROS
|
|
|
|
)
|
2018-01-12 02:49:13 +00:00
|
|
|
|
2018-02-22 04:05:05 +00:00
|
|
|
component_compile_options(-Wno-unknown-pragmas)
|
2018-01-12 02:49:13 +00:00
|
|
|
|
|
|
|
# patch around warnings in third-party files
|
|
|
|
set_source_files_properties(
|
2018-02-27 04:45:30 +00:00
|
|
|
${SRC}/crypto_pwhash/argon2/argon2-fill-block-ref.c
|
|
|
|
${SRC}/crypto_pwhash/argon2/pwhash_argon2i.c
|
|
|
|
${SRC}/crypto_pwhash/argon2/argon2-core.c
|
|
|
|
${SRC}/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c
|
|
|
|
PROPERTIES COMPILE_FLAGS
|
|
|
|
-Wno-type-limits
|
|
|
|
)
|
2018-01-12 02:49:13 +00:00
|
|
|
set_source_files_properties(
|
2018-02-27 04:45:30 +00:00
|
|
|
${SRC}/sodium/utils.c
|
|
|
|
PROPERTIES COMPILE_FLAGS
|
|
|
|
-Wno-unused-variable
|
|
|
|
)
|