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_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 50 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 59 of file biggroup.test.cpp.

◆ bool_ct

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

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

◆ Builder

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

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

◆ Curve

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

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

◆ element

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

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

◆ element_ct

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

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

◆ field_ct

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

◆ fq

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

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

◆ fr

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

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

◆ g1

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

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

◆ scalar_ct

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

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

◆ witness_ct

Definition at line 63 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 81 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 113 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 93 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 124 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 132 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 73 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 102 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 260 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 297 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 693 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 318 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 191 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 148 of file biggroup.test.cpp.

◆ test_batch_mul()

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

Definition at line 1664 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 1924 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 1951 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 2058 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 1762 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 1822 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 1712 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 2174 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 1443 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 1512 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 2107 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 2017 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 1978 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 741 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 527 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 569 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 548 of file biggroup.test.cpp.

◆ test_compute_naf()

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

Definition at line 1080 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 1118 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 869 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 896 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 597 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 625 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 669 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 1579 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 1588 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 926 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 1051 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 977 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 1152 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 1181 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 784 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 808 of file biggroup.test.cpp.

◆ test_one()

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

Definition at line 1546 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 829 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 1304 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 1259 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 378 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 418 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 450 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 717 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 470 of file biggroup.test.cpp.

◆ test_twin_mul()

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

Definition at line 1355 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 1397 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 850 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.
void info(Args... args)
Definition log.hpp:75
AluTraceBuilder builder
Definition alu.test.cpp:124
bool expected_result

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


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