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.

32 lines
1.3 KiB

  1. #include "uksPCH.h"
  2. #include "DrmErrs.h"
  3. #include "CBCKey.h"
  4. #include "KrmCommStructs.h"
  5. #include "CryptoHelpers.h"
  6. //------------------------------------------------------------------------------
  7. DRM_STATUS CryptoHelpers::InitMac(CBCKey& macKey, CBCState& macState,BYTE* Data, DWORD DatSize){
  8. STREAMKEY myKey;
  9. bv4_key_C(&myKey, DatSize, Data);
  10. BYTE buf[64];
  11. memset(buf, 0, sizeof(buf));
  12. bv4_C(&myKey, 64, buf);
  13. CBC64Init(&macKey, &macState, buf);
  14. return DRM_OK;
  15. };
  16. //------------------------------------------------------------------------------
  17. DRM_STATUS CryptoHelpers::Mac(CBCKey& Key, BYTE* Data, DWORD DatLen, OUT DRMDIGEST& Digest){
  18. CBCState state;
  19. CBC64InitState(&state);
  20. CBC64Update(&Key, &state, DatLen, Data);
  21. Digest.w1=CBC64Finalize(&Key, &state, &Digest.w2);
  22. return DRM_OK;
  23. };
  24. //------------------------------------------------------------------------------
  25. DRM_STATUS CryptoHelpers::Xcrypt(STREAMKEY& Key, BYTE* Data, DWORD DatLen){
  26. bv4_C(&Key, DatLen, Data);
  27. return DRM_OK;
  28. };
  29. //------------------------------------------------------------------------------
  30. //------------------------------------------------------------------------------
  31. //------------------------------------------------------------------------------
  32. //------------------------------------------------------------------------------