Package list libcryptx-perl / be53ea3
update ltm + ltc Karel Miko 2 years ago
7 changed file(s) with 65 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
258258 /** the ECC params provided */
259259 extern const ltc_ecc_curve ltc_ecc_curves[];
260260
261 int ecc_test(void);
262261 void ecc_sizes(int *low, int *high);
263262 int ecc_get_size(const ecc_key *key);
264263
3636 return res;
3737 }
3838 #endif
39
40 /* ref: $Format:%D$ */
41 /* git commit: $Format:%H$ */
42 /* commit time: $Format:%ai$ */
33 *
44 * LibTomMath is a library that provides multiple-precision
55 * integer arithmetic as well as number theoretic functionality.
6 *
7 * The library was designed directly after the MPI library by
8 * Michael Fromberger but has been written from scratch with
9 * additional optimizations in place.
610 *
711 * The library is free for all purposes without any express
812 * guarantee it works.
121125 }
122126
123127 #endif
128
129 /* ref: $Format:%D$ */
130 /* git commit: $Format:%H$ */
131 /* commit time: $Format:%ai$ */
1616 #include <stdlib.h>
1717 #include <limits.h>
1818
19 #include <tommath_class.h>
19 #include "tommath_class.h"
2020
2121 #ifdef __cplusplus
2222 extern "C" {
203203 /* set to a digit */
204204 void mp_set(mp_int *a, mp_digit b);
205205
206 /* set a double */
207 int mp_set_double(mp_int *a, double b);
208
206209 /* set a 32-bit const */
207210 int mp_set_int(mp_int *a, unsigned long b);
208211
211214
212215 /* set a platform dependent unsigned long long value */
213216 /* int mp_set_long_long(mp_int *a, unsigned long long b); */
217
218 /* get a double */
219 double mp_get_double(const mp_int *a);
214220
215221 /* get a 32-bit value */
216222 unsigned long mp_get_int(const mp_int *a);
0 /* LibTomMath, multiple-precision integer library -- Tom St Denis
1 *
2 * LibTomMath is a library that provides multiple-precision
3 * integer arithmetic as well as number theoretic functionality.
4 *
5 * The library was designed directly after the MPI library by
6 * Michael Fromberger but has been written from scratch with
7 * additional optimizations in place.
8 *
9 * The library is free for all purposes without any express
10 * guarantee it works.
11 */
012 #if !(defined(LTM1) && defined(LTM2) && defined(LTM3))
113 #if defined(LTM2)
214 # define LTM3
4759 # define BN_MP_FREAD_C
4860 # define BN_MP_FWRITE_C
4961 # define BN_MP_GCD_C
62 # define BN_MP_GET_DOUBLE_C
5063 # define BN_MP_GET_INT_C
5164 # define BN_MP_GET_LONG_C
5265 # define BN_MP_GET_LONG_LONG_C
104117 # define BN_MP_REDUCE_SETUP_C
105118 # define BN_MP_RSHD_C
106119 # define BN_MP_SET_C
120 # define BN_MP_SET_DOUBLE_C
107121 # define BN_MP_SET_INT_C
108122 # define BN_MP_SET_LONG_C
109123 # define BN_MP_SET_LONG_LONG_C
424438 # define BN_MP_CLEAR_C
425439 #endif
426440
441 #if defined(BN_MP_GET_DOUBLE_C)
442 # define BN_MP_ISNEG_C
443 #endif
444
427445 #if defined(BN_MP_GET_INT_C)
428446 #endif
429447
832850 # define BN_MP_ZERO_C
833851 #endif
834852
853 #if defined(BN_MP_SET_DOUBLE_C)
854 # define BN_MP_SET_LONG_LONG_C
855 # define BN_MP_DIV_2D_C
856 # define BN_MP_MUL_2D_C
857 # define BN_MP_ISZERO_C
858 #endif
859
835860 #if defined(BN_MP_SET_INT_C)
836861 # define BN_MP_ZERO_C
837862 # define BN_MP_MUL_2D_C
11071132 # define LTM_LAST
11081133 #endif
11091134
1110 #include <tommath_superclass.h>
1111 #include <tommath_class.h>
1135 #include "tommath_superclass.h"
1136 #include "tommath_class.h"
11121137 #else
11131138 # define LTM_LAST
11141139 #endif
1140
1141 /* ref: $Format:%D$ */
1142 /* git commit: $Format:%H$ */
1143 /* commit time: $Format:%ai$ */
0 /* LibTomMath, multiple-precision integer library -- Tom St Denis
1 *
2 * LibTomMath is a library that provides multiple-precision
3 * integer arithmetic as well as number theoretic functionality.
4 *
5 * The library was designed directly after the MPI library by
6 * Michael Fromberger but has been written from scratch with
7 * additional optimizations in place.
8 *
9 * The library is free for all purposes without any express
10 * guarantee it works.
11 */
12
013 /* super class file for PK algos */
114
215 /* default ... include all MPI */
3535 ### get rid of bn_mp_set_long_long + bn_mp_get_long_long
3636 system 'rm', '-rf', "$FindBin::Bin/ltm/bn_mp_set_long_long.c";
3737 system 'rm', '-rf', "$FindBin::Bin/ltm/bn_mp_get_long_long.c";
38 system 'rm', '-rf', "$FindBin::Bin/ltm/bn_mp_get_double.c";
39 system 'rm', '-rf', "$FindBin::Bin/ltm/bn_mp_set_double.c";
3840 system 'sed', '-i', 's,^\(int *mp_set_long_long.*\),/* \1 */,', 'src//ltm/tommath.h';
3941 system 'sed', '-i', 's,^\(unsigned *long *long *mp_get_long_long.*\),/* \1 */,', 'src//ltm/tommath.h';
4042