--- pgp/src/mpilib.h 2018/04/24 16:38:37 1.1.1.2 +++ pgp/src/mpilib.h 2018/04/24 16:40:08 1.1.1.4 @@ -208,14 +208,6 @@ typedef unit *unitptr; /* #define mp_tstminus(r) ((msunit(r) & uppermostbit)!=0) */ #define mp_tstminus(r) ((signedunit) msunit(r) < 0) -/* MAX_BIT_PRECISION is upper limit that assembly primitives can handle. - It must be less than 32704 bits, or 4088 bytes. It should be an - integer multiple of UNITSIZE*2. -*/ -#define MAX_BIT_PRECISION 1152 -#define MAX_BYTE_PRECISION (MAX_BIT_PRECISION/8) -#define MAX_UNIT_PRECISION (MAX_BIT_PRECISION/UNITSIZE) - /* set working precision to specified number of bits. */ #ifdef mp_setp @@ -317,6 +309,18 @@ void mp_setp(short nbits); #define SMITH_SLOP_BITS 0 #endif /* mp_smul */ +/* MAX_BIT_PRECISION is upper limit that assembly primitives can handle. + It must be less than 32704 bits, or 4088 bytes. It should be an + integer multiple of UNITSIZE*2. +*/ +#if (SLOP_BITS > 0) +#define MAX_BIT_PRECISION (1280+(2*UNITSIZE)) +#else +#define MAX_BIT_PRECISION 1280 +#endif +#define MAX_BYTE_PRECISION (MAX_BIT_PRECISION/8) +#define MAX_UNIT_PRECISION (MAX_BIT_PRECISION/UNITSIZE) + /* global_precision is the unit precision last set by set_precision */ extern short global_precision; @@ -457,8 +461,8 @@ int mp_modexp(register unitptr expout,re register unitptr exponent,register unitptr modulus); /* Combined exponentiation/modulo algorithm. */ -int rsa_decrypt(unitptr M, unitptr C, - unitptr d, unitptr p, unitptr q, unitptr u); - /* Uses Chinese Remainder Theorem shortcut for RSA decryption. */ +int mp_modexp_crt(unitptr expout, unitptr expin, + unitptr p, unitptr q, unitptr ep, unitptr eq, unitptr u); + /* exponentiation and modulo using Chinese Remainder Theorem */ /****************** end of MPI library ****************************/