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 UB in blst aggregate verify #1107

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion crypto/vm/bls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,13 @@ bool aggregate_verify(const std::vector<std::pair<P1, td::BufferSlice>> &pubs_ms
return false;
}
std::unique_ptr<blst::Pairing> pairing = std::make_unique<blst::Pairing>(true, DST);
blst::P2_Affine p2_zero;
for (const auto &p : pubs_msgs) {
blst::P1_Affine p1(p.first.data(), P1_SIZE);
if (!p1.in_group() || p1.is_inf()) {
return false;
}
pairing->aggregate(&p1, nullptr, (const td::uint8 *)p.second.data(), p.second.size());
pairing->aggregate(&p1, &p2_zero, (const td::uint8 *)p.second.data(), p.second.size());
}
pairing->commit();
blst::P2_Affine p2(sig.data(), P2_SIZE);
Expand Down
Loading