Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. errorCode = dispatchQueue->enqueueWriteBuffer(
  2. inputBuffer,
  3. CL_FALSE,//CL_TRUE,
  4. 0,
  5. sizeof(cl_uchar) * inputBufferSize,
  6. passwordBuffer,
  7. NULL,
  8. &dispatchDelegate);
  9.  
  10. errorCode = dispatchQueue->enqueueNDRangeKernel(
  11. *kernel,
  12. NullRange,
  13. NDRange(globalWorkgroupSize, 1),
  14. NullRange,
  15. NULL,
  16. NULL);
  17.  
  18. __kernel void sha1Crack(__global uchar* out, __global uchar* in,
  19. __constant int* passLen, __constant int* targetHash,
  20. __global bool* collisionFound)
  21. {
  22. //Kernel Instance Global GPU Mem IO Mapping:
  23. __private int id = get_global_id(0);
  24. __private int inputIndexStart = id * passwordLen;
  25.  
  26. //Select Password input key space:
  27. #pragma unroll
  28. for (i = 0; i < passwordLen; i++)
  29. {
  30. inputMem[i] = in[inputIndexStart + i];
  31. }
  32.  
  33. //SHA1 Code omitted for brevity...
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement