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. #ifndef RSA32API
  2. #define RSA32API __stdcall
  3. #endif
  4. /* Copyright (C) RSA Data Security, Inc. created 1993. This is an
  5. unpublished work protected as such under copyright law. This work
  6. contains proprietary, confidential, and trade secret information of
  7. RSA Data Security, Inc. Use, disclosure or reproduction without the
  8. express written authorization of RSA Data Security, Inc. is
  9. prohibited.
  10. */
  11. #ifndef _SHA_H_
  12. #define _SHA_H_ 1
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. #define A_SHA_DIGEST_LEN 20
  17. //
  18. // until CAPI is cleaned up to not require the FinishFlag and HashVal
  19. // fields be present, need to define some slack space to insure that
  20. // buffer is aligned on IA64. Low-impact fix is just add a DWORD of space,
  21. // which the underlying library will offset to buffer+4 when reading/writing
  22. // to buffer.
  23. //
  24. typedef struct {
  25. union {
  26. #if _WIN64
  27. ULONGLONG buffer64[8]; /* force quadword alignment */
  28. #endif
  29. unsigned char buffer[64]; /* input buffer */
  30. } u;
  31. ULONG state[5]; /* state (ABCDE) */
  32. ULONG count[2]; /* number of bytes, msb first */
  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