2014-06-20 20:00:00 +01:00
|
|
|
include_directories(. .. ../../include)
|
|
|
|
|
|
|
|
if (${ARCH} STREQUAL "x86_64")
|
2015-01-29 00:37:10 +00:00
|
|
|
set(
|
|
|
|
BN_ARCH_SOURCES
|
2014-06-20 20:00:00 +01:00
|
|
|
|
2015-01-29 00:37:10 +00:00
|
|
|
x86_64-mont.${ASM_EXT}
|
|
|
|
x86_64-mont5.${ASM_EXT}
|
|
|
|
rsaz-x86_64.${ASM_EXT}
|
|
|
|
rsaz-avx2.${ASM_EXT}
|
2014-06-20 20:00:00 +01:00
|
|
|
|
2015-01-29 00:37:10 +00:00
|
|
|
rsaz_exp.c
|
|
|
|
)
|
2014-06-20 20:00:00 +01:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if (${ARCH} STREQUAL "x86")
|
2015-01-29 00:37:10 +00:00
|
|
|
set(
|
|
|
|
BN_ARCH_SOURCES
|
2014-06-20 20:00:00 +01:00
|
|
|
|
2015-01-29 00:37:10 +00:00
|
|
|
bn-586.${ASM_EXT}
|
|
|
|
co-586.${ASM_EXT}
|
|
|
|
x86-mont.${ASM_EXT}
|
|
|
|
)
|
2014-06-20 20:00:00 +01:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if (${ARCH} STREQUAL "arm")
|
2015-01-29 00:37:10 +00:00
|
|
|
set(
|
|
|
|
BN_ARCH_SOURCES
|
2014-06-20 20:00:00 +01:00
|
|
|
|
2015-01-29 00:37:10 +00:00
|
|
|
armv4-mont.${ASM_EXT}
|
|
|
|
)
|
2014-06-20 20:00:00 +01:00
|
|
|
endif()
|
|
|
|
|
|
|
|
add_library(
|
2015-01-29 00:37:10 +00:00
|
|
|
bn
|
2014-06-20 20:00:00 +01:00
|
|
|
|
2015-01-29 00:37:10 +00:00
|
|
|
OBJECT
|
2014-06-20 20:00:00 +01:00
|
|
|
|
2015-01-29 00:37:10 +00:00
|
|
|
add.c
|
2015-05-15 23:35:28 +01:00
|
|
|
asm/x86_64-gcc.c
|
2015-01-29 00:37:10 +00:00
|
|
|
bn.c
|
2015-07-13 22:03:20 +01:00
|
|
|
bn_asn1.c
|
2015-01-29 00:37:10 +00:00
|
|
|
cmp.c
|
|
|
|
convert.c
|
|
|
|
ctx.c
|
|
|
|
div.c
|
|
|
|
exponentiation.c
|
|
|
|
generic.c
|
|
|
|
gcd.c
|
|
|
|
kronecker.c
|
|
|
|
montgomery.c
|
|
|
|
mul.c
|
|
|
|
prime.c
|
|
|
|
random.c
|
|
|
|
shift.c
|
|
|
|
sqrt.c
|
2014-06-20 20:00:00 +01:00
|
|
|
|
2015-01-29 00:37:10 +00:00
|
|
|
${BN_ARCH_SOURCES}
|
2014-06-20 20:00:00 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
perlasm(x86_64-mont.${ASM_EXT} asm/x86_64-mont.pl)
|
|
|
|
perlasm(x86_64-mont5.${ASM_EXT} asm/x86_64-mont5.pl)
|
|
|
|
perlasm(rsaz-x86_64.${ASM_EXT} asm/rsaz-x86_64.pl)
|
|
|
|
perlasm(rsaz-avx2.${ASM_EXT} asm/rsaz-avx2.pl)
|
|
|
|
perlasm(bn-586.${ASM_EXT} asm/bn-586.pl)
|
|
|
|
perlasm(co-586.${ASM_EXT} asm/co-586.pl)
|
|
|
|
perlasm(x86-mont.${ASM_EXT} asm/x86-mont.pl)
|
|
|
|
perlasm(armv4-mont.${ASM_EXT} asm/armv4-mont.pl)
|
|
|
|
|
|
|
|
add_executable(
|
2015-01-29 00:37:10 +00:00
|
|
|
bn_test
|
2014-06-20 20:00:00 +01:00
|
|
|
|
2015-03-26 03:49:37 +00:00
|
|
|
bn_test.cc
|
2015-05-16 00:08:49 +01:00
|
|
|
|
|
|
|
$<TARGET_OBJECTS:test_support>
|
2014-06-20 20:00:00 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(bn_test crypto)
|