Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

16 lines
849 B

struct MontgomeryData
{
DWORD K; /* length of modulus */
DWORD M0Prime; /* -M[0]**(-1) mod 2**DIGIT_BITS */
LPDWORD M; /* modulus */
LPDWORD product; /* space for temporary product */
};
void MontgomerySetup(struct MontgomeryData *context, LPDWORD M, DWORD N);
void MontgomeryTeardown(struct MontgomeryData *context);
void MontgomeryTransform(struct MontgomeryData *context, LPDWORD X);
void MontgomeryReduce(struct MontgomeryData *context, LPDWORD T, LPDWORD X);
void MontgomeryModSquare(struct MontgomeryData *context, LPDWORD A, LPDWORD B);
void MontgomeryModMultiply(struct MontgomeryData *context, LPDWORD A, LPDWORD B, LPDWORD C);
void MontgomeryModExp(LPDWORD A, LPDWORD B, LPDWORD C, LPDWORD D, DWORD len);
void MontgomeryModRoot(LPDWORD M, LPDWORD C, LPDWORD PP, LPDWORD QQ, LPDWORD DP, LPDWORD DQ, LPDWORD CR, DWORD PSize);