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.

79 lines
1.4 KiB

  1. #ifndef __MODES_H__
  2. #define __MODES_H__
  3. #ifndef RSA32API
  4. #define RSA32API __stdcall
  5. #endif
  6. /* modes.h
  7. Defines the generic routines used to do chaining modes with a
  8. block cipher.
  9. */
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. // constants for operations
  14. #define ENCRYPT 1
  15. #define DECRYPT 0
  16. /* CBC()
  17. *
  18. * Performs a XOR on the plaintext with the previous ciphertext
  19. *
  20. * Parameters:
  21. *
  22. * output Input buffer -- MUST be RC2_BLOCKLEN
  23. * input Output buffer -- MUST be RC2_BLOCKLEN
  24. * keyTable
  25. * op ENCRYPT, or DECRYPT
  26. * feedback feedback register
  27. *
  28. */
  29. void
  30. RSA32API
  31. CBC(
  32. void RSA32API Cipher(UCHAR *, UCHAR *, void *, int),
  33. ULONG dwBlockLen,
  34. UCHAR *output,
  35. UCHAR *input,
  36. void *keyTable,
  37. int op,
  38. UCHAR *feedback
  39. );
  40. /* CFB (cipher feedback)
  41. *
  42. *
  43. * Parameters:
  44. *
  45. *
  46. * output Input buffer -- MUST be RC2_BLOCKLEN
  47. * input Output buffer -- MUST be RC2_BLOCKLEN
  48. * keyTable
  49. * op ENCRYPT, or DECRYPT
  50. * feedback feedback register
  51. *
  52. */
  53. void
  54. RSA32API
  55. CFB(
  56. void RSA32API Cipher(UCHAR *, UCHAR *, void *, int),
  57. ULONG dwBlockLen,
  58. UCHAR *output,
  59. UCHAR *input,
  60. void *keyTable,
  61. int op,
  62. UCHAR *feedback
  63. );
  64. #ifdef __cplusplus
  65. }
  66. #endif
  67. #endif // __MODES_H__