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.

55 lines
1.2 KiB

  1. /* Copyright (C) RSA Data Security, Inc. created 1993. This is an
  2. unpublished work protected as such under copyright law. This work
  3. contains proprietary, confidential, and trade secret information of
  4. RSA Data Security, Inc. Use, disclosure or reproduction without the
  5. express written authorization of RSA Data Security, Inc. is
  6. prohibited.
  7. */
  8. #ifndef _UINT4_H_
  9. #define _UINT4_H_ 1
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. /* Encodes x (DWORD) into block (unsigned char), most significant
  14. byte first.
  15. */
  16. void DWORDToBigEndian (
  17. unsigned char *block,
  18. DWORD *x,
  19. unsigned int digits // number of DWORDs
  20. );
  21. /* Decodes block (unsigned char) into x (DWORD), most significant
  22. byte first.
  23. */
  24. void DWORDFromBigEndian (
  25. DWORD *x,
  26. unsigned int digits, // number of DWORDs
  27. unsigned char *block
  28. );
  29. /* Encodes input (DWORD) into output (unsigned char), least significant
  30. byte first. Assumes len is a multiple of 4.
  31. */
  32. void DWORDToLittleEndian (
  33. unsigned char *output,
  34. const DWORD *input,
  35. unsigned int len
  36. );
  37. void DWORDFromLittleEndian (
  38. DWORD *output,
  39. const unsigned char *input,
  40. unsigned int len
  41. );
  42. #ifdef __cplusplus
  43. }
  44. #endif
  45. #endif // _UINT4_H_