OLD | NEW |
1 /* | 1 /* |
2 * mpi.h | 2 * mpi.h |
3 * | 3 * |
4 * Arbitrary precision integer arithmetic library | 4 * Arbitrary precision integer arithmetic library |
5 * | 5 * |
6 * This Source Code Form is subject to the terms of the Mozilla Public | 6 * This Source Code Form is subject to the terms of the Mozilla Public |
7 * License, v. 2.0. If a copy of the MPL was not distributed with this | 7 * License, v. 2.0. If a copy of the MPL was not distributed with this |
8 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 8 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
9 | 9 |
10 #ifndef _H_MPI_ | 10 #ifndef _H_MPI_ |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 #define mp_tobinary(M, S) mp_toradix((M), (S), 2) | 251 #define mp_tobinary(M, S) mp_toradix((M), (S), 2) |
252 #define mp_tooctal(M, S) mp_toradix((M), (S), 8) | 252 #define mp_tooctal(M, S) mp_toradix((M), (S), 8) |
253 #define mp_todecimal(M, S) mp_toradix((M), (S), 10) | 253 #define mp_todecimal(M, S) mp_toradix((M), (S), 10) |
254 #define mp_tohex(M, S) mp_toradix((M), (S), 16) | 254 #define mp_tohex(M, S) mp_toradix((M), (S), 16) |
255 | 255 |
256 /* Error strings */ | 256 /* Error strings */ |
257 const char *mp_strerror(mp_err ec); | 257 const char *mp_strerror(mp_err ec); |
258 | 258 |
259 /* Octet string conversion functions */ | 259 /* Octet string conversion functions */ |
260 mp_err mp_read_unsigned_octets(mp_int *mp, const unsigned char *str, mp_size len
); | 260 mp_err mp_read_unsigned_octets(mp_int *mp, const unsigned char *str, mp_size len
); |
261 int mp_unsigned_octet_size(const mp_int *mp); | 261 unsigned int mp_unsigned_octet_size(const mp_int *mp); |
262 mp_err mp_to_unsigned_octets(const mp_int *mp, unsigned char *str, mp_size maxle
n); | 262 mp_err mp_to_unsigned_octets(const mp_int *mp, unsigned char *str, mp_size maxle
n); |
263 mp_err mp_to_signed_octets(const mp_int *mp, unsigned char *str, mp_size maxlen)
; | 263 mp_err mp_to_signed_octets(const mp_int *mp, unsigned char *str, mp_size maxlen)
; |
264 mp_err mp_to_fixlen_octets(const mp_int *mp, unsigned char *str, mp_size len); | 264 mp_err mp_to_fixlen_octets(const mp_int *mp, unsigned char *str, mp_size len); |
265 | 265 |
266 /* Miscellaneous */ | 266 /* Miscellaneous */ |
267 mp_size mp_trailing_zeros(const mp_int *mp); | 267 mp_size mp_trailing_zeros(const mp_int *mp); |
268 void freebl_cpuid(unsigned long op, unsigned long *eax, | 268 void freebl_cpuid(unsigned long op, unsigned long *eax, |
269 unsigned long *ebx, unsigned long *ecx, | 269 unsigned long *ebx, unsigned long *ecx, |
270 unsigned long *edx); | 270 unsigned long *edx); |
271 | 271 |
(...skipping 19 matching lines...) Expand all Loading... |
291 #define ARGCHK(X,Y) {if(!(X)){return (Y);}} | 291 #define ARGCHK(X,Y) {if(!(X)){return (Y);}} |
292 #elif MP_ARGCHK == 2 | 292 #elif MP_ARGCHK == 2 |
293 #include <assert.h> | 293 #include <assert.h> |
294 #define ARGCHK(X,Y) assert(X) | 294 #define ARGCHK(X,Y) assert(X) |
295 #else | 295 #else |
296 #define ARGCHK(X,Y) /* */ | 296 #define ARGCHK(X,Y) /* */ |
297 #endif | 297 #endif |
298 #endif /* defined MP_API_COMPATIBLE */ | 298 #endif /* defined MP_API_COMPATIBLE */ |
299 | 299 |
300 #endif /* end _H_MPI_ */ | 300 #endif /* end _H_MPI_ */ |
OLD | NEW |