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.

36 lines
874 B

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1997.
  5. //
  6. // File: rng.h
  7. //
  8. // Contents: Functions that are used to generate rnadom numbers
  9. //
  10. // Classes:
  11. //
  12. // Functions: GenerateRandomBits
  13. // GatherRandomBits
  14. //
  15. //
  16. // History: 12-19-97 v-sbhatt Created
  17. //
  18. //----------------------------------------------------------------------------
  19. #ifndef _RNG_H_
  20. #define _RNG_H_
  21. #define A_SHA_DIGEST_LEN 20
  22. #define RAND_CTXT_LEN 60
  23. #define RC4_REKEY_PARAM 500 // rekey every 500 bytes
  24. typedef struct tagRandContext
  25. {
  26. DWORD dwBitsFilled;
  27. BYTE rgbBitBuffer[RAND_CTXT_LEN];
  28. } RAND_CONTEXT, *PRAND_CONTEXT;
  29. VOID GenerateRandomBits(PUCHAR pbBuffer, ULONG dwLength);
  30. void GatherRandomBits(PRAND_CONTEXT prandContext);
  31. #endif //_RNG_H_