|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
#include "barretenberg/stdlib/primitives/group/cycle_scalar.hpp"#include "barretenberg/circuit_checker/circuit_checker.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/transcript/origin_tag.hpp"#include <gtest/gtest.h>Go to the source code of this file.
Classes | |
| class | CycleScalarTest< Builder > |
Typedefs | |
| using | CircuitTypes = ::testing::Types< bb::UltraCircuitBuilder, bb::MegaCircuitBuilder > |
Functions | |
| TYPED_TEST_SUITE (CycleScalarTest, CircuitTypes) | |
| TYPED_TEST (CycleScalarTest, TestFromWitness) | |
| Test witness construction. | |
| TYPED_TEST (CycleScalarTest, TestFromU256Witness) | |
| Test construction from uint256_t witness. | |
| TYPED_TEST (CycleScalarTest, TestCreateFromBn254Scalar) | |
| Test creation from bn254 scalar field element. | |
| TYPED_TEST (CycleScalarTest, TestBigScalarFieldConstructor) | |
| Test cycle_scalar construction from BigScalarField. | |
| TYPED_TEST (CycleScalarTest, TestScalarFieldValidation) | |
| Test scalar field validation. | |
| TYPED_TEST (CycleScalarTest, TestScalarFieldValidationFailureBetweenModuli) | |
| Test expected scalar field validation failure with value between Grumpkin and BN254 moduli. | |
| TYPED_TEST (CycleScalarTest, TestBigScalarFieldConstructorEdgeCases) | |
| Test BigScalarField constructor with edge case values. | |
| using CircuitTypes = ::testing::Types<bb::UltraCircuitBuilder, bb::MegaCircuitBuilder> |
Definition at line 27 of file cycle_scalar.test.cpp.
| TYPED_TEST | ( | CycleScalarTest | , |
| TestBigScalarFieldConstructor | |||
| ) |
Test cycle_scalar construction from BigScalarField.
Definition at line 119 of file cycle_scalar.test.cpp.
| TYPED_TEST | ( | CycleScalarTest | , |
| TestBigScalarFieldConstructorEdgeCases | |||
| ) |
Test BigScalarField constructor with edge case values.
Definition at line 264 of file cycle_scalar.test.cpp.
| TYPED_TEST | ( | CycleScalarTest | , |
| TestCreateFromBn254Scalar | |||
| ) |
Test creation from bn254 scalar field element.
Definition at line 89 of file cycle_scalar.test.cpp.
| TYPED_TEST | ( | CycleScalarTest | , |
| TestFromU256Witness | |||
| ) |
Test construction from uint256_t witness.
Definition at line 63 of file cycle_scalar.test.cpp.
| TYPED_TEST | ( | CycleScalarTest | , |
| TestFromWitness | |||
| ) |
Test witness construction.
Definition at line 37 of file cycle_scalar.test.cpp.
| TYPED_TEST | ( | CycleScalarTest | , |
| TestScalarFieldValidation | |||
| ) |
Test scalar field validation.
Definition at line 169 of file cycle_scalar.test.cpp.
| TYPED_TEST | ( | CycleScalarTest | , |
| TestScalarFieldValidationFailureBetweenModuli | |||
| ) |
Test expected scalar field validation failure with value between Grumpkin and BN254 moduli.
This test creates a scalar with hi/lo decomposition that results in a value greater than BN254::fr modulus but less than BN254::fq modulus. (We construct the scalar directly from lo/hi components to bypass field reduction). We demonstrate that validation against Grumpkin scalar field (fq) passes, but validation against BN254 scalar field (fr) fails, as expected.
Definition at line 193 of file cycle_scalar.test.cpp.
| TYPED_TEST_SUITE | ( | CycleScalarTest | , |
| CircuitTypes | |||
| ) |