Skip to content

Commit

Permalink
opt: uncompress C and Q next to each other
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Aug 16, 2024
1 parent 4073387 commit 1f75663
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/evmone_precompiles/kzg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,18 @@ bool kzg_proof(const std::byte versioned_hash[32], const std::byte z[32], const
if (ret != blst::BLST_SUCCESS)
return false;

blst::blst_p1_affine Q;
const auto r2 = blst::blst_p1_uncompress(&Q, reinterpret_cast<const blst::byte*>(proof));
if (r2 != blst::BLST_SUCCESS)
return false;

blst::blst_p1 P_minus_y;
// FIXME: add_or_double?
blst::blst_p1_add_affine(&P_minus_y, &nY, &affine_C);

const auto Pmy = std::bit_cast<blst::P1>(P_minus_y);
const blst::PT left(blst::P1_Affine{Pmy});

blst::blst_p1_affine Q;
const auto r2 = blst::blst_p1_uncompress(&Q, reinterpret_cast<const blst::byte*>(proof));
if (r2 != blst::BLST_SUCCESS)
return false;

const blst::PT right(
std::bit_cast<blst::P1_Affine>(Q), blst::P2_Affine{std::bit_cast<blst::P2>(X_minus_Z)});

Expand Down

0 comments on commit 1f75663

Please sign in to comment.