Skip to content

Commit

Permalink
don't access proof after dropping gil
Browse files Browse the repository at this point in the history
  • Loading branch information
emlowe committed Jan 31, 2025
1 parent e5dec07 commit 3f7d593
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python-bindings/chiapos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,12 @@ PYBIND11_MODULE(chiapos, m)

std::string proof_str(proof);
const uint8_t *proof_ptr = reinterpret_cast<const uint8_t *>(proof_str.data());
auto proof_size = len(proof);

LargeBits quality;
{
py::gil_scoped_release release;
quality = v.ValidateProof(seed_ptr, k, challenge_ptr, proof_ptr, len(proof));
quality = v.ValidateProof(seed_ptr, k, challenge_ptr, proof_ptr, proof_size);
}
if (quality.GetSize() == 0) {
return stdx::optional<py::bytes>();
Expand Down

0 comments on commit 3f7d593

Please sign in to comment.