Skip to content

Commit

Permalink
Fix endinanness on cuda (#353)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbruestle committed Jan 27, 2023
1 parent 98cb897 commit 7995ca6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions risc0/zkp/kernels/cuda/sha256.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ __device__ inline ShaDigest shaHashInner(const T* data, size_t size, size_t stri
compress(state, words);
}

for (size_t i = 0; i < 8; i++) {
state.words[i] = impl::convertU32(state.words[i]);
}

return state;
}

Expand Down Expand Up @@ -224,6 +228,10 @@ __device__ inline ShaDigest shaHashPair(ShaDigest x, ShaDigest y) {
ShaDigest state = impl::initState();
impl::compress(state, words);

for (size_t i = 0; i < 8; i++) {
state.words[i] = impl::convertU32(state.words[i]);
}

// Return the results
return state;
}

0 comments on commit 7995ca6

Please sign in to comment.