rejoined diffie hellman code from ltc 1.05, thanks to Alexander Kurpiers

This commit is contained in:
Steffen Jaeckel
2011-01-18 20:06:03 +01:00
parent 5039e6520f
commit 6fecec107d
14 changed files with 1594 additions and 1 deletions
+20
View File
@@ -258,6 +258,24 @@ typedef struct {
*/
int (*lcm)(void *a, void *b, void *c);
/** Modular addition
@param a The first source
@param b The second source
@param c The modulus
@param d The destination (a + b mod c)
@return CRYPT_OK on success
*/
int (*addmod)(void *a, void *b, void *c, void *d);
/** Modular substraction
@param a The first source
@param b The second source
@param c The modulus
@param d The destination (a - b mod c)
@return CRYPT_OK on success
*/
int (*submod)(void *a, void *b, void *c, void *d);
/** Modular multiplication
@param a The first source
@param b The second source
@@ -475,6 +493,8 @@ extern const ltc_math_descriptor gmp_desc;
#define mp_gcd(a, b, c) ltc_mp.gcd(a, b, c)
#define mp_lcm(a, b, c) ltc_mp.lcm(a, b, c)
#define mp_addmod(a, b, c, d) ltc_mp.addmod(a, b, c, d)
#define mp_submod(a, b, c, d) ltc_mp.submod(a, b, c, d)
#define mp_mulmod(a, b, c, d) ltc_mp.mulmod(a, b, c, d)
#define mp_sqrmod(a, b, c) ltc_mp.sqrmod(a, b, c)
#define mp_invmod(a, b, c) ltc_mp.invmod(a, b, c)