Mercurial > dropbear
comparison libtommath/tommath_superclass.h @ 1655:f52919ffd3b1
update ltm to 1.1.0 and enable FIPS 186.4 compliant key-generation (#79)
* make key-generation compliant to FIPS 186.4
* fix includes in tommath_class.h
* update fuzzcorpus instead of error-out
* fixup fuzzing make-targets
* update Makefile.in
* apply necessary patches to ltm sources
* clean-up not required ltm files
* update to vanilla ltm 1.1.0
this already only contains the required files
* remove set/get double
author | Steffen Jaeckel <s_jaeckel@gmx.de> |
---|---|
date | Mon, 16 Sep 2019 15:50:38 +0200 |
parents | 8bba51a55704 |
children | 1051e4eea25a |
comparison
equal
deleted
inserted
replaced
1654:cc0fc5131c5c | 1655:f52919ffd3b1 |
---|---|
1 /* LibTomMath, multiple-precision integer library -- Tom St Denis | |
2 * | |
3 * LibTomMath is a library that provides multiple-precision | |
4 * integer arithmetic as well as number theoretic functionality. | |
5 * | |
6 * The library was designed directly after the MPI library by | |
7 * Michael Fromberger but has been written from scratch with | |
8 * additional optimizations in place. | |
9 * | |
10 * SPDX-License-Identifier: Unlicense | |
11 */ | |
12 | |
1 /* super class file for PK algos */ | 13 /* super class file for PK algos */ |
2 | 14 |
3 /* default ... include all MPI */ | 15 /* default ... include all MPI */ |
4 #define LTM_ALL | 16 #define LTM_ALL |
5 | 17 |
12 | 24 |
13 */ | 25 */ |
14 | 26 |
15 /* Works for RSA only, mpi.o is 68KiB */ | 27 /* Works for RSA only, mpi.o is 68KiB */ |
16 #ifdef SC_RSA_1 | 28 #ifdef SC_RSA_1 |
17 #define BN_MP_SHRINK_C | 29 # define BN_MP_SHRINK_C |
18 #define BN_MP_LCM_C | 30 # define BN_MP_LCM_C |
19 #define BN_MP_PRIME_RANDOM_EX_C | 31 # define BN_MP_PRIME_RANDOM_EX_C |
20 #define BN_MP_INVMOD_C | 32 # define BN_MP_INVMOD_C |
21 #define BN_MP_GCD_C | 33 # define BN_MP_GCD_C |
22 #define BN_MP_MOD_C | 34 # define BN_MP_MOD_C |
23 #define BN_MP_MULMOD_C | 35 # define BN_MP_MULMOD_C |
24 #define BN_MP_ADDMOD_C | 36 # define BN_MP_ADDMOD_C |
25 #define BN_MP_EXPTMOD_C | 37 # define BN_MP_EXPTMOD_C |
26 #define BN_MP_SET_INT_C | 38 # define BN_MP_SET_INT_C |
27 #define BN_MP_INIT_MULTI_C | 39 # define BN_MP_INIT_MULTI_C |
28 #define BN_MP_CLEAR_MULTI_C | 40 # define BN_MP_CLEAR_MULTI_C |
29 #define BN_MP_UNSIGNED_BIN_SIZE_C | 41 # define BN_MP_UNSIGNED_BIN_SIZE_C |
30 #define BN_MP_TO_UNSIGNED_BIN_C | 42 # define BN_MP_TO_UNSIGNED_BIN_C |
31 #define BN_MP_MOD_D_C | 43 # define BN_MP_MOD_D_C |
32 #define BN_MP_PRIME_RABIN_MILLER_TRIALS_C | 44 # define BN_MP_PRIME_RABIN_MILLER_TRIALS_C |
33 #define BN_REVERSE_C | 45 # define BN_REVERSE_C |
34 #define BN_PRIME_TAB_C | 46 # define BN_PRIME_TAB_C |
35 | 47 |
36 /* other modifiers */ | 48 /* other modifiers */ |
37 #define BN_MP_DIV_SMALL /* Slower division, not critical */ | 49 # define BN_MP_DIV_SMALL /* Slower division, not critical */ |
38 | 50 |
39 /* here we are on the last pass so we turn things off. The functions classes are still there | 51 /* here we are on the last pass so we turn things off. The functions classes are still there |
40 * but we remove them specifically from the build. This also invokes tweaks in functions | 52 * but we remove them specifically from the build. This also invokes tweaks in functions |
41 * like removing support for even moduli, etc... | 53 * like removing support for even moduli, etc... |
42 */ | 54 */ |
43 #ifdef LTM_LAST | 55 # ifdef LTM_LAST |
44 #undef BN_MP_TOOM_MUL_C | 56 # undef BN_MP_TOOM_MUL_C |
45 #undef BN_MP_TOOM_SQR_C | 57 # undef BN_MP_TOOM_SQR_C |
46 #undef BN_MP_KARATSUBA_MUL_C | 58 # undef BN_MP_KARATSUBA_MUL_C |
47 #undef BN_MP_KARATSUBA_SQR_C | 59 # undef BN_MP_KARATSUBA_SQR_C |
48 #undef BN_MP_REDUCE_C | 60 # undef BN_MP_REDUCE_C |
49 #undef BN_MP_REDUCE_SETUP_C | 61 # undef BN_MP_REDUCE_SETUP_C |
50 #undef BN_MP_DR_IS_MODULUS_C | 62 # undef BN_MP_DR_IS_MODULUS_C |
51 #undef BN_MP_DR_SETUP_C | 63 # undef BN_MP_DR_SETUP_C |
52 #undef BN_MP_DR_REDUCE_C | 64 # undef BN_MP_DR_REDUCE_C |
53 #undef BN_MP_REDUCE_IS_2K_C | 65 # undef BN_MP_REDUCE_IS_2K_C |
54 #undef BN_MP_REDUCE_2K_SETUP_C | 66 # undef BN_MP_REDUCE_2K_SETUP_C |
55 #undef BN_MP_REDUCE_2K_C | 67 # undef BN_MP_REDUCE_2K_C |
56 #undef BN_S_MP_EXPTMOD_C | 68 # undef BN_S_MP_EXPTMOD_C |
57 #undef BN_MP_DIV_3_C | 69 # undef BN_MP_DIV_3_C |
58 #undef BN_S_MP_MUL_HIGH_DIGS_C | 70 # undef BN_S_MP_MUL_HIGH_DIGS_C |
59 #undef BN_FAST_S_MP_MUL_HIGH_DIGS_C | 71 # undef BN_FAST_S_MP_MUL_HIGH_DIGS_C |
60 #undef BN_FAST_MP_INVMOD_C | 72 # undef BN_FAST_MP_INVMOD_C |
61 | 73 |
62 /* To safely undefine these you have to make sure your RSA key won't exceed the Comba threshold | 74 /* To safely undefine these you have to make sure your RSA key won't exceed the Comba threshold |
63 * which is roughly 255 digits [7140 bits for 32-bit machines, 15300 bits for 64-bit machines] | 75 * which is roughly 255 digits [7140 bits for 32-bit machines, 15300 bits for 64-bit machines] |
64 * which means roughly speaking you can handle upto 2536-bit RSA keys with these defined without | 76 * which means roughly speaking you can handle upto 2536-bit RSA keys with these defined without |
65 * trouble. | 77 * trouble. |
66 */ | 78 */ |
67 #undef BN_S_MP_MUL_DIGS_C | 79 # undef BN_S_MP_MUL_DIGS_C |
68 #undef BN_S_MP_SQR_C | 80 # undef BN_S_MP_SQR_C |
69 #undef BN_MP_MONTGOMERY_REDUCE_C | 81 # undef BN_MP_MONTGOMERY_REDUCE_C |
70 #endif | 82 # endif |
71 | 83 |
72 #endif | 84 #endif |
73 | 85 |
74 /* ref: $Format:%D$ */ | 86 /* ref: HEAD -> master, tag: v1.1.0 */ |
75 /* git commit: $Format:%H$ */ | 87 /* git commit: 08549ad6bc8b0cede0b357a9c341c5c6473a9c55 */ |
76 /* commit time: $Format:%ai$ */ | 88 /* commit time: 2019-01-28 20:32:32 +0100 */ |