Skip to content
Merged
Show file tree
Hide file tree
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: 3 additions & 0 deletions lib/evmone_precompiles/bn254.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ struct E2
{
using Fp = Fq2;
static constexpr auto A = 0;
/// b/ξ, i.e. Curve::B divided by the Fq⁶ non-residue ξ.
static constexpr Fp B{0x2b149d40ceb8aaae81be18991be06ac3b5b4c5e559dbefa33267e6dc24a138e5_u256,
0x9713b03af0fed4cd2cafadeed8fdf4a74fa084e52d1852e4a2bd0685c315d2_u256};
};

using ExtPoint = ecc::AffinePoint<E2>;
Expand Down
4 changes: 0 additions & 4 deletions lib/evmone_precompiles/pairing/bn254/fields.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ struct Fq6Config
using ValueT = Fq2;
static constexpr uint8_t DEGREE = 3;
static constexpr auto ksi = Fq2({Fq(9_u256), Fq(1_u256)});
static constexpr auto _3_ksi_inv = Fq2({
Fq(0x2b149d40ceb8aaae81be18991be06ac3b5b4c5e559dbefa33267e6dc24a138e5_u256),
Fq(0x9713b03af0fed4cd2cafadeed8fdf4a74fa084e52d1852e4a2bd0685c315d2_u256),
});
};
using Fq6 = ecc::ExtFieldElem<Fq6Config>;

Expand Down
2 changes: 1 addition & 1 deletion lib/evmone_precompiles/pairing/bn254/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ constexpr bool is_on_twisted_curve(const ecc::AffinePoint<E2>& p)
const auto x3 = p.x * p.x * p.x;
const auto y2 = p.y * p.y;

return y2 == x3 + Fq6Config::_3_ksi_inv;
return y2 == x3 + E2::B;
}

// Frobenius endomorphism related functions are implemented based on
Expand Down