Merge branch 'fperrad-private' into develop
This commit is contained in:
commit
10ba45b717
@ -1,3 +1,4 @@
|
|||||||
|
#include <string.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#ifdef IOWNANATHLON
|
#ifdef IOWNANATHLON
|
||||||
|
38
tommath.h
38
tommath.h
@ -16,36 +16,16 @@
|
|||||||
#define BN_H_
|
#define BN_H_
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <ctype.h>
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
#include <tommath_class.h>
|
#include <tommath_class.h>
|
||||||
|
|
||||||
#ifndef MIN
|
|
||||||
#define MIN(x,y) (((x) < (y)) ? (x) : (y))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef MAX
|
|
||||||
#define MAX(x,y) (((x) > (y)) ? (x) : (y))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
/* C++ compilers don't like assigning void * to mp_digit * */
|
|
||||||
#define OPT_CAST(x) (x *)
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
/* C on the other hand doesn't care */
|
|
||||||
#define OPT_CAST(x)
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* detect 64-bit mode if possible */
|
/* detect 64-bit mode if possible */
|
||||||
#if defined(__x86_64__)
|
#if defined(__x86_64__)
|
||||||
#if !(defined(MP_32BIT) || defined(MP_16BIT) || defined(MP_8BIT))
|
#if !(defined(MP_32BIT) || defined(MP_16BIT) || defined(MP_8BIT))
|
||||||
@ -116,24 +96,6 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* define heap macros */
|
|
||||||
#ifndef CRYPT
|
|
||||||
/* default to libc stuff */
|
|
||||||
#ifndef XMALLOC
|
|
||||||
#define XMALLOC malloc
|
|
||||||
#define XFREE free
|
|
||||||
#define XREALLOC realloc
|
|
||||||
#define XCALLOC calloc
|
|
||||||
#else
|
|
||||||
/* prototypes for our heap functions */
|
|
||||||
extern void *XMALLOC(size_t n);
|
|
||||||
extern void *XREALLOC(void *p, size_t n);
|
|
||||||
extern void *XCALLOC(size_t n, size_t s);
|
|
||||||
extern void XFREE(void *p);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* otherwise the bits per digit is calculated automatically from the size of a mp_digit */
|
/* otherwise the bits per digit is calculated automatically from the size of a mp_digit */
|
||||||
#ifndef DIGIT_BIT
|
#ifndef DIGIT_BIT
|
||||||
#define DIGIT_BIT (((CHAR_BIT * MP_SIZEOF_MP_DIGIT) - 1)) /* bits per digit */
|
#define DIGIT_BIT (((CHAR_BIT * MP_SIZEOF_MP_DIGIT) - 1)) /* bits per digit */
|
||||||
|
@ -16,9 +16,38 @@
|
|||||||
#define TOMMATH_PRIV_H_
|
#define TOMMATH_PRIV_H_
|
||||||
|
|
||||||
#include <tommath.h>
|
#include <tommath.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
#define MIN(x,y) (((x) < (y)) ? (x) : (y))
|
||||||
|
|
||||||
|
#define MAX(x,y) (((x) > (y)) ? (x) : (y))
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
|
/* C++ compilers don't like assigning void * to mp_digit * */
|
||||||
|
#define OPT_CAST(x) (x *)
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
/* C on the other hand doesn't care */
|
||||||
|
#define OPT_CAST(x)
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* define heap macros */
|
||||||
|
#ifndef XMALLOC
|
||||||
|
/* default to libc stuff */
|
||||||
|
#define XMALLOC malloc
|
||||||
|
#define XFREE free
|
||||||
|
#define XREALLOC realloc
|
||||||
|
#define XCALLOC calloc
|
||||||
|
#else
|
||||||
|
/* prototypes for our heap functions */
|
||||||
|
extern void *XMALLOC(size_t n);
|
||||||
|
extern void *XREALLOC(void *p, size_t n);
|
||||||
|
extern void *XCALLOC(size_t n, size_t s);
|
||||||
|
extern void XFREE(void *p);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* lowlevel functions, do not call! */
|
/* lowlevel functions, do not call! */
|
||||||
|
Loading…
Reference in New Issue
Block a user