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.

103 lines
2.0 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1999
  6. //
  7. // File: pfxcrypt.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #define RC4_128 1
  11. #define RC4_40 2
  12. #define TripleDES 3
  13. #define RC2_128 4
  14. #define RC2_40 5
  15. BOOL _stdcall
  16. PFXPasswordEncryptData(
  17. int iEncrType,
  18. LPCWSTR szPassword,
  19. int iPKCS5Iterations, // pkcs5 data
  20. PBYTE pbPKCS5Salt,
  21. DWORD cbPKCS5Salt,
  22. PBYTE* pbData,
  23. DWORD* pcbData);
  24. BOOL _stdcall
  25. PFXPasswordDecryptData(
  26. int iEncrType,
  27. LPCWSTR szPassword,
  28. int iPKCS5Iterations, // pkcs5 data
  29. PBYTE pbPKCS5Salt,
  30. DWORD cbPKCS5Salt,
  31. PBYTE* pbData,
  32. DWORD* pcbData);
  33. BOOL NSCPPasswordDecryptData(
  34. int iEncrType,
  35. LPCWSTR szPassword,
  36. PBYTE pbPrivacySalt,
  37. DWORD cbPrivacySalt,
  38. int iPKCS5Iterations,
  39. PBYTE pbPKCS5Salt,
  40. DWORD cbPKCS5Salt,
  41. PBYTE* ppbData,
  42. DWORD* pcbData);
  43. BOOL FGenerateMAC(
  44. LPCWSTR szPassword,
  45. PBYTE pbPKCS5Salt,
  46. DWORD cbPKCS5Salt,
  47. DWORD iterationCount,
  48. PBYTE pbData, // pb data
  49. DWORD cbData, // cb data
  50. BYTE rgbMAC[]); // A_SHA_DIGEST_LEN
  51. //////////////////////////////////////////////////
  52. // begin tls1key.h
  53. BOOL PKCS5_GenKey
  54. (
  55. int iIterations,
  56. PBYTE pbPW,
  57. DWORD cbPW,
  58. PBYTE pbSalt,
  59. DWORD cbSalt,
  60. BYTE rgbPKCS5Key[] // A_SHA_DIGEST_LEN
  61. );
  62. BOOL P_Hash
  63. (
  64. PBYTE pbSecret,
  65. DWORD cbSecret,
  66. PBYTE pbSeed,
  67. DWORD cbSeed,
  68. PBYTE pbKeyOut, //Buffer to copy the result...
  69. DWORD cbKeyOut, //# of bytes of key length they want as output.
  70. BOOL fNSCPCompatMode
  71. );
  72. BOOL FTestPHASH_and_HMAC();
  73. BOOL F_NSCP_TestPHASH_and_HMAC();