Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::field2< base_field, Params > Struct Template Reference

#include <field2_declarations.hpp>

Public Member Functions

constexpr field2 (const base_field &a=base_field::zero(), const base_field &b=base_field::zero())
 
constexpr field2 (const field2 &other) noexcept
 
constexpr field2 (field2 &&other) noexcept
 
constexpr field2operator= (const field2 &other) noexcept
 
constexpr field2operator= (field2 &&other) noexcept
 
constexpr ~field2 () noexcept=default
 
constexpr field2 operator* (const field2 &other) const noexcept
 
constexpr field2 operator+ (const field2 &other) const noexcept
 
constexpr field2 operator- (const field2 &other) const noexcept
 
constexpr field2 operator- () const noexcept
 
constexpr field2 operator/ (const field2 &other) const noexcept
 
constexpr field2 operator*= (const field2 &other) noexcept
 
constexpr field2 operator+= (const field2 &other) noexcept
 
constexpr field2 operator-= (const field2 &other) noexcept
 
constexpr field2 operator/= (const field2 &other) noexcept
 
constexpr field2 mul_by_fq (const base_field &a) const noexcept
 
constexpr bool operator== (const field2 &other) const noexcept
 
constexpr bool operator!= (const field2 &other) const noexcept
 
constexpr field2 sqr () const noexcept
 
constexpr void self_sqr () noexcept
 
constexpr field2 pow (const uint256_t &exponent) const noexcept
 
constexpr field2 pow (uint64_t exponent) const noexcept
 
constexpr field2 invert () const noexcept
 
constexpr void self_neg () noexcept
 
constexpr field2 to_montgomery_form () const noexcept
 
constexpr field2 from_montgomery_form () const noexcept
 
constexpr void self_to_montgomery_form () noexcept
 
constexpr void self_from_montgomery_form () noexcept
 
constexpr void self_conditional_negate (uint64_t predicate) noexcept
 
constexpr field2 reduce_once () const noexcept
 
constexpr void self_reduce_once () noexcept
 
constexpr void self_set_msb () noexcept
 
constexpr bool is_msb_set () const noexcept
 
constexpr uint64_t is_msb_set_word () const noexcept
 
constexpr bool is_zero () const noexcept
 
constexpr field2 frobenius_map () const noexcept
 
constexpr void self_frobenius_map () noexcept
 

Static Public Member Functions

static constexpr field2 zero ()
 
static constexpr field2 one ()
 
static constexpr field2 twist_coeff_b ()
 
static constexpr field2 twist_mul_by_q_x ()
 
static constexpr field2 twist_mul_by_q_y ()
 
static constexpr field2 cube_root_of_unity ()
 
static field2 random_element (numeric::RNG *engine=nullptr)
 
static void serialize_to_buffer (const field2 &value, uint8_t *buffer)
 
static field2 serialize_from_buffer (uint8_t *buffer)
 

Public Attributes

base_field c0
 
base_field c1
 

Static Public Attributes

static constexpr size_t PUBLIC_INPUTS_SIZE = base_field::PUBLIC_INPUTS_SIZE + base_field::PUBLIC_INPUTS_SIZE
 
static constexpr uint256_t modulus = base_field::modulus
 

Friends

std::ostream & operator<< (std::ostream &os, const field2 &a)
 

Detailed Description

template<class base_field, class Params>
struct bb::field2< base_field, Params >

Definition at line 17 of file field2_declarations.hpp.

Constructor & Destructor Documentation

◆ field2() [1/3]

template<class base_field , class Params >
constexpr bb::field2< base_field, Params >::field2 ( const base_field &  a = base_field::zero(),
const base_field &  b = base_field::zero() 
)
inlineconstexpr

Definition at line 21 of file field2_declarations.hpp.

◆ field2() [2/3]

template<class base_field , class Params >
constexpr bb::field2< base_field, Params >::field2 ( const field2< base_field, Params > &  other)
inlineconstexprnoexcept

Definition at line 26 of file field2_declarations.hpp.

◆ field2() [3/3]

template<class base_field , class Params >
constexpr bb::field2< base_field, Params >::field2 ( field2< base_field, Params > &&  other)
inlineconstexprnoexcept

Definition at line 30 of file field2_declarations.hpp.

◆ ~field2()

template<class base_field , class Params >
constexpr bb::field2< base_field, Params >::~field2 ( )
constexprdefaultnoexcept

Member Function Documentation

◆ cube_root_of_unity()

template<class base_field , class Params >
static constexpr field2 bb::field2< base_field, Params >::cube_root_of_unity ( )
inlinestaticconstexpr

Definition at line 73 of file field2_declarations.hpp.

◆ frobenius_map()

template<class base , class T >
constexpr field2< base, T > bb::field2< base, T >::frobenius_map ( ) const
constexprnoexcept

Definition at line 189 of file field2.hpp.

◆ from_montgomery_form()

template<class base , class T >
constexpr field2< base, T > bb::field2< base, T >::from_montgomery_form ( ) const
constexprnoexcept

Definition at line 90 of file field2.hpp.

◆ invert()

template<class base , class T >
constexpr field2< base, T > bb::field2< base, T >::invert ( ) const
constexprnoexcept

Definition at line 152 of file field2.hpp.

◆ is_msb_set()

template<class base , class T >
constexpr bool bb::field2< base, T >::is_msb_set ( ) const
constexprnoexcept

Definition at line 169 of file field2.hpp.

◆ is_msb_set_word()

template<class base , class T >
constexpr uint64_t bb::field2< base, T >::is_msb_set_word ( ) const
constexprnoexcept

Definition at line 174 of file field2.hpp.

◆ is_zero()

template<class base , class T >
constexpr bool bb::field2< base, T >::is_zero ( ) const
constexprnoexcept

Definition at line 179 of file field2.hpp.

◆ mul_by_fq()

template<class base_field , class Params >
constexpr field2 bb::field2< base_field, Params >::mul_by_fq ( const base_field &  a) const
inlineconstexprnoexcept

Definition at line 89 of file field2_declarations.hpp.

◆ one()

template<class base_field , class Params >
static constexpr field2 bb::field2< base_field, Params >::one ( )
inlinestaticconstexpr

Definition at line 63 of file field2_declarations.hpp.

◆ operator!=()

template<class base_field , class Params >
constexpr bool bb::field2< base_field, Params >::operator!= ( const field2< base_field, Params > &  other) const
inlineconstexprnoexcept

Definition at line 96 of file field2_declarations.hpp.

◆ operator*()

template<class base , class T >
constexpr field2< base, T > bb::field2< base, T >::operator* ( const field2< base_field, Params > &  other) const
constexprnoexcept

Definition at line 18 of file field2.hpp.

◆ operator*=()

template<class base , class T >
constexpr field2< base, T > bb::field2< base, T >::operator*= ( const field2< base_field, Params > &  other)
constexprnoexcept

Definition at line 50 of file field2.hpp.

◆ operator+()

template<class base , class T >
constexpr field2< base, T > bb::field2< base, T >::operator+ ( const field2< base_field, Params > &  other) const
constexprnoexcept

Definition at line 30 of file field2.hpp.

◆ operator+=()

template<class base , class T >
constexpr field2< base, T > bb::field2< base, T >::operator+= ( const field2< base_field, Params > &  other)
constexprnoexcept

Definition at line 56 of file field2.hpp.

◆ operator-() [1/2]

template<class base , class T >
constexpr field2< base, T > bb::field2< base, T >::operator- ( ) const
constexprnoexcept

Definition at line 40 of file field2.hpp.

◆ operator-() [2/2]

template<class base , class T >
constexpr field2< base, T > bb::field2< base, T >::operator- ( const field2< base_field, Params > &  other) const
constexprnoexcept

Definition at line 35 of file field2.hpp.

◆ operator-=()

template<class base , class T >
constexpr field2< base, T > bb::field2< base, T >::operator-= ( const field2< base_field, Params > &  other)
constexprnoexcept

Definition at line 62 of file field2.hpp.

◆ operator/()

template<class base , class T >
constexpr field2< base, T > bb::field2< base, T >::operator/ ( const field2< base_field, Params > &  other) const
constexprnoexcept

Definition at line 45 of file field2.hpp.

◆ operator/=()

template<class base , class T >
constexpr field2< base, T > bb::field2< base, T >::operator/= ( const field2< base_field, Params > &  other)
constexprnoexcept

Definition at line 68 of file field2.hpp.

◆ operator=() [1/2]

template<class base_field , class Params >
constexpr field2 & bb::field2< base_field, Params >::operator= ( const field2< base_field, Params > &  other)
inlineconstexprnoexcept

Definition at line 35 of file field2_declarations.hpp.

◆ operator=() [2/2]

template<class base_field , class Params >
constexpr field2 & bb::field2< base_field, Params >::operator= ( field2< base_field, Params > &&  other)
inlineconstexprnoexcept

Definition at line 45 of file field2_declarations.hpp.

◆ operator==()

template<class base , class T >
constexpr bool bb::field2< base, T >::operator== ( const field2< base_field, Params > &  other) const
constexprnoexcept

Definition at line 184 of file field2.hpp.

◆ pow() [1/2]

template<class base , class T >
constexpr field2< base, T > bb::field2< base, T >::pow ( const uint256_t exponent) const
constexprnoexcept

Definition at line 125 of file field2.hpp.

◆ pow() [2/2]

template<class base , class T >
constexpr field2< base, T > bb::field2< base, T >::pow ( uint64_t  exponent) const
constexprnoexcept

Definition at line 147 of file field2.hpp.

◆ random_element()

template<class base , class T >
field2< base, T > bb::field2< base, T >::random_element ( numeric::RNG engine = nullptr)
static

Definition at line 199 of file field2.hpp.

◆ reduce_once()

template<class base , class T >
constexpr field2< base, T > bb::field2< base, T >::reduce_once ( ) const
constexprnoexcept

Definition at line 107 of file field2.hpp.

◆ self_conditional_negate()

template<class base , class T >
constexpr void bb::field2< base, T >::self_conditional_negate ( uint64_t  predicate)
constexprnoexcept

Definition at line 159 of file field2.hpp.

◆ self_frobenius_map()

template<class base , class T >
constexpr void bb::field2< base, T >::self_frobenius_map ( )
constexprnoexcept

Definition at line 194 of file field2.hpp.

◆ self_from_montgomery_form()

template<class base , class T >
constexpr void bb::field2< base, T >::self_from_montgomery_form ( )
constexprnoexcept

Definition at line 101 of file field2.hpp.

◆ self_neg()

template<class base , class T >
constexpr void bb::field2< base, T >::self_neg ( )
constexprnoexcept

Definition at line 119 of file field2.hpp.

◆ self_reduce_once()

template<class base , class T >
constexpr void bb::field2< base, T >::self_reduce_once ( )
constexprnoexcept

Definition at line 113 of file field2.hpp.

◆ self_set_msb()

template<class base , class T >
constexpr void bb::field2< base, T >::self_set_msb ( )
constexprnoexcept

Definition at line 164 of file field2.hpp.

◆ self_sqr()

template<class base , class T >
constexpr void bb::field2< base, T >::self_sqr ( )
constexprnoexcept

Definition at line 80 of file field2.hpp.

◆ self_to_montgomery_form()

template<class base , class T >
constexpr void bb::field2< base, T >::self_to_montgomery_form ( )
constexprnoexcept

Definition at line 95 of file field2.hpp.

◆ serialize_from_buffer()

template<class base_field , class Params >
static field2 bb::field2< base_field, Params >::serialize_from_buffer ( uint8_t *  buffer)
inlinestatic

Definition at line 133 of file field2_declarations.hpp.

◆ serialize_to_buffer()

template<class base_field , class Params >
static void bb::field2< base_field, Params >::serialize_to_buffer ( const field2< base_field, Params > &  value,
uint8_t *  buffer 
)
inlinestatic

Definition at line 127 of file field2_declarations.hpp.

◆ sqr()

template<class base , class T >
constexpr field2< base, T > bb::field2< base, T >::sqr ( ) const
constexprnoexcept

Definition at line 74 of file field2.hpp.

◆ to_montgomery_form()

template<class base , class T >
constexpr field2< base, T > bb::field2< base, T >::to_montgomery_form ( ) const
constexprnoexcept

Definition at line 85 of file field2.hpp.

◆ twist_coeff_b()

template<class base_field , class Params >
static constexpr field2 bb::field2< base_field, Params >::twist_coeff_b ( )
inlinestaticconstexpr

Definition at line 64 of file field2_declarations.hpp.

◆ twist_mul_by_q_x()

template<class base_field , class Params >
static constexpr field2 bb::field2< base_field, Params >::twist_mul_by_q_x ( )
inlinestaticconstexpr

Definition at line 65 of file field2_declarations.hpp.

◆ twist_mul_by_q_y()

template<class base_field , class Params >
static constexpr field2 bb::field2< base_field, Params >::twist_mul_by_q_y ( )
inlinestaticconstexpr

Definition at line 69 of file field2_declarations.hpp.

◆ zero()

template<class base_field , class Params >
static constexpr field2 bb::field2< base_field, Params >::zero ( )
inlinestaticconstexpr

Definition at line 62 of file field2_declarations.hpp.

Friends And Related Symbol Documentation

◆ operator<<

template<class base_field , class Params >
std::ostream & operator<< ( std::ostream &  os,
const field2< base_field, Params > &  a 
)
friend

Definition at line 142 of file field2_declarations.hpp.

Member Data Documentation

◆ c0

template<class base_field , class Params >
base_field bb::field2< base_field, Params >::c0

Definition at line 57 of file field2_declarations.hpp.

◆ c1

template<class base_field , class Params >
base_field bb::field2< base_field, Params >::c1

Definition at line 58 of file field2_declarations.hpp.

◆ modulus

template<class base_field , class Params >
constexpr uint256_t bb::field2< base_field, Params >::modulus = base_field::modulus
staticconstexpr

Definition at line 60 of file field2_declarations.hpp.

◆ PUBLIC_INPUTS_SIZE

template<class base_field , class Params >
constexpr size_t bb::field2< base_field, Params >::PUBLIC_INPUTS_SIZE = base_field::PUBLIC_INPUTS_SIZE + base_field::PUBLIC_INPUTS_SIZE
staticconstexpr

Definition at line 19 of file field2_declarations.hpp.


The documentation for this struct was generated from the following files: