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.

37 lines
944 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 TSInitializeRNG(VOID);
  30. VOID legacyGenerateRandomBits(PUCHAR pbBuffer, ULONG dwLength);
  31. void legacyGatherRandomBits(PRAND_CONTEXT prandContext);
  32. #endif //_RNG_H_