Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix endinanness on cuda #353

Merged
merged 3 commits into from
Jan 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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;
}