Leaked source code of windows server 2003
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.

57 lines
1.7 KiB

  1. //-----------------------------------------------------------------------------
  2. //
  3. // File: sha.h
  4. //
  5. // Microsoft Digital Rights Management
  6. // Copyright (C) Microsoft Corporation, 1999-2001. All Rights Reserved
  7. //
  8. // Description:
  9. //
  10. //-----------------------------------------------------------------------------
  11. #ifndef RSA32API
  12. #define RSA32API __stdcall
  13. #endif
  14. /* Copyright (C) RSA Data Security, Inc. created 1993. This is an
  15. unpublished work protected as such under copyright law. This work
  16. contains proprietary, confidential, and trade secret information of
  17. RSA Data Security, Inc. Use, disclosure or reproduction without the
  18. express written authorization of RSA Data Security, Inc. is
  19. prohibited.
  20. */
  21. #ifndef _SHA_H_
  22. #define _SHA_H_ 1
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. #define A_SHA_DIGEST_LEN 20
  27. typedef struct {
  28. DWORD FinishFlag;
  29. BYTE HashVal[A_SHA_DIGEST_LEN];
  30. DWORD state[5]; /* state (ABCDE) */
  31. DWORD count[2]; /* number of bytes, msb first */
  32. unsigned char buffer[64]; /* input buffer */
  33. } A_SHA_CTX;
  34. void RSA32API A_SHAInit(A_SHA_CTX *);
  35. void RSA32API A_SHAUpdate(A_SHA_CTX *, unsigned char *, unsigned int);
  36. void RSA32API A_SHAFinal(A_SHA_CTX *, unsigned char [A_SHA_DIGEST_LEN]);
  37. //
  38. // versions that don't internally byteswap (NoSwap version), for apps like
  39. // the RNG that don't need hash compatibility - perf increase helps.
  40. //
  41. void RSA32API A_SHAUpdateNS(A_SHA_CTX *, unsigned char *, unsigned int);
  42. void RSA32API A_SHAFinalNS(A_SHA_CTX *, unsigned char [A_SHA_DIGEST_LEN]);
  43. #ifdef __cplusplus
  44. }
  45. #endif
  46. #endif