|
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/test_utils.hpp"#include "barretenberg/stdlib/primitives/witness/witness.hpp"#include "barretenberg/stdlib_circuit_builders/mega_circuit_builder.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, bb::MegaCircuitBuilder > |
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_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_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_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_on_curve check. | |
| TYPED_TEST (CycleGroupTest, TestStandardForm) | |
| TYPED_TEST (CycleGroupTest, TestDbl) | |
| TYPED_TEST (CycleGroupTest, TestDblNonConstantPoints) | |
| TYPED_TEST (CycleGroupTest, TestDblConstantPoints) | |
| TYPED_TEST (CycleGroupTest, TestDblMixedConstantWitness) | |
| TYPED_TEST (CycleGroupTest, TestUnconditionalAddNonConstantPoints) | |
| TYPED_TEST (CycleGroupTest, TestUnconditionalAddConstantPoints) | |
| TYPED_TEST (CycleGroupTest, TestUnconditionalSubtractNonConstantPoints) | |
| TYPED_TEST (CycleGroupTest, TestUnconditionalSubtractConstantPoints) | |
| TYPED_TEST (CycleGroupTest, TestUnconditionalAdd) | |
| TYPED_TEST (CycleGroupTest, TestConstrainedUnconditionalAddSucceed) | |
| TYPED_TEST (CycleGroupTest, TestConstrainedUnconditionalAddFail) | |
| TYPED_TEST (CycleGroupTest, TestAddRegular) | |
| TYPED_TEST (CycleGroupTest, TestAddLhsInfinity) | |
| TYPED_TEST (CycleGroupTest, TestAddRhsInfinity) | |
| TYPED_TEST (CycleGroupTest, TestAddBothInfinity) | |
| TYPED_TEST (CycleGroupTest, TestAddInversePoints) | |
| TYPED_TEST (CycleGroupTest, TestAddDoubling) | |
| TYPED_TEST (CycleGroupTest, TestAddConstantPoints) | |
| TYPED_TEST (CycleGroupTest, TestAddMixedConstantWitness) | |
| TYPED_TEST (CycleGroupTest, TestAddInfinityResultLogic) | |
| TYPED_TEST (CycleGroupTest, TestUnconditionalSubtract) | |
| TYPED_TEST (CycleGroupTest, TestConstrainedUnconditionalSubtractSucceed) | |
| TYPED_TEST (CycleGroupTest, TestConstrainedUnconditionalSubtractFail) | |
| TYPED_TEST (CycleGroupTest, TestSubtract) | |
| TYPED_TEST (CycleGroupTest, TestSubtractConstantPoints) | |
| template<typename T1 , typename T2 > | |
| auto | assign_and_merge_tags (T1 &points, T2 &scalars) |
| Assign different tags to all points and scalars and return the union of that tag. | |
| TYPED_TEST (CycleGroupTest, TestBatchMulGeneralMSM) | |
| TYPED_TEST (CycleGroupTest, TestBatchMulProducesInfinity) | |
| TYPED_TEST (CycleGroupTest, TestBatchMulMultiplyByZero) | |
| TYPED_TEST (CycleGroupTest, TestBatchMulInputsAreInfinity) | |
| TYPED_TEST (CycleGroupTest, TestBatchMulFixedBaseInLookupTable) | |
| TYPED_TEST (CycleGroupTest, TestBatchMulFixedBaseSomeInLookupTable) | |
| TYPED_TEST (CycleGroupTest, TestBatchMulFixedBaseZeroScalars) | |
| 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) | |
| TYPED_TEST (CycleGroupTest, MixedLengthScalarsIsNotSupported) | |
| Temporary debugging test demonstrating that batch_mul with scalars of different bit lengths is not supported. | |
| TYPED_TEST (CycleGroupTest, TestFixedBaseBatchMul) | |
| Test fixed-base batch multiplication via the public batch_mul interface. | |
| #define STDLIB_TYPE_ALIASES |
Definition at line 16 of file cycle_group.test.cpp.
| using CircuitTypes = ::testing::Types<bb::UltraCircuitBuilder, bb::MegaCircuitBuilder> |
Definition at line 55 of file cycle_group.test.cpp.
| auto assign_and_merge_tags | ( | T1 & | points, |
| T2 & | scalars | ||
| ) |
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 1388 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| MixedLengthScalarsIsNotSupported | |||
| ) |
Temporary debugging test demonstrating that batch_mul with scalars of different bit lengths is not supported.
Definition at line 1814 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestAddBothInfinity | |||
| ) |
Definition at line 921 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestAddConstantPoints | |||
| ) |
Definition at line 993 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestAddDoubling | |||
| ) |
Definition at line 971 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestAddInfinityResultLogic | |||
| ) |
Definition at line 1080 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestAddInversePoints | |||
| ) |
Definition at line 948 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestAddLhsInfinity | |||
| ) |
Definition at line 870 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestAddMixedConstantWitness | |||
| ) |
Definition at line 1035 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestAddRegular | |||
| ) |
Definition at line 845 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestAddRhsInfinity | |||
| ) |
Definition at line 895 of file cycle_group.test.cpp.
| STANDARD_TESTING_TAGS TYPED_TEST | ( | CycleGroupTest | , |
| TestBasicTagLogic | |||
| ) |
Check basic tag interactions.
Definition at line 66 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestBatchMulFixedBaseInLookupTable | |||
| ) |
Definition at line 1551 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestBatchMulFixedBaseSomeInLookupTable | |||
| ) |
Definition at line 1589 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestBatchMulFixedBaseZeroScalars | |||
| ) |
Definition at line 1639 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestBatchMulGeneralMSM | |||
| ) |
Definition at line 1402 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestBatchMulInputsAreInfinity | |||
| ) |
Definition at line 1513 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestBatchMulIsConsistent | |||
| ) |
Definition at line 1764 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestBatchMulMultiplyByZero | |||
| ) |
Definition at line 1486 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestBatchMulProducesInfinity | |||
| ) |
Definition at line 1454 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestConditionalAssignRegression | |||
| ) |
Checks the bad behavior of conditional assign.
Definition at line 190 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestConditionalAssignSuperMixupRegression | |||
| ) |
Checks the bad behavior of conditional assign.
Definition at line 206 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestConstantWitnessMixupRegression | |||
| ) |
Checks the mixup bad behavior found by fuzzer.
Definition at line 167 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestConstrainedUnconditionalAddFail | |||
| ) |
Definition at line 825 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestConstrainedUnconditionalAddSucceed | |||
| ) |
Definition at line 806 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestConstrainedUnconditionalSubtractFail | |||
| ) |
Definition at line 1207 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestConstrainedUnconditionalSubtractSucceed | |||
| ) |
Definition at line 1188 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 1735 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestDbl | |||
| ) |
Definition at line 381 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestDblConstantPoints | |||
| ) |
Definition at line 468 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestDblMixedConstantWitness | |||
| ) |
Definition at line 542 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestDblNonConstantPoints | |||
| ) |
Definition at line 410 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestFixedBaseBatchMul | |||
| ) |
Test fixed-base batch multiplication via the public batch_mul interface.
Tests that the fixed-base MSM works correctly for the two supported Pedersen generators
Definition at line 1851 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestInfConstantWintnessRegression | |||
| ) |
Checks that a point at infinity passes the constant_witness initialization.
Definition at line 96 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestInfWintnessRegression | |||
| ) |
Checks that a point at infinity passes the witness initialization.
Definition at line 112 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestMul | |||
| ) |
Definition at line 1669 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestOne | |||
| ) |
Definition at line 1719 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 147 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestStandardForm | |||
| ) |
Definition at line 301 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestSubtract | |||
| ) |
Definition at line 1225 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestSubtractConstantPoints | |||
| ) |
Definition at line 1323 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestUnconditionalAdd | |||
| ) |
Definition at line 778 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestUnconditionalAddConstantPoints | |||
| ) |
Definition at line 628 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestUnconditionalAddNonConstantPoints | |||
| ) |
Definition at line 567 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestUnconditionalSubtract | |||
| ) |
Definition at line 1159 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestUnconditionalSubtractConstantPoints | |||
| ) |
Definition at line 734 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestUnconditionalSubtractNonConstantPoints | |||
| ) |
Definition at line 672 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_on_curve check.
(1, 1) is not on the either the Grumpkin curve or the BN254 curve.
Definition at line 266 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_on_curve check.
(1, 1) is not on the either the Grumpkin curve or the BN254 curve.
Definition at line 286 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_on_curve check.
Should pass since marking it with _is_infinity=true makes whatever other point data invalid.
Definition at line 247 of file cycle_group.test.cpp.
| TYPED_TEST | ( | CycleGroupTest | , |
| TestValidateOnCurveSucceed | |||
| ) |
Checks that a point on the curve passes the validate_on_curve check.
Definition at line 226 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 128 of file cycle_group.test.cpp.
| TYPED_TEST_SUITE | ( | CycleGroupTest | , |
| CircuitTypes | |||
| ) |