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.

30 lines
1003 B

  1. #ifndef __BENALOH_H__
  2. #define __BENALOH_H__
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. struct BenalohData
  7. {
  8. DWORD N; /* length of modulus */
  9. LPDWORD M; /* a multiple of modulus, with highest bit set */
  10. LPDWORD U; /* base**(N+1) mod modulus */
  11. LPDWORD V; /* modulus - U */
  12. LPDWORD product;
  13. };
  14. BOOL BenalohSetup(struct BenalohData *context, LPDWORD M, DWORD N);
  15. void BenalohTeardown(struct BenalohData *context);
  16. void BenalohMod(struct BenalohData *context, LPDWORD T, LPDWORD X);
  17. void BenalohModSquare(struct BenalohData *context, LPDWORD A, LPDWORD B);
  18. void BenalohModMultiply(struct BenalohData *context, LPDWORD A, LPDWORD B, LPDWORD C);
  19. BOOL BenalohModExp(LPDWORD A, LPDWORD B, LPDWORD C, LPDWORD D, DWORD len);
  20. BOOL BenalohModRoot(LPDWORD M, LPDWORD C, LPDWORD PP, LPDWORD QQ, LPDWORD DP, LPDWORD DQ, LPDWORD CR, DWORD PSize);
  21. DWORD BenalohEstimateQuotient(DWORD a1, DWORD a2, DWORD m1);
  22. #ifdef __cplusplus
  23. }
  24. #endif
  25. #endif // __BENALOH_H__