Barretenberg
The ZK-SNARK library at the core of Aztec
|
#include "barretenberg/stdlib/primitives/group/cycle_group.hpp"
#include "barretenberg/circuit_checker/circuit_checker.hpp"
#include "barretenberg/common/ref_span.hpp"
#include "barretenberg/crypto/pedersen_commitment/pedersen.hpp"
#include "barretenberg/crypto/pedersen_hash/pedersen.hpp"
#include "barretenberg/numeric/random/engine.hpp"
#include "barretenberg/stdlib/primitives/bigfield/bigfield.hpp"
#include "barretenberg/stdlib/primitives/field/field.hpp"
#include "barretenberg/stdlib/primitives/witness/witness.hpp"
#include "barretenberg/stdlib_circuit_builders/plookup_tables/fixed_base/fixed_base.hpp"
#include "barretenberg/transcript/origin_tag.hpp"
#include <gtest/gtest.h>
Go to the source code of this file.
Classes | |
class | CycleGroupTest< Builder > |
Macros | |
#define | STDLIB_TYPE_ALIASES |
Typedefs | |
using | CircuitTypes = ::testing::Types< bb::UltraCircuitBuilder > |
Functions | |
TYPED_TEST_SUITE (CycleGroupTest, CircuitTypes) | |
STANDARD_TESTING_TAGS | TYPED_TEST (CycleGroupTest, TestBasicTagLogic) |
Check basic tag interactions. | |
TYPED_TEST (CycleGroupTest, TestInfConstantWintnessRegression) | |
Checks that a point at infinity passes the constant_witness initialization. | |
TYPED_TEST (CycleGroupTest, TestInfWintnessRegression) | |
Checks that a point at infinity passes the witness initialization. | |
TYPED_TEST (CycleGroupTest, TestWitnessSumRegression) | |
Checks that the result of adding two witness values is not constant. | |
TYPED_TEST (CycleGroupTest, TestOperatorNegRegression) | |
Checks that adding operator-(value) to an existing value does not result into error. | |
TYPED_TEST (CycleGroupTest, TestConstantWitnessMixupRegression) | |
Checks the mixup bad behavior found by fuzzer. | |
TYPED_TEST (CycleGroupTest, TestConditionalAssignRegression) | |
Checks the bad behavior of conditional assign. | |
TYPED_TEST (CycleGroupTest, TestConditionalAssignSuperMixupRegression) | |
Checks the bad behavior of conditional assign. | |
TYPED_TEST (CycleGroupTest, TestValidateOnCurveSucceed) | |
Checks that a point on the curve passes the validate_is_on_curve check. | |
TYPED_TEST (CycleGroupTest, TestValidateOnCurveInfinitySucceed) | |
Checks that a point that is not on the curve but marked as the point at infinity passes the validate_is_on_curve check. | |
TYPED_TEST (CycleGroupTest, TestValidateOnCurveFail) | |
Checks that a point that is not on the curve but not marked as the point at infinity fails the validate_is_on_curve check. | |
TYPED_TEST (CycleGroupTest, TestValidateOnCurveFail2) | |
Checks that a point that is not on the curve but not marked as the point at infinity fails the validate_is_on_curve check. | |
TYPED_TEST (CycleGroupTest, TestStandardForm) | |
TYPED_TEST (CycleGroupTest, TestDbl) | |
TYPED_TEST (CycleGroupTest, TestUnconditionalAdd) | |
TYPED_TEST (CycleGroupTest, TestConstrainedUnconditionalAddSucceed) | |
TYPED_TEST (CycleGroupTest, TestConstrainedUnconditionalAddFail) | |
TYPED_TEST (CycleGroupTest, TestAdd) | |
TYPED_TEST (CycleGroupTest, TestUnconditionalSubtract) | |
TYPED_TEST (CycleGroupTest, TestConstrainedUnconditionalSubtractSucceed) | |
TYPED_TEST (CycleGroupTest, TestConstrainedUnconditionalSubtractFail) | |
TYPED_TEST (CycleGroupTest, TestSubtract) | |
TYPED_TEST (CycleGroupTest, TestBatchMul) | |
TYPED_TEST (CycleGroupTest, TestMul) | |
TYPED_TEST (CycleGroupTest, TestOne) | |
TYPED_TEST (CycleGroupTest, TestConversionFromBigfield) | |
Ensures naive conversion from a bigfield representation of bb::fq (Grumpkin::ScalarField) to cycle_scalar preserves the same value until we implement a smarter function. | |
TYPED_TEST (CycleGroupTest, TestBatchMulIsConsistent) | |
#define STDLIB_TYPE_ALIASES |
Definition at line 14 of file cycle_group.test.cpp.
using CircuitTypes = ::testing::Types<bb::UltraCircuitBuilder> |
Definition at line 53 of file cycle_group.test.cpp.
TYPED_TEST | ( | CycleGroupTest | , |
TestAdd | |||
) |
Definition at line 472 of file cycle_group.test.cpp.
STANDARD_TESTING_TAGS TYPED_TEST | ( | CycleGroupTest | , |
TestBasicTagLogic | |||
) |
Check basic tag interactions.
Definition at line 61 of file cycle_group.test.cpp.
TYPED_TEST | ( | CycleGroupTest | , |
TestBatchMul | |||
) |
Assign different tags to all points and scalars and return the union of that tag
We assign the tags with the same round index to a (point,scalar) pair, but the point is treated as submitted value, while scalar as a challenge. Merging these tags should not run into any edgecases
Definition at line 736 of file cycle_group.test.cpp.
TYPED_TEST | ( | CycleGroupTest | , |
TestBatchMulIsConsistent | |||
) |
Definition at line 1053 of file cycle_group.test.cpp.
TYPED_TEST | ( | CycleGroupTest | , |
TestConditionalAssignRegression | |||
) |
Checks the bad behavior of conditional assign.
Definition at line 185 of file cycle_group.test.cpp.
TYPED_TEST | ( | CycleGroupTest | , |
TestConditionalAssignSuperMixupRegression | |||
) |
Checks the bad behavior of conditional assign.
Definition at line 201 of file cycle_group.test.cpp.
TYPED_TEST | ( | CycleGroupTest | , |
TestConstantWitnessMixupRegression | |||
) |
Checks the mixup bad behavior found by fuzzer.
Definition at line 162 of file cycle_group.test.cpp.
TYPED_TEST | ( | CycleGroupTest | , |
TestConstrainedUnconditionalAddFail | |||
) |
Definition at line 453 of file cycle_group.test.cpp.
TYPED_TEST | ( | CycleGroupTest | , |
TestConstrainedUnconditionalAddSucceed | |||
) |
Definition at line 433 of file cycle_group.test.cpp.
TYPED_TEST | ( | CycleGroupTest | , |
TestConstrainedUnconditionalSubtractFail | |||
) |
Definition at line 618 of file cycle_group.test.cpp.
TYPED_TEST | ( | CycleGroupTest | , |
TestConstrainedUnconditionalSubtractSucceed | |||
) |
Definition at line 598 of file cycle_group.test.cpp.
TYPED_TEST | ( | CycleGroupTest | , |
TestConversionFromBigfield | |||
) |
Ensures naive conversion from a bigfield representation of bb::fq (Grumpkin::ScalarField) to cycle_scalar preserves the same value until we implement a smarter function.
Definition at line 1024 of file cycle_group.test.cpp.
TYPED_TEST | ( | CycleGroupTest | , |
TestDbl | |||
) |
Definition at line 372 of file cycle_group.test.cpp.
TYPED_TEST | ( | CycleGroupTest | , |
TestInfConstantWintnessRegression | |||
) |
Checks that a point at infinity passes the constant_witness initialization.
Definition at line 91 of file cycle_group.test.cpp.
TYPED_TEST | ( | CycleGroupTest | , |
TestInfWintnessRegression | |||
) |
Checks that a point at infinity passes the witness initialization.
Definition at line 107 of file cycle_group.test.cpp.
TYPED_TEST | ( | CycleGroupTest | , |
TestMul | |||
) |
Definition at line 962 of file cycle_group.test.cpp.
TYPED_TEST | ( | CycleGroupTest | , |
TestOne | |||
) |
Definition at line 1008 of file cycle_group.test.cpp.
TYPED_TEST | ( | CycleGroupTest | , |
TestOperatorNegRegression | |||
) |
Checks that adding operator-(value) to an existing value does not result into error.
Definition at line 142 of file cycle_group.test.cpp.
TYPED_TEST | ( | CycleGroupTest | , |
TestStandardForm | |||
) |
Definition at line 290 of file cycle_group.test.cpp.
TYPED_TEST | ( | CycleGroupTest | , |
TestSubtract | |||
) |
Definition at line 637 of file cycle_group.test.cpp.
TYPED_TEST | ( | CycleGroupTest | , |
TestUnconditionalAdd | |||
) |
Definition at line 404 of file cycle_group.test.cpp.
TYPED_TEST | ( | CycleGroupTest | , |
TestUnconditionalSubtract | |||
) |
Definition at line 568 of file cycle_group.test.cpp.
TYPED_TEST | ( | CycleGroupTest | , |
TestValidateOnCurveFail | |||
) |
Checks that a point that is not on the curve but not marked as the point at infinity fails the validate_is_on_curve check.
(1, 1) is not on the either the Grumpkin curve or the BN254 curve.
Definition at line 257 of file cycle_group.test.cpp.
TYPED_TEST | ( | CycleGroupTest | , |
TestValidateOnCurveFail2 | |||
) |
Checks that a point that is not on the curve but not marked as the point at infinity fails the validate_is_on_curve check.
(1, 1) is not on the either the Grumpkin curve or the BN254 curve.
Definition at line 276 of file cycle_group.test.cpp.
TYPED_TEST | ( | CycleGroupTest | , |
TestValidateOnCurveInfinitySucceed | |||
) |
Checks that a point that is not on the curve but marked as the point at infinity passes the validate_is_on_curve check.
Should pass since marking it with _is_infinity=true makes whatever other point data invalid.
Definition at line 238 of file cycle_group.test.cpp.
TYPED_TEST | ( | CycleGroupTest | , |
TestValidateOnCurveSucceed | |||
) |
Checks that a point on the curve passes the validate_is_on_curve check.
Definition at line 221 of file cycle_group.test.cpp.
TYPED_TEST | ( | CycleGroupTest | , |
TestWitnessSumRegression | |||
) |
Checks that the result of adding two witness values is not constant.
Definition at line 123 of file cycle_group.test.cpp.
TYPED_TEST_SUITE | ( | CycleGroupTest | , |
CircuitTypes | |||
) |