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.

62 lines
1.1 KiB

  1. #ifndef __DES3_H__
  2. #define __DES3_H__
  3. #ifndef RSA32API
  4. #define RSA32API __stdcall
  5. #endif
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. typedef struct _DES3TABLE {
  10. DESTable keytab1;
  11. DESTable keytab2;
  12. DESTable keytab3;
  13. } DES3TABLE, *PDES3TABLE;
  14. #define DES3_TABLESIZE sizeof(DES3TABLE)
  15. #define DES2_KEYSIZE 16
  16. #define DES3_KEYSIZE 24
  17. // In des2key.c:
  18. //
  19. // Fill in the DES3Table structs with the decrypt and encrypt
  20. // key expansions.
  21. //
  22. // Assumes that the second parameter points to 2 * DES_BLOCKLEN
  23. // bytes of key.
  24. //
  25. //
  26. void RSA32API des2key(PDES3TABLE pDES3Table, PBYTE pbKey);
  27. // In des3key.c:
  28. //
  29. // Fill in the DES3Table structs with the decrypt and encrypt
  30. // key expansions.
  31. //
  32. // Assumes that the second parameter points to 3 * DES_BLOCKLEN
  33. // bytes of key.
  34. //
  35. //
  36. void RSA32API des3key(PDES3TABLE pDES3Table, PBYTE pbKey);
  37. //
  38. // Encrypt or decrypt with the key in pKey
  39. //
  40. void RSA32API des3(PBYTE pbIn, PBYTE pbOut, void *pKey, int op);
  41. //
  42. // set the parity on the DES key to be odd
  43. //
  44. void RSA32API desparity(PBYTE pbKey, DWORD cbKey);
  45. #ifdef __cplusplus
  46. }
  47. #endif
  48. #endif // __DES3_H__