1 include_directories(../../include) 2 3 if (${ARCH} STREQUAL "x86_64") 4 set( 5 BN_ARCH_SOURCES 6 7 x86_64-mont.${ASM_EXT} 8 x86_64-mont5.${ASM_EXT} 9 rsaz-x86_64.${ASM_EXT} 10 rsaz-avx2.${ASM_EXT} 11 12 rsaz_exp.c 13 ) 14 endif() 15 16 if (${ARCH} STREQUAL "x86") 17 set( 18 BN_ARCH_SOURCES 19 20 bn-586.${ASM_EXT} 21 co-586.${ASM_EXT} 22 x86-mont.${ASM_EXT} 23 ) 24 endif() 25 26 if (${ARCH} STREQUAL "arm") 27 set( 28 BN_ARCH_SOURCES 29 30 armv4-mont.${ASM_EXT} 31 ) 32 endif() 33 34 if (${ARCH} STREQUAL "aarch64") 35 set( 36 BN_ARCH_SOURCES 37 38 armv8-mont.${ASM_EXT} 39 ) 40 endif() 41 42 add_library( 43 bn 44 45 OBJECT 46 47 add.c 48 asm/x86_64-gcc.c 49 bn.c 50 bn_asn1.c 51 cmp.c 52 convert.c 53 ctx.c 54 div.c 55 exponentiation.c 56 generic.c 57 gcd.c 58 kronecker.c 59 montgomery.c 60 mul.c 61 prime.c 62 random.c 63 shift.c 64 sqrt.c 65 66 ${BN_ARCH_SOURCES} 67 ) 68 69 perlasm(x86_64-mont.${ASM_EXT} asm/x86_64-mont.pl) 70 perlasm(x86_64-mont5.${ASM_EXT} asm/x86_64-mont5.pl) 71 perlasm(rsaz-x86_64.${ASM_EXT} asm/rsaz-x86_64.pl) 72 perlasm(rsaz-avx2.${ASM_EXT} asm/rsaz-avx2.pl) 73 perlasm(bn-586.${ASM_EXT} asm/bn-586.pl) 74 perlasm(co-586.${ASM_EXT} asm/co-586.pl) 75 perlasm(x86-mont.${ASM_EXT} asm/x86-mont.pl) 76 perlasm(armv4-mont.${ASM_EXT} asm/armv4-mont.pl) 77 perlasm(armv8-mont.${ASM_EXT} asm/armv8-mont.pl) 78 79 add_executable( 80 bn_test 81 82 bn_test.cc 83 84 $<TARGET_OBJECTS:test_support> 85 ) 86 87 target_link_libraries(bn_test crypto) 88 add_dependencies(all_tests bn_test) 89