set ( NTRU_AVX_SRC
l i b n t r u p / s r c / a v x / r a n d o m s m a l l . c
l i b n t r u p / s r c / a v x / w e i g h t . c
l i b n t r u p / s r c / a v x / s w a p . c
l i b n t r u p / s r c / a v x / r q _ r o u n d 3 . c
l i b n t r u p / s r c / a v x / r q _ r e c i p 3 . c
l i b n t r u p / s r c / a v x / s m a l l . c
l i b n t r u p / s r c / a v x / r a n d o m w e i g h t w . c
l i b n t r u p / s r c / a v x / d e c . c
l i b n t r u p / s r c / a v x / r 3 _ r e c i p . c
l i b n t r u p / s r c / a v x / k e y p a i r . c
l i b n t r u p / s r c / a v x / r q _ r o u n d e d . c
l i b n t r u p / s r c / a v x / m u l t . c
l i b n t r u p / s r c / a v x / e n c . c
l i b n t r u p / s r c / a v x / i n t 3 2 _ s o r t . c
l i b n t r u p / s r c / a v x / r q . c
l i b n t r u p / s r c / a v x / r q _ m o d 3 . c
)
set ( NTRU_REF_SRC
l i b n t r u p / s r c / r e f / r a n d o m s m a l l . c
l i b n t r u p / s r c / r e f / s w a p . c
l i b n t r u p / s r c / r e f / r q _ r o u n d 3 . c
l i b n t r u p / s r c / r e f / r q _ r e c i p 3 . c
l i b n t r u p / s r c / r e f / s m a l l . c
l i b n t r u p / s r c / r e f / r q _ m u l t . c
l i b n t r u p / s r c / r e f / r a n d o m w e i g h t w . c
l i b n t r u p / s r c / r e f / r a n d o m 3 2 . c
l i b n t r u p / s r c / r e f / d e c . c
l i b n t r u p / s r c / r e f / r 3 _ m u l t . c
l i b n t r u p / s r c / r e f / r 3 _ r e c i p . c
l i b n t r u p / s r c / r e f / k e y p a i r . c
l i b n t r u p / s r c / r e f / r q _ r o u n d e d . c
l i b n t r u p / s r c / r e f / e n c . c
l i b n t r u p / s r c / r e f / i n t 3 2 _ s o r t . c
l i b n t r u p / s r c / r e f / r q . c
)
set ( NTRU_SRC
$ { N T R U _ A V X _ S R C }
$ { N T R U _ R E F _ S R C }
l i b n t r u p / s r c / n t r u . c p p
)
set ( CRYPTOGRAPHY_SRC ${ NTRU_SRC } )
add_library ( ${ CRYPTOGRAPHY_LIB } STATIC ${ CRYPTOGRAPHY_SRC } )
add_log_tag ( ${ CRYPTOGRAPHY_LIB } )
option ( DOWNLOAD_SODIUM "Allow libsodium to be downloaded and built locally if not found on the system" OFF )
find_package ( Sodium 1.0.17 )
if ( sodium_FOUND )
target_include_directories ( ${ CRYPTOGRAPHY_LIB } PUBLIC ${ sodium_INCLUDE_DIR } )
target_link_libraries ( ${ CRYPTOGRAPHY_LIB } ${ sodium_LIBRARY_RELEASE } )
elseif ( DOWNLOAD_SODIUM )
message ( STATUS "Sodium >= 1.0.17 not found, but DOWNLOAD_SODIUM specified, so downloading it" )
include ( DownloadLibSodium )
target_link_libraries ( ${ CRYPTOGRAPHY_LIB } sodium_vendor )
else ( )
message ( FATAL_ERROR "Could not find libsodium >= 1.0.17; either install it on your system or use -DDOWNLOAD_SODIUM=ON to download and build an internal copy" )
endif ( )
target_include_directories ( ${ CRYPTOGRAPHY_LIB } PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/libntrup/include" )