Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
stdlib_biggroup< TestType > Class Template Reference
Inheritance diagram for stdlib_biggroup< TestType >:

Public Types

using Curve = typename TestType::Curve
 
using element_ct = typename TestType::element_ct
 
using scalar_ct = typename TestType::scalar_ct
 
using fq = typename Curve::BaseFieldNative
 
using fr = typename Curve::ScalarFieldNative
 
using g1 = typename Curve::GroupNative
 
using affine_element = typename g1::affine_element
 
using element = typename g1::element
 
using Builder = typename Curve::Builder
 
using witness_ct = stdlib::witness_t< Builder >
 
using bool_ct = stdlib::bool_t< Builder >
 
using field_ct = stdlib::field_t< Builder >
 

Static Public Member Functions

static std::pair< affine_element, element_ctget_random_witness_point (Builder *builder)
 
static std::pair< affine_element, element_ctget_random_constant_point (Builder *builder)
 
static std::pair< affine_element, element_ctget_random_point (Builder *builder, InputType type)
 
static std::pair< fr, scalar_ctget_random_witness_scalar (Builder *builder, bool even=false)
 
static std::pair< fr, scalar_ctget_random_constant_scalar (Builder *builder, bool even=false)
 
static std::pair< fr, scalar_ctget_random_scalar (Builder *builder, InputType type, bool even=false)
 
static std::pair< fr, scalar_ctget_random_short_scalar (Builder *builder, InputType type, size_t num_bits)
 
static void test_basic_tag_logic ()
 
static void test_assert_coordinates_in_field ()
 
static void test_add (InputType a_type=InputType::WITNESS, InputType b_type=InputType::WITNESS)
 
static void test_add_assign (InputType a_type=InputType::WITNESS, InputType b_type=InputType::WITNESS)
 
static void test_add_points_at_infinity ()
 
static void test_standard_form_of_point_at_infinity ()
 Check that converting a point at infinity into standard form ensures the coordinates are zeroes.
 
static void test_sub (InputType a_type=InputType::WITNESS, InputType b_type=InputType::WITNESS)
 
static void test_sub_assign (InputType a_type=InputType::WITNESS, InputType b_type=InputType::WITNESS)
 
static void test_sub_points_at_infinity ()
 
static void test_checked_unconditional_add (InputType a_type=InputType::WITNESS, InputType b_type=InputType::WITNESS)
 
static void test_checked_unconditional_subtract (InputType a_type=InputType::WITNESS, InputType b_type=InputType::WITNESS)
 
static void test_checked_unconditional_add_sub (InputType a_type=InputType::WITNESS, InputType b_type=InputType::WITNESS)
 
static void test_dbl (InputType a_type=InputType::WITNESS)
 
static void test_dbl_with_infinity ()
 
static void test_dbl_with_y_zero ()
 
static void test_add_equals_dbl ()
 
static void test_sub_neg_equals_double ()
 
static void test_chain_add (InputType a_type=InputType::WITNESS, InputType b_type=InputType::WITNESS, InputType c_type=InputType::WITNESS)
 
static void test_multiple_montgomery_ladder ()
 
static void test_normalize (InputType point_type=InputType::WITNESS)
 
static void test_reduce (InputType point_type=InputType::WITNESS)
 
static void test_unary_negate (InputType a_type=InputType::WITNESS)
 
static void test_conditional_negate (InputType point_type=InputType::WITNESS, InputType predicate_type=InputType::WITNESS)
 
static void test_conditional_select (InputType a_type=InputType::WITNESS, InputType b_type=InputType::WITNESS, InputType predicate_type=InputType::WITNESS)
 
static void test_incomplete_assert_equal ()
 
static void test_incomplete_assert_equal_failure ()
 
static void test_incomplete_assert_equal_edge_cases ()
 
static void test_compute_naf ()
 
static void test_compute_naf_zero ()
 
static void test_compute_naf_overflow_lower_half ()
 
static void test_mul (InputType scalar_type=InputType::WITNESS, InputType point_type=InputType::WITNESS)
 
static void test_mul_edge_cases (InputType scalar_type=InputType::WITNESS, InputType point_type=InputType::WITNESS)
 
static void test_short_scalar_mul_with_bit_lengths ()
 
static void test_short_scalar_mul_infinity ()
 
static void test_twin_mul ()
 
static void test_twin_mul_with_infinity ()
 
static void test_batch_mul_linearly_dependent_generators ()
 
static void test_batch_mul_linearly_dependent_generators_failure ()
 
static void test_one ()
 
static void test_helper_batch_mul (size_t num_points, const bool short_scalars=false, const bool with_edgecases=false)
 
static void test_helper_batch_mul (std::vector< InputType > point_types, std::vector< InputType > scalar_types, const bool short_scalars=false, const bool with_edgecases=false)
 
static void test_batch_mul ()
 
static void test_batch_mul_edgecase_equivalence ()
 
static void test_batch_mul_edge_case_set1 ()
 
static void test_batch_mul_edge_case_set2 ()
 
static void test_batch_mul_all_infinity ()
 
static void test_batch_mul_all_zero_scalars ()
 
static void test_batch_mul_mixed_zero_scalars ()
 
static void test_batch_mul_mixed_infinity ()
 
static void test_batch_mul_cancellation ()
 
static void test_batch_mul_mixed_constant_witness ()
 
static void test_batch_mul_large_number_of_points ()
 

Static Public Attributes

static constexpr auto EXPECT_CIRCUIT_CORRECTNESS
 

Detailed Description

template<typename TestType>
class stdlib_biggroup< TestType >

Definition at line 51 of file biggroup.test.cpp.

Member Typedef Documentation

◆ affine_element

template<typename TestType >
using stdlib_biggroup< TestType >::affine_element = typename g1::affine_element

Definition at line 60 of file biggroup.test.cpp.

◆ bool_ct

template<typename TestType >
using stdlib_biggroup< TestType >::bool_ct = stdlib::bool_t<Builder>

Definition at line 65 of file biggroup.test.cpp.

◆ Builder

template<typename TestType >
using stdlib_biggroup< TestType >::Builder = typename Curve::Builder

Definition at line 63 of file biggroup.test.cpp.

◆ Curve

template<typename TestType >
using stdlib_biggroup< TestType >::Curve = typename TestType::Curve

Definition at line 53 of file biggroup.test.cpp.

◆ element

template<typename TestType >
using stdlib_biggroup< TestType >::element = typename g1::element

Definition at line 61 of file biggroup.test.cpp.

◆ element_ct

template<typename TestType >
using stdlib_biggroup< TestType >::element_ct = typename TestType::element_ct

Definition at line 54 of file biggroup.test.cpp.

◆ field_ct

Definition at line 66 of file biggroup.test.cpp.

◆ fq

template<typename TestType >
using stdlib_biggroup< TestType >::fq = typename Curve::BaseFieldNative

Definition at line 57 of file biggroup.test.cpp.

◆ fr

template<typename TestType >
using stdlib_biggroup< TestType >::fr = typename Curve::ScalarFieldNative

Definition at line 58 of file biggroup.test.cpp.

◆ g1

template<typename TestType >
using stdlib_biggroup< TestType >::g1 = typename Curve::GroupNative

Definition at line 59 of file biggroup.test.cpp.

◆ scalar_ct

template<typename TestType >
using stdlib_biggroup< TestType >::scalar_ct = typename TestType::scalar_ct

Definition at line 55 of file biggroup.test.cpp.

◆ witness_ct

Definition at line 64 of file biggroup.test.cpp.

Member Function Documentation

◆ get_random_constant_point()

template<typename TestType >
static std::pair< affine_element, element_ct > stdlib_biggroup< TestType >::get_random_constant_point ( Builder builder)
inlinestatic

Definition at line 82 of file biggroup.test.cpp.

◆ get_random_constant_scalar()

template<typename TestType >
static std::pair< fr, scalar_ct > stdlib_biggroup< TestType >::get_random_constant_scalar ( Builder builder,
bool  even = false 
)
inlinestatic

Definition at line 114 of file biggroup.test.cpp.

◆ get_random_point()

template<typename TestType >
static std::pair< affine_element, element_ct > stdlib_biggroup< TestType >::get_random_point ( Builder builder,
InputType  type 
)
inlinestatic

Definition at line 94 of file biggroup.test.cpp.

◆ get_random_scalar()

template<typename TestType >
static std::pair< fr, scalar_ct > stdlib_biggroup< TestType >::get_random_scalar ( Builder builder,
InputType  type,
bool  even = false 
)
inlinestatic

Definition at line 125 of file biggroup.test.cpp.

◆ get_random_short_scalar()

template<typename TestType >
static std::pair< fr, scalar_ct > stdlib_biggroup< TestType >::get_random_short_scalar ( Builder builder,
InputType  type,
size_t  num_bits 
)
inlinestatic

Definition at line 133 of file biggroup.test.cpp.

◆ get_random_witness_point()

template<typename TestType >
static std::pair< affine_element, element_ct > stdlib_biggroup< TestType >::get_random_witness_point ( Builder builder)
inlinestatic

Definition at line 74 of file biggroup.test.cpp.

◆ get_random_witness_scalar()

template<typename TestType >
static std::pair< fr, scalar_ct > stdlib_biggroup< TestType >::get_random_witness_scalar ( Builder builder,
bool  even = false 
)
inlinestatic

Definition at line 103 of file biggroup.test.cpp.

◆ test_add()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_add ( InputType  a_type = InputType::WITNESS,
InputType  b_type = InputType::WITNESS 
)
inlinestatic

Definition at line 265 of file biggroup.test.cpp.

◆ test_add_assign()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_add_assign ( InputType  a_type = InputType::WITNESS,
InputType  b_type = InputType::WITNESS 
)
inlinestatic

Definition at line 302 of file biggroup.test.cpp.

◆ test_add_equals_dbl()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_add_equals_dbl ( )
inlinestatic

Definition at line 698 of file biggroup.test.cpp.

◆ test_add_points_at_infinity()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_add_points_at_infinity ( )
inlinestatic

Definition at line 323 of file biggroup.test.cpp.

◆ test_assert_coordinates_in_field()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_assert_coordinates_in_field ( )
inlinestatic

Definition at line 196 of file biggroup.test.cpp.

◆ test_basic_tag_logic()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_basic_tag_logic ( )
inlinestatic

Definition at line 149 of file biggroup.test.cpp.

◆ test_batch_mul()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_batch_mul ( )
inlinestatic

Definition at line 1708 of file biggroup.test.cpp.

◆ test_batch_mul_all_infinity()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_batch_mul_all_infinity ( )
inlinestatic

Definition at line 1973 of file biggroup.test.cpp.

◆ test_batch_mul_all_zero_scalars()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_batch_mul_all_zero_scalars ( )
inlinestatic

Definition at line 2000 of file biggroup.test.cpp.

◆ test_batch_mul_cancellation()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_batch_mul_cancellation ( )
inlinestatic

Definition at line 2107 of file biggroup.test.cpp.

◆ test_batch_mul_edge_case_set1()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_batch_mul_edge_case_set1 ( )
inlinestatic

Definition at line 1808 of file biggroup.test.cpp.

◆ test_batch_mul_edge_case_set2()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_batch_mul_edge_case_set2 ( )
inlinestatic

Definition at line 1869 of file biggroup.test.cpp.

◆ test_batch_mul_edgecase_equivalence()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_batch_mul_edgecase_equivalence ( )
inlinestatic

Definition at line 1757 of file biggroup.test.cpp.

◆ test_batch_mul_large_number_of_points()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_batch_mul_large_number_of_points ( )
inlinestatic

Definition at line 2223 of file biggroup.test.cpp.

◆ test_batch_mul_linearly_dependent_generators()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_batch_mul_linearly_dependent_generators ( )
inlinestatic

Definition at line 1485 of file biggroup.test.cpp.

◆ test_batch_mul_linearly_dependent_generators_failure()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_batch_mul_linearly_dependent_generators_failure ( )
inlinestatic

Definition at line 1555 of file biggroup.test.cpp.

◆ test_batch_mul_mixed_constant_witness()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_batch_mul_mixed_constant_witness ( )
inlinestatic

Definition at line 2156 of file biggroup.test.cpp.

◆ test_batch_mul_mixed_infinity()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_batch_mul_mixed_infinity ( )
inlinestatic

Definition at line 2066 of file biggroup.test.cpp.

◆ test_batch_mul_mixed_zero_scalars()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_batch_mul_mixed_zero_scalars ( )
inlinestatic

Definition at line 2027 of file biggroup.test.cpp.

◆ test_chain_add()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_chain_add ( InputType  a_type = InputType::WITNESS,
InputType  b_type = InputType::WITNESS,
InputType  c_type = InputType::WITNESS 
)
inlinestatic

Definition at line 746 of file biggroup.test.cpp.

◆ test_checked_unconditional_add()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_checked_unconditional_add ( InputType  a_type = InputType::WITNESS,
InputType  b_type = InputType::WITNESS 
)
inlinestatic

Definition at line 532 of file biggroup.test.cpp.

◆ test_checked_unconditional_add_sub()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_checked_unconditional_add_sub ( InputType  a_type = InputType::WITNESS,
InputType  b_type = InputType::WITNESS 
)
inlinestatic

Definition at line 574 of file biggroup.test.cpp.

◆ test_checked_unconditional_subtract()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_checked_unconditional_subtract ( InputType  a_type = InputType::WITNESS,
InputType  b_type = InputType::WITNESS 
)
inlinestatic

Definition at line 553 of file biggroup.test.cpp.

◆ test_compute_naf()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_compute_naf ( )
inlinestatic

Definition at line 1085 of file biggroup.test.cpp.

◆ test_compute_naf_overflow_lower_half()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_compute_naf_overflow_lower_half ( )
inlinestatic

Definition at line 1157 of file biggroup.test.cpp.

◆ test_compute_naf_zero()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_compute_naf_zero ( )
inlinestatic

Definition at line 1123 of file biggroup.test.cpp.

◆ test_conditional_negate()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_conditional_negate ( InputType  point_type = InputType::WITNESS,
InputType  predicate_type = InputType::WITNESS 
)
inlinestatic

Definition at line 874 of file biggroup.test.cpp.

◆ test_conditional_select()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_conditional_select ( InputType  a_type = InputType::WITNESS,
InputType  b_type = InputType::WITNESS,
InputType  predicate_type = InputType::WITNESS 
)
inlinestatic

Definition at line 901 of file biggroup.test.cpp.

◆ test_dbl()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_dbl ( InputType  a_type = InputType::WITNESS)
inlinestatic

Definition at line 602 of file biggroup.test.cpp.

◆ test_dbl_with_infinity()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_dbl_with_infinity ( )
inlinestatic

Definition at line 630 of file biggroup.test.cpp.

◆ test_dbl_with_y_zero()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_dbl_with_y_zero ( )
inlinestatic

Definition at line 674 of file biggroup.test.cpp.

◆ test_helper_batch_mul() [1/2]

template<typename TestType >
static void stdlib_biggroup< TestType >::test_helper_batch_mul ( size_t  num_points,
const bool  short_scalars = false,
const bool  with_edgecases = false 
)
inlinestatic

Definition at line 1622 of file biggroup.test.cpp.

◆ test_helper_batch_mul() [2/2]

template<typename TestType >
static void stdlib_biggroup< TestType >::test_helper_batch_mul ( std::vector< InputType point_types,
std::vector< InputType scalar_types,
const bool  short_scalars = false,
const bool  with_edgecases = false 
)
inlinestatic

Definition at line 1631 of file biggroup.test.cpp.

◆ test_incomplete_assert_equal()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_incomplete_assert_equal ( )
inlinestatic

Definition at line 931 of file biggroup.test.cpp.

◆ test_incomplete_assert_equal_edge_cases()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_incomplete_assert_equal_edge_cases ( )
inlinestatic

Definition at line 1056 of file biggroup.test.cpp.

◆ test_incomplete_assert_equal_failure()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_incomplete_assert_equal_failure ( )
inlinestatic

Definition at line 982 of file biggroup.test.cpp.

◆ test_mul()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_mul ( InputType  scalar_type = InputType::WITNESS,
InputType  point_type = InputType::WITNESS 
)
inlinestatic

Definition at line 1194 of file biggroup.test.cpp.

◆ test_mul_edge_cases()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_mul_edge_cases ( InputType  scalar_type = InputType::WITNESS,
InputType  point_type = InputType::WITNESS 
)
inlinestatic

Definition at line 1223 of file biggroup.test.cpp.

◆ test_multiple_montgomery_ladder()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_multiple_montgomery_ladder ( )
inlinestatic

Definition at line 789 of file biggroup.test.cpp.

◆ test_normalize()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_normalize ( InputType  point_type = InputType::WITNESS)
inlinestatic

Definition at line 813 of file biggroup.test.cpp.

◆ test_one()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_one ( )
inlinestatic

Definition at line 1589 of file biggroup.test.cpp.

◆ test_reduce()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_reduce ( InputType  point_type = InputType::WITNESS)
inlinestatic

Definition at line 834 of file biggroup.test.cpp.

◆ test_short_scalar_mul_infinity()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_short_scalar_mul_infinity ( )
inlinestatic

Definition at line 1346 of file biggroup.test.cpp.

◆ test_short_scalar_mul_with_bit_lengths()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_short_scalar_mul_with_bit_lengths ( )
inlinestatic

Definition at line 1301 of file biggroup.test.cpp.

◆ test_standard_form_of_point_at_infinity()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_standard_form_of_point_at_infinity ( )
inlinestatic

Check that converting a point at infinity into standard form ensures the coordinates are zeroes.

Definition at line 383 of file biggroup.test.cpp.

◆ test_sub()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_sub ( InputType  a_type = InputType::WITNESS,
InputType  b_type = InputType::WITNESS 
)
inlinestatic

Definition at line 423 of file biggroup.test.cpp.

◆ test_sub_assign()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_sub_assign ( InputType  a_type = InputType::WITNESS,
InputType  b_type = InputType::WITNESS 
)
inlinestatic

Definition at line 455 of file biggroup.test.cpp.

◆ test_sub_neg_equals_double()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_sub_neg_equals_double ( )
inlinestatic

Definition at line 722 of file biggroup.test.cpp.

◆ test_sub_points_at_infinity()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_sub_points_at_infinity ( )
inlinestatic

Definition at line 475 of file biggroup.test.cpp.

◆ test_twin_mul()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_twin_mul ( )
inlinestatic

Definition at line 1397 of file biggroup.test.cpp.

◆ test_twin_mul_with_infinity()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_twin_mul_with_infinity ( )
inlinestatic

Definition at line 1439 of file biggroup.test.cpp.

◆ test_unary_negate()

template<typename TestType >
static void stdlib_biggroup< TestType >::test_unary_negate ( InputType  a_type = InputType::WITNESS)
inlinestatic

Definition at line 855 of file biggroup.test.cpp.

Member Data Documentation

◆ EXPECT_CIRCUIT_CORRECTNESS

template<typename TestType >
constexpr auto stdlib_biggroup< TestType >::EXPECT_CIRCUIT_CORRECTNESS
staticconstexpr
Initial value:
= [](Builder& builder, bool expected_result = true) {
info("num gates = ", builder.get_num_finalized_gates_inefficient());
}
static bool check(const Builder &circuit)
Check the witness satisifies the circuit.
#define info(...)
Definition log.hpp:93
AluTraceBuilder builder
Definition alu.test.cpp:124
bool expected_result

Definition at line 68 of file biggroup.test.cpp.


The documentation for this class was generated from the following file: