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.

72 lines
1.3 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1999
  6. //
  7. // File: modes.h
  8. //
  9. //--------------------------------------------------------------------------
  10. /* modes.h
  11. Defines the generic routines used to do chaining modes with a
  12. block cipher.
  13. */
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. // constants for operations
  18. #define ENCRYPT 1
  19. #define DECRYPT 0
  20. /* CBC()
  21. *
  22. * Performs a XOR on the plaintext with the previous ciphertext
  23. *
  24. * Parameters:
  25. *
  26. * output Input buffer -- MUST be RC2_BLOCKLEN
  27. * input Output buffer -- MUST be RC2_BLOCKLEN
  28. * keyTable
  29. * op ENCRYPT, or DECRYPT
  30. * feedback feedback register
  31. *
  32. */
  33. void CBC(void Cipher(BYTE *, BYTE *, void *, int),
  34. DWORD dwBlockLen,
  35. BYTE *output,
  36. BYTE *input,
  37. void *keyTable,
  38. int op,
  39. BYTE *feedback);
  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 CFB(void Cipher(BYTE *, BYTE *, void *, int),
  54. DWORD dwBlockLen,
  55. BYTE *output,
  56. BYTE *input,
  57. void *keyTable,
  58. int op,
  59. BYTE *feedback);
  60. #ifdef __cplusplus
  61. }
  62. #endif