4#include <gtest/gtest.h>
13TEST(secp256r1, CurveCoefficients)
22TEST(secp256r1, GeneratorOnCurve)
28 EXPECT_EQ(result.
x, expected_x);
29 EXPECT_EQ(result.
y, expected_y);
38TEST(secp256r1, AdditionSubtractionRegressionCheck)
49 EXPECT_EQ(fq1 + fq1,
fq2 +
fq2);
53#if defined(__SIZEOF_INT128__) && !defined(__wasm__)
54TEST(secp256r1, MontgomeryMulBigBug)
57 a.
data[0] = 0xC5BF4F6AFF993D09;
58 a.
data[1] = 0xA3361BDA67E62E0E;
59 a.
data[2] = 0xAAAAAAAAAAAAAAAA;
60 a.
data[3] = 0xFFFFFFFFE38E38E3;
62 secp256r1::fr expected(
uint256_t{ 0x57abc6aa0349c084, 0x65b21b232a4cb7a5, 0x5ba781948b0fcd6e, 0xd6e9e0644bda12f7 });
63 EXPECT_EQ((a_sqr == expected),
true);
67TEST(secp256r1, CheckPrecomputedGenerators)
69 ASSERT_TRUE((bb::check_precomputed_generators<secp256r1::g1, "biggroup offset generator", 1UL>()));
70 ASSERT_TRUE((bb::check_precomputed_generators<secp256r1::g1, "biggroup table offset generator", 1UL>()));
78GTEST_API_
int main(
int argc,
char** argv)
80 testing::InitGoogleTest(&argc, argv);
81 return RUN_ALL_TESTS();
int main(int argc, char **argv)
element class. Implements ecc group arithmetic using Jacobian coordinates See https://hyperelliptic....
BB_INLINE constexpr bool on_curve() const noexcept
static constexpr element one
Entry point for Barretenberg command-line interface.
field2< fq, Bn254Fq2Params > fq2
TEST(BoomerangMegaCircuitBuilder, BasicCircuit)
General class for prime fields see Prime field documentation["field documentation"] for general imple...
BB_INLINE constexpr field sqr() const noexcept
static constexpr uint256_t modulus_minus_two