4#include <gtest/gtest.h>
12TEST(secp256k1, CurveCoefficients)
21TEST(secp256k1, GeneratorOnCurve)
27 EXPECT_EQ(result.
x, expected_x);
28 EXPECT_EQ(result.
y, expected_y);
32TEST(secp256k1, CheckPrecomputedGenerators)
34 ASSERT_TRUE((bb::check_precomputed_generators<secp256k1::g1, "biggroup offset generator", 1UL>()));
35 ASSERT_TRUE((bb::check_precomputed_generators<secp256k1::g1, "biggroup table offset generator", 1UL>()));
38TEST(secp256k1, GetEndomorphismScalars)
40 for (
size_t i = 0; i < 2048; i++) {
71 EXPECT_EQ(k, expected);
78TEST(secp256k1, TestEndomorphismScalars)
108 static const uint256_t secp256k1_const_lambda{
109 0xDF02967C1B23BD72ULL, 0x122E22EA20816678UL, 0xA5261C028812645AULL, 0x5363AD4CC05C30E0ULL
115 EXPECT_EQ(k, expected);
118TEST(secp256k1, NegAndSelfNeg0CmpRegression)
122 EXPECT_EQ((
a == a_neg),
true);
126 EXPECT_EQ((
a == a_neg),
true);
129TEST(secp256k1, MontgomeryMulBigBug)
134 EXPECT_EQ((a_sqr == expected),
true);
element class. Implements ecc group arithmetic using Jacobian coordinates See https://hyperelliptic....
BB_INLINE constexpr bool on_curve() const noexcept
static constexpr element one
constexpr uint64_t get_msb() const
Entry point for Barretenberg command-line interface.
TEST(BoomerangMegaCircuitBuilder, BasicCircuit)
General class for prime fields see Prime field documentation["field documentation"] for general imple...
static constexpr field cube_root_of_unity()
static void split_into_endomorphism_scalars(const field &k, field &k1, field &k2)
Full-width endomorphism decomposition: k ≡ k1 - k2·λ (mod r). Modifies the field elements k1 and k2.
BB_INLINE constexpr void self_neg() &noexcept
static field random_element(numeric::RNG *engine=nullptr) noexcept
BB_INLINE constexpr field sqr() const noexcept
constexpr uint256_t uint256_t_no_montgomery_conversion() const noexcept
BB_INLINE constexpr void self_from_montgomery_form() &noexcept
BB_INLINE constexpr void self_to_montgomery_form() &noexcept