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.

58 lines
1.1 KiB

  1. #ifndef __TRIPLDES_H__
  2. #define __TRIPLDES_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. // tripledes2key:
  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 tripledes2key(PDES3TABLE pDES3Table, BYTE *pbKey);
  27. // tripledes3key:
  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 tripledes3key(PDES3TABLE pDES3Table, BYTE *pbKey);
  37. //
  38. // Encrypt or decrypt with the key in pKey (DES3Table)
  39. //
  40. void RSA32API tripledes(BYTE *pbOut, BYTE *pbIn, void *pKey, int op);
  41. extern int Asmversion; /* 1 if we're linked with an asm version, 0 if C */
  42. #ifdef __cplusplus
  43. }
  44. #endif
  45. #endif // __TRIPLDES_H__