Hi, guys!
I am trying to implement SHA-256 on GPU using CUDA. And I want each
thread to compute hash for one block or data chunk at a time and store
the hashes in scratch space. After all threads finished their work I
want to compute final hash from these partial hashes. Is it possible
to do this? I have heard something about sliding windows or direct
ha****ng, I am not sure, where such technique is used, however I can't
find any do***entation. So, what I am trying to do now is this:
1) I have message
"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" no quotes.
2) I pad the message and get two blocks:
First block:
61626364 62636465 63646566 64656667
65666768 66676869 6768696a 68696a6b
696a6b6c 6a6b6c6d 6b6c6d6e 6c6d6e6f
6d6e6f70 6e6f7071 80000000 00000000
Second block:
00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000
00000000 00000000 00000000 000001c0
3) One thread computes hash for the first block, and other one - for
the second one. I get these hashes:
For first block:
85e655d6 417a1795 3363376a 624cde5c 76e09589 cac5f811 cc4b32c1
f20e533a
For second block:
e6adb3eb 2ca8536c 0ac33f32 18c66976 541f8f09 8ade1563 4282fc17
4a3de2e6
So, is it possible to get final hash from these two hashes. Final hash
for the message above is
248d6a61 d20638b8 e5c02693 0c3e6039 a33ce459 64ff2167 f6ecedd4
19db06c1
Maybe I am doing something wrong, maybe I should split the given
message into smaller ones or something similar, because I want to
process given message with multiple threads at a time. Thank you.
Tadas Vilkeliskis


|