Kenny Root | b849459 | 2015-09-25 02:29:14 +0000 | [diff] [blame] | 1 | include_directories(../../include) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2 | |
| 3 | if (${ARCH} STREQUAL "x86_64") |
| 4 | set( |
| 5 | BN_ARCH_SOURCES |
| 6 | |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 7 | x86_64-mont.${ASM_EXT} |
| 8 | x86_64-mont5.${ASM_EXT} |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 9 | rsaz-avx2.${ASM_EXT} |
| 10 | |
| 11 | rsaz_exp.c |
| 12 | ) |
| 13 | endif() |
| 14 | |
| 15 | if (${ARCH} STREQUAL "x86") |
| 16 | set( |
| 17 | BN_ARCH_SOURCES |
| 18 | |
| 19 | bn-586.${ASM_EXT} |
| 20 | co-586.${ASM_EXT} |
| 21 | x86-mont.${ASM_EXT} |
| 22 | ) |
| 23 | endif() |
| 24 | |
| 25 | if (${ARCH} STREQUAL "arm") |
| 26 | set( |
| 27 | BN_ARCH_SOURCES |
| 28 | |
| 29 | armv4-mont.${ASM_EXT} |
| 30 | ) |
| 31 | endif() |
| 32 | |
Adam Langley | fad6327 | 2015-11-12 12:15:39 -0800 | [diff] [blame] | 33 | if (${ARCH} STREQUAL "aarch64") |
| 34 | set( |
| 35 | BN_ARCH_SOURCES |
| 36 | |
| 37 | armv8-mont.${ASM_EXT} |
| 38 | ) |
| 39 | endif() |
| 40 | |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 41 | add_library( |
| 42 | bn |
| 43 | |
| 44 | OBJECT |
| 45 | |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 46 | add.c |
Adam Langley | f4e4272 | 2015-06-04 17:45:09 -0700 | [diff] [blame] | 47 | asm/x86_64-gcc.c |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 48 | bn.c |
Kenny Root | b849459 | 2015-09-25 02:29:14 +0000 | [diff] [blame] | 49 | bn_asn1.c |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 50 | cmp.c |
| 51 | convert.c |
| 52 | ctx.c |
| 53 | div.c |
| 54 | exponentiation.c |
| 55 | generic.c |
| 56 | gcd.c |
Robert Sloan | 2424d84 | 2017-05-01 07:46:28 -0700 | [diff] [blame] | 57 | jacobi.c |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 58 | montgomery.c |
David Benjamin | c895d6b | 2016-08-11 13:26:41 -0400 | [diff] [blame] | 59 | montgomery_inv.c |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 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) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 71 | perlasm(rsaz-avx2.${ASM_EXT} asm/rsaz-avx2.pl) |
| 72 | perlasm(bn-586.${ASM_EXT} asm/bn-586.pl) |
| 73 | perlasm(co-586.${ASM_EXT} asm/co-586.pl) |
| 74 | perlasm(x86-mont.${ASM_EXT} asm/x86-mont.pl) |
| 75 | perlasm(armv4-mont.${ASM_EXT} asm/armv4-mont.pl) |
Adam Langley | fad6327 | 2015-11-12 12:15:39 -0800 | [diff] [blame] | 76 | perlasm(armv8-mont.${ASM_EXT} asm/armv8-mont.pl) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 77 | |
| 78 | add_executable( |
| 79 | bn_test |
| 80 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 81 | bn_test.cc |
Adam Langley | f4e4272 | 2015-06-04 17:45:09 -0700 | [diff] [blame] | 82 | |
| 83 | $<TARGET_OBJECTS:test_support> |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 84 | ) |
| 85 | |
| 86 | target_link_libraries(bn_test crypto) |
Kenny Root | e99801b | 2015-11-06 15:31:15 -0800 | [diff] [blame] | 87 | add_dependencies(all_tests bn_test) |