Clearmatics Libsnark  0.1
C++ library for zkSNARK proofs
Public Member Functions | Public Attributes | List of all members
libsnark::ALU_cmp_gadget< FieldT > Class Template Reference

#include <alu_arithmetic.hpp>

Inheritance diagram for libsnark::ALU_cmp_gadget< FieldT >:
Inheritance graph
[legend]
Collaboration diagram for libsnark::ALU_cmp_gadget< FieldT >:
Collaboration graph
[legend]

Public Member Functions

 ALU_cmp_gadget (tinyram_protoboard< FieldT > &pb, const pb_variable_array< FieldT > &opcode_indicators, const word_variable_gadget< FieldT > &desval, const word_variable_gadget< FieldT > &arg1val, const word_variable_gadget< FieldT > &arg2val, const pb_variable< FieldT > &flag, const pb_variable< FieldT > &cmpe_result, const pb_variable< FieldT > &cmpe_result_flag, const pb_variable< FieldT > &cmpa_result, const pb_variable< FieldT > &cmpa_result_flag, const pb_variable< FieldT > &cmpae_result, const pb_variable< FieldT > &cmpae_result_flag, const std::string &annotation_prefix="")
 
void generate_r1cs_constraints ()
 
void generate_r1cs_witness ()
 
- Public Member Functions inherited from libsnark::ALU_arithmetic_gadget< FieldT >
 ALU_arithmetic_gadget (tinyram_protoboard< FieldT > &pb, const pb_variable_array< FieldT > &opcode_indicators, const word_variable_gadget< FieldT > &desval, const word_variable_gadget< FieldT > &arg1val, const word_variable_gadget< FieldT > &arg2val, const pb_variable< FieldT > &flag, const pb_variable< FieldT > &result, const pb_variable< FieldT > &result_flag, const std::string &annotation_prefix="")
 
- Public Member Functions inherited from libsnark::tinyram_standard_gadget< FieldT >
 tinyram_standard_gadget (tinyram_protoboard< FieldT > &pb, const std::string &annotation_prefix="")
 
- Public Member Functions inherited from libsnark::tinyram_gadget< FieldT >
 tinyram_gadget (tinyram_protoboard< FieldT > &pb, const std::string &annotation_prefix="")
 
- Public Member Functions inherited from libsnark::gadget< FieldT >
 gadget (protoboard< FieldT > &pb, const std::string &annotation_prefix)
 

Public Attributes

const pb_variable< FieldT > cmpe_result
 
const pb_variable< FieldT > cmpe_result_flag
 
const pb_variable< FieldT > cmpa_result
 
const pb_variable< FieldT > cmpa_result_flag
 
const pb_variable< FieldT > cmpae_result
 
const pb_variable< FieldT > cmpae_result_flag
 
- Public Attributes inherited from libsnark::ALU_arithmetic_gadget< FieldT >
const pb_variable_array< FieldT > opcode_indicators
 
const word_variable_gadget< FieldT > desval
 
const word_variable_gadget< FieldT > arg1val
 
const word_variable_gadget< FieldT > arg2val
 
const pb_variable< FieldT > flag
 
const pb_variable< FieldT > result
 
const pb_variable< FieldT > result_flag
 

Additional Inherited Members

- Protected Attributes inherited from libsnark::tinyram_gadget< FieldT >
tinyram_protoboard< FieldT > & pb
 
- Protected Attributes inherited from libsnark::gadget< FieldT >
protoboard< FieldT > & pb
 
const std::string annotation_prefix
 

Detailed Description

template<typename FieldT>
class libsnark::ALU_cmp_gadget< FieldT >

Definition at line 461 of file alu_arithmetic.hpp.

Constructor & Destructor Documentation

◆ ALU_cmp_gadget()

template<typename FieldT >
libsnark::ALU_cmp_gadget< FieldT >::ALU_cmp_gadget ( tinyram_protoboard< FieldT > &  pb,
const pb_variable_array< FieldT > &  opcode_indicators,
const word_variable_gadget< FieldT > &  desval,
const word_variable_gadget< FieldT > &  arg1val,
const word_variable_gadget< FieldT > &  arg2val,
const pb_variable< FieldT > &  flag,
const pb_variable< FieldT > &  cmpe_result,
const pb_variable< FieldT > &  cmpe_result_flag,
const pb_variable< FieldT > &  cmpa_result,
const pb_variable< FieldT > &  cmpa_result_flag,
const pb_variable< FieldT > &  cmpae_result,
const pb_variable< FieldT > &  cmpae_result_flag,
const std::string &  annotation_prefix = "" 
)
inline

Definition at line 474 of file alu_arithmetic.hpp.

488  : ALU_arithmetic_gadget<FieldT>(
489  pb,
491  desval,
492  arg1val,
493  arg2val,
494  flag,
495  cmpa_result,
498  , comparator(
499  pb,
500  pb.ap.w,
501  arg2val.packed,
502  arg1val.packed,
505  FMT(this->annotation_prefix, " comparator"))
512  {
513  }

Member Function Documentation

◆ generate_r1cs_constraints()

template<typename FieldT >
void libsnark::ALU_cmp_gadget< FieldT >::generate_r1cs_constraints ( )
virtual

◆ generate_r1cs_witness()

template<typename FieldT >
void libsnark::ALU_cmp_gadget< FieldT >::generate_r1cs_witness ( )
virtual

Member Data Documentation

◆ cmpa_result

template<typename FieldT >
const pb_variable<FieldT> libsnark::ALU_cmp_gadget< FieldT >::cmpa_result

Definition at line 469 of file alu_arithmetic.hpp.

◆ cmpa_result_flag

template<typename FieldT >
const pb_variable<FieldT> libsnark::ALU_cmp_gadget< FieldT >::cmpa_result_flag

Definition at line 470 of file alu_arithmetic.hpp.

◆ cmpae_result

template<typename FieldT >
const pb_variable<FieldT> libsnark::ALU_cmp_gadget< FieldT >::cmpae_result

Definition at line 471 of file alu_arithmetic.hpp.

◆ cmpae_result_flag

template<typename FieldT >
const pb_variable<FieldT> libsnark::ALU_cmp_gadget< FieldT >::cmpae_result_flag

Definition at line 472 of file alu_arithmetic.hpp.

◆ cmpe_result

template<typename FieldT >
const pb_variable<FieldT> libsnark::ALU_cmp_gadget< FieldT >::cmpe_result

Definition at line 467 of file alu_arithmetic.hpp.

◆ cmpe_result_flag

template<typename FieldT >
const pb_variable<FieldT> libsnark::ALU_cmp_gadget< FieldT >::cmpe_result_flag

Definition at line 468 of file alu_arithmetic.hpp.


The documentation for this class was generated from the following file:
libsnark::ALU_arithmetic_gadget::arg2val
const word_variable_gadget< FieldT > arg2val
Definition: alu_arithmetic.hpp:32
libsnark::gadget::annotation_prefix
const std::string annotation_prefix
Definition: gadget.hpp:20
libsnark::ALU_arithmetic_gadget::desval
const word_variable_gadget< FieldT > desval
Definition: alu_arithmetic.hpp:30
libsnark::ALU_arithmetic_gadget::opcode_indicators
const pb_variable_array< FieldT > opcode_indicators
Definition: alu_arithmetic.hpp:29
libsnark::ALU_cmp_gadget::cmpa_result_flag
const pb_variable< FieldT > cmpa_result_flag
Definition: alu_arithmetic.hpp:470
libsnark::tinyram_gadget::pb
tinyram_protoboard< FieldT > & pb
Definition: tinyram_protoboard.hpp:34
libsnark::ALU_cmp_gadget::cmpa_result
const pb_variable< FieldT > cmpa_result
Definition: alu_arithmetic.hpp:469
libsnark::ALU_cmp_gadget::cmpae_result
const pb_variable< FieldT > cmpae_result
Definition: alu_arithmetic.hpp:471
libsnark::ALU_arithmetic_gadget::arg1val
const word_variable_gadget< FieldT > arg1val
Definition: alu_arithmetic.hpp:31
libsnark::ALU_cmp_gadget::cmpe_result
const pb_variable< FieldT > cmpe_result
Definition: alu_arithmetic.hpp:467
libsnark::ALU_cmp_gadget::cmpae_result_flag
const pb_variable< FieldT > cmpae_result_flag
Definition: alu_arithmetic.hpp:472
libsnark::ALU_arithmetic_gadget::flag
const pb_variable< FieldT > flag
Definition: alu_arithmetic.hpp:33
libsnark::ALU_cmp_gadget::cmpe_result_flag
const pb_variable< FieldT > cmpe_result_flag
Definition: alu_arithmetic.hpp:468