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

  1. struct MontgomeryData
  2. {
  3. DWORD K; /* length of modulus */
  4. DWORD M0Prime; /* -M[0]**(-1) mod 2**DIGIT_BITS */
  5. LPDWORD M; /* modulus */
  6. LPDWORD product; /* space for temporary product */
  7. };
  8. void MontgomerySetup(struct MontgomeryData *context, LPDWORD M, DWORD N);
  9. void MontgomeryTeardown(struct MontgomeryData *context);
  10. void MontgomeryTransform(struct MontgomeryData *context, LPDWORD X);
  11. void MontgomeryReduce(struct MontgomeryData *context, LPDWORD T, LPDWORD X);
  12. void MontgomeryModSquare(struct MontgomeryData *context, LPDWORD A, LPDWORD B);
  13. void MontgomeryModMultiply(struct MontgomeryData *context, LPDWORD A, LPDWORD B, LPDWORD C);
  14. void MontgomeryModExp(LPDWORD A, LPDWORD B, LPDWORD C, LPDWORD D, DWORD len);
  15. void MontgomeryModRoot(LPDWORD M, LPDWORD C, LPDWORD PP, LPDWORD QQ, LPDWORD DP, LPDWORD DQ, LPDWORD CR, DWORD PSize);