windows-nt/Source/XPSP1/NT/ds/win32/ntcrypto/inc/montgome.h

17 lines
849 B
C
Raw Normal View History

2020-09-26 03:20:57 -05:00
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);