Clearmatics Libsnark  0.1
C++ library for zkSNARK proofs
Classes | Typedefs | Enumerations | Functions | Variables
libsnark Namespace Reference

Classes

class  accumulation_vector
 
class  add_variable_and_variable_or_identity
 
class  add_variable_or_identity
 
class  aesPrfKeyT
 
class  ALU_add_gadget
 
class  ALU_and_gadget
 
class  ALU_arithmetic_gadget
 
class  ALU_cjmp_gadget
 
class  ALU_cmov_gadget
 
class  ALU_cmp_gadget
 
class  ALU_cmps_gadget
 
class  ALU_cnjmp_gadget
 
class  ALU_control_flow_gadget
 
class  ALU_divmod_gadget
 
class  ALU_gadget
 
class  ALU_jmp_gadget
 
class  ALU_mov_gadget
 
class  ALU_not_gadget
 
class  ALU_or_gadget
 
class  ALU_shr_shl_gadget
 
class  ALU_smul_gadget
 
class  ALU_sub_gadget
 
class  ALU_umul_gadget
 
class  ALU_xor_gadget
 
class  argument_decoder_gadget
 
class  as_waksman_routing_gadget
 
class  bacs_circuit
 
struct  bacs_example
 
struct  bacs_gate
 
class  bacs_ppzksnark_keypair
 
class  bacs_ppzksnark_proving_key
 
class  bar_gadget
 
class  bdfg21
 
class  benes_routing_gadget
 
class  big_sigma_gadget
 
class  bit_vector_copy_gadget
 
class  block_variable
 
class  bls12_377_ate_add_gadget
 
class  bls12_377_ate_compute_f_ell_P
 
class  bls12_377_ate_dbl_gadget
 
class  bls12_377_ate_ell_coeffs
 
class  bls12_377_e_over_e_miller_loop_gadget
 
class  bls12_377_e_times_e_times_e_over_e_miller_loop_gadget
 
class  bls12_377_exp_by_z_gadget
 
class  bls12_377_final_exp_first_part_gadget
 
class  bls12_377_final_exp_gadget
 
class  bls12_377_final_exp_last_part_gadget
 
class  bls12_377_G1_membership_check_gadget
 
class  bls12_377_G1_precomputation
 
class  bls12_377_G1_precompute_gadget
 
class  bls12_377_G2_membership_check_gadget
 
class  bls12_377_G2_precomputation
 
class  bls12_377_G2_precompute_gadget
 
class  bls12_377_G2_proj
 
class  bls12_377_miller_loop_gadget
 
class  check_e_equals_e_gadget
 
class  check_e_equals_ee_gadget
 
class  check_e_equals_eee_gadget
 
class  choice_gadget
 
class  comparison_gadget
 
class  compliance_predicate_handler
 
class  conjunction_gadget
 
class  consistency_enforcer_gadget
 
struct  constraint_profiling_entry
 
class  dbl_variable_or_identity
 
class  default_fooram_ppzksnark_pp
 
class  default_fooram_zksnark_pp
 
class  default_r1cs_ppzkadsnark_pp
 
class  default_r1cs_ppzkpcd_pp
 
class  default_tinyram_ppzksnark_pp
 
class  default_tinyram_zksnark_pp
 
class  delegated_ra_memory
 
class  digest_selector_gadget
 
class  digest_variable
 
class  disjunction_gadget
 Output is 0 iff the sum of inputs is 0. Output is 1 otherwise. More...
 
class  doubleword_variable_gadget
 
class  dual_variable_gadget
 
class  ed25519_sigT
 
class  ed25519_skT
 
class  ed25519_vkT
 
class  execution_line_variable_gadget
 
class  exponentiation_gadget
 
class  field_vector_copy_gadget
 
class  fooram_architecture_params
 
class  fooram_cpu_checker
 
class  fooram_gadget
 
class  fooram_protoboard
 
class  Fp12_2over3over2_cyclotomic_square_gadget
 
class  Fp12_2over3over2_inv_gadget
 Inverse of Fp12 variable. More...
 
class  Fp12_2over3over2_mul_by_024_gadget
 
class  Fp12_2over3over2_mul_gadget
 Full multiplication of Fp12 variables. More...
 
class  Fp12_2over3over2_square_gadget
 
class  Fp12_2over3over2_variable
 
class  Fp2_mul_by_lc_gadget
 
class  Fp2_mul_gadget
 
class  Fp2_sqr_gadget
 
class  Fp2_variable
 
class  Fp3_mul_by_lc_gadget
 
class  Fp3_mul_gadget
 
class  Fp3_sqr_gadget
 
class  Fp3_variable
 
class  Fp4_cyclotomic_sqr_gadget
 
class  Fp4_direct_mul_gadget
 
class  Fp4_sqr_gadget
 
class  Fp4_tower_mul_gadget
 
class  Fp4_variable
 
class  Fp6_2over3_cyclotomic_sqr_gadget
 
class  Fp6_2over3_mul_by_2345_gadget
 
class  Fp6_2over3_mul_gadget
 
class  Fp6_2over3_sqr_gadget
 
class  Fp6_2over3_variable
 
class  Fp6_3over2_mul_gadget
 
class  Fp6_3over2_variable
 
class  G1_add_gadget
 
class  G1_checker_gadget
 
class  G1_dbl_gadget
 
class  G1_multiscalar_mul_gadget
 
class  G1_variable
 Gadget that represents a G1 variable. More...
 
class  G1_variable_selector_gadget
 
class  G2_add_gadget
 Gadget to add 2 G2 points. More...
 
class  G2_checker_gadget
 Gadget that creates constraints for the validity of a G2 variable. More...
 
class  G2_dbl_gadget
 Double a G2 point. More...
 
class  G2_equality_gadget
 Check equality of 2 G2 points. More...
 
class  G2_variable
 Gadget that represents a G2 variable. More...
 
class  G2_variable_selector_gadget
 
class  gadget
 
class  gadget_from_r1cs
 
class  inner_product_gadget
 
class  integer_permutation
 
class  knapsack_CRH_with_bit_out_gadget
 
class  knapsack_CRH_with_field_out_gadget
 
struct  knapsack_dimension
 
struct  knowledge_commitment
 
class  kpT
 
class  kzg10
 
class  kzg10_batched_2_point
 
class  kzg10_srs_variable
 
class  kzg10_verifier_gadget
 
class  labelT
 
class  lastbits_gadget
 
class  linear_combination
 
class  linear_term
 
class  loose_multiplexing_gadget
 
class  majority_gadget
 
class  memory_checker_gadget
 
class  memory_interface
 
class  memory_line_variable_gadget
 
class  memory_masking_gadget
 
class  memory_store_trace
 
class  merkle_authentication_path_variable
 
class  merkle_tree
 
class  merkle_tree_check_read_gadget
 
class  merkle_tree_check_update_gadget
 
class  mnt4_final_exp_gadget
 
class  mnt6_final_exp_gadget
 
class  mnt_e_over_e_miller_loop_gadget
 Gadget for verifying a double Miller loop (where the second is inverted). More...
 
class  mnt_e_times_e_over_e_miller_loop_gadget
 Gadget for verifying a triple Miller loop (where the third is inverted). More...
 
class  mnt_e_times_e_times_e_over_e_miller_loop_gadget
 
class  mnt_G1_precomputation
 
class  mnt_G2_precomputation
 
class  mnt_miller_loop_add_line_eval
 
class  mnt_miller_loop_dbl_line_eval
 
class  mnt_miller_loop_gadget
 Gadget for verifying a single Miller loop. More...
 
class  mnt_pairing_params
 
class  mnt_pairing_params< libff::mnt4_pp >
 
class  mnt_pairing_params< libff::mnt6_pp >
 
class  mnt_precompute_G1_gadget
 
class  mnt_precompute_G2_gadget
 
class  mnt_precompute_G2_gadget_addition_step
 
class  mnt_precompute_G2_gadget_coeffs
 
class  mnt_precompute_G2_gadget_doubling_step
 
class  mp_compliance_step_pcd_circuit_maker
 
class  mp_translation_step_pcd_circuit_maker
 
class  multipacking_gadget
 
class  packing_gadget
 
class  pairing_selector
 
class  pairing_selector< libff::bw6_761_pp >
 
class  pairing_selector< libff::mnt4_pp >
 
class  pairing_selector< libff::mnt6_pp >
 
class  pb_linear_combination
 
class  pb_linear_combination_array
 
class  pb_variable
 
class  pb_variable_array
 
class  point_mul_by_const_scalar_gadget
 
class  point_mul_by_scalar_gadget
 
class  protoboard
 
class  qap_instance
 
class  qap_instance_evaluation
 
class  qap_witness
 
class  r1cs_constraint
 
class  r1cs_constraint_system
 
struct  r1cs_example
 
class  r1cs_gg_ppzksnark_keypair
 
class  r1cs_gg_ppzksnark_online_verifier_gadget
 
class  r1cs_gg_ppzksnark_preprocessed_verification_key_variable
 
class  r1cs_gg_ppzksnark_processed_verification_key
 
class  r1cs_gg_ppzksnark_proof
 
class  r1cs_gg_ppzksnark_proof_variable
 
class  r1cs_gg_ppzksnark_proving_key
 
class  r1cs_gg_ppzksnark_verification_key
 
class  r1cs_gg_ppzksnark_verification_key_variable
 
class  r1cs_gg_ppzksnark_verifier_gadget
 
class  r1cs_gg_ppzksnark_verifier_process_vk_gadget
 
class  r1cs_mp_ppzkpcd_keypair
 
class  r1cs_mp_ppzkpcd_processed_verification_key
 
class  r1cs_mp_ppzkpcd_proof
 
class  r1cs_mp_ppzkpcd_proving_key
 
class  r1cs_mp_ppzkpcd_verification_key
 
class  r1cs_pcd_compliance_predicate
 
class  r1cs_pcd_compliance_predicate_auxiliary_input
 
class  r1cs_pcd_compliance_predicate_primary_input
 
class  r1cs_pcd_local_data
 
class  r1cs_pcd_local_data_variable
 
class  r1cs_pcd_message
 
class  r1cs_pcd_message_variable
 
class  r1cs_ppzkadsnark_auth_data
 
class  r1cs_ppzkadsnark_auth_keys
 
class  r1cs_ppzkadsnark_keypair
 
class  r1cs_ppzkadsnark_processed_verification_key
 
class  r1cs_ppzkadsnark_proof
 
class  r1cs_ppzkadsnark_proving_key
 
class  r1cs_ppzkadsnark_pub_auth_key
 
class  r1cs_ppzkadsnark_pub_auth_prms
 
class  r1cs_ppzkadsnark_sec_auth_key
 
class  r1cs_ppzkadsnark_verification_key
 
class  r1cs_ppzksnark_keypair
 
class  r1cs_ppzksnark_online_verifier_gadget
 
class  r1cs_ppzksnark_preprocessed_r1cs_ppzksnark_verification_key_variable
 
class  r1cs_ppzksnark_processed_verification_key
 
class  r1cs_ppzksnark_proof
 
class  r1cs_ppzksnark_proof_variable
 
class  r1cs_ppzksnark_proving_key
 
class  r1cs_ppzksnark_verification_key
 
class  r1cs_ppzksnark_verification_key_variable
 
class  r1cs_ppzksnark_verifier_gadget
 
class  r1cs_ppzksnark_verifier_process_vk_gadget
 
class  r1cs_se_ppzksnark_keypair
 
class  r1cs_se_ppzksnark_processed_verification_key
 
class  r1cs_se_ppzksnark_proof
 
class  r1cs_se_ppzksnark_proving_key
 
class  r1cs_se_ppzksnark_verification_key
 
class  r1cs_sp_ppzkpcd_keypair
 
class  r1cs_sp_ppzkpcd_processed_verification_key
 
class  r1cs_sp_ppzkpcd_proving_key
 
class  r1cs_sp_ppzkpcd_verification_key
 
class  ra_memory
 
class  ram_compliance_predicate_handler
 
struct  ram_example
 
class  ram_fooram
 
class  ram_pcd_local_data
 
class  ram_pcd_local_data_variable
 
class  ram_pcd_message
 
class  ram_pcd_message_variable
 
struct  ram_ppzksnark_keypair
 
class  ram_ppzksnark_proving_key
 
class  ram_ppzksnark_verification_key
 
class  ram_tinyram
 
class  ram_to_r1cs
 
class  ram_universal_gadget
 
struct  ram_zksnark_keypair
 
class  ram_zksnark_proof
 
class  ram_zksnark_proving_key
 
class  ram_zksnark_verification_key
 
class  sap_instance
 
class  sap_instance_evaluation
 
class  sap_witness
 
class  set_commitment_accumulator
 
class  set_commitment_gadget
 
struct  set_membership_proof
 
class  set_membership_proof_variable
 
class  sha256_compression_function_gadget
 
class  sha256_message_schedule_gadget
 
class  sha256_round_function_gadget
 
class  sha256_two_to_one_hash_gadget
 
class  small_sigma_gadget
 
class  sp_compliance_step_pcd_circuit_maker
 
class  sp_translation_step_pcd_circuit_maker
 
struct  sparse_vector
 
class  ssp_instance
 
class  ssp_instance_evaluation
 
class  ssp_witness
 
class  tally_cp_handler
 
class  tally_pcd_local_data
 
class  tally_pcd_message
 
class  tbcs_circuit
 
struct  tbcs_example
 
class  tbcs_gate
 
class  tbcs_ppzksnark_keypair
 
class  tbcs_ppzksnark_proving_key
 
class  tinyram_architecture_params
 
class  tinyram_cpu_checker
 
class  tinyram_gadget
 
class  tinyram_instruction
 
class  tinyram_program
 
class  tinyram_protoboard
 
class  tinyram_standard_gadget
 
class  uscs_constraint_system
 
struct  uscs_example
 
class  uscs_ppzksnark_keypair
 
class  uscs_ppzksnark_processed_verification_key
 
class  uscs_ppzksnark_proof
 
class  uscs_ppzksnark_proving_key
 
class  uscs_ppzksnark_verification_key
 
class  variable
 
class  variable_and_variable_or_identity_selector
 Selector gadget for a variable_or_identity, and a variable. More...
 
class  variable_or_identity
 
class  variable_or_identity_selector
 Selector gadget for variable_or_identity. More...
 
class  word_variable_gadget
 
class  XOR3_gadget
 

Typedefs

typedef libff::bit_vector merkle_authentication_node
 
typedef std::vector< merkle_authentication_nodemerkle_authentication_path
 
template<typename FieldT >
using polynomial = std::vector< FieldT >
 
typedef libff::bit_vector set_commitment
 
typedef libff::default_ec_pp default_bacs_ppzksnark_pp
 
typedef libff::default_ec_pp default_r1cs_gg_ppzksnark_pp
 
typedef libff::default_ec_pp default_r1cs_ppzksnark_pp
 
typedef libff::default_ec_pp default_r1cs_se_ppzksnark_pp
 
typedef default_tinyram_ppzksnark_pp default_ram_ppzksnark_pp
 
typedef default_tinyram_zksnark_pp default_ram_zksnark_pp
 
typedef libff::default_ec_pp default_tbcs_ppzksnark_pp
 
typedef libff::default_ec_pp default_uscs_ppzksnark_pp
 
typedef std::vector< std::vector< std::pair< size_t, size_t > > > as_waksman_topology
 
typedef std::vector< std::map< size_t, bool > > as_waksman_routing
 
typedef std::vector< std::vector< std::pair< size_t, size_t > > > benes_topology
 
typedef std::vector< libff::bit_vector > benes_routing
 
template<typename wppT , mp_size_t scalarLimbs>
using G1_mul_by_const_scalar_gadget = point_mul_by_const_scalar_gadget< libff::G1< other_curve< wppT > >, G1_variable< wppT >, G1_add_gadget< wppT >, G1_dbl_gadget< wppT >, libff::bigint< scalarLimbs > >
 
template<typename wppT >
using G1_variable_or_identity = variable_or_identity< wppT, libff::G1< other_curve< wppT > >, G1_variable< wppT > >
 
template<typename wppT >
using G1_variable_or_identity_selector_gadget = variable_or_identity_selector< wppT, libff::G1< other_curve< wppT > >, G1_variable< wppT >, G1_variable_selector_gadget< wppT > >
 
template<typename wppT >
using G1_variable_and_variable_or_identity_selector_gadget = variable_and_variable_or_identity_selector< wppT, libff::G1< other_curve< wppT > >, G1_variable< wppT >, G1_variable_selector_gadget< wppT > >
 
template<typename wppT >
using G1_add_variable_or_identity_gadget = add_variable_or_identity< wppT, libff::G1< other_curve< wppT > >, G1_variable< wppT >, G1_variable_selector_gadget< wppT >, G1_add_gadget< wppT > >
 
template<typename wppT >
using G1_add_variable_and_variable_or_identity_gadget = add_variable_and_variable_or_identity< wppT, libff::G1< other_curve< wppT > >, G1_variable< wppT >, G1_variable_selector_gadget< wppT >, G1_add_gadget< wppT > >
 
template<typename wppT >
using G1_dbl_variable_or_identity_gadget = dbl_variable_or_identity< wppT, libff::G1< other_curve< wppT > >, G1_variable< wppT >, G1_dbl_gadget< wppT > >
 
template<typename wppT >
using G1_mul_by_scalar_gadget = point_mul_by_scalar_gadget< wppT, libff::G1< other_curve< wppT > >, G1_variable< wppT >, G1_variable_selector_gadget< wppT >, G1_add_gadget< wppT >, G1_dbl_gadget< wppT > >
 
template<typename wppT , mp_size_t scalarLimbs>
using G2_mul_by_const_scalar_gadget = point_mul_by_const_scalar_gadget< libff::G2< other_curve< wppT > >, G2_variable< wppT >, G2_add_gadget< wppT >, G2_dbl_gadget< wppT >, libff::bigint< scalarLimbs > >
 
template<typename wppT >
using G2_variable_or_identity = variable_or_identity< wppT, libff::G2< other_curve< wppT > >, G2_variable< wppT > >
 
template<typename wppT >
using G2_variable_or_identity_selector_gadget = variable_or_identity_selector< wppT, libff::G2< other_curve< wppT > >, G2_variable< wppT >, G2_variable_selector_gadget< wppT > >
 
template<typename wppT >
using G2_variable_and_variable_or_identity_selector_gadget = variable_and_variable_or_identity_selector< wppT, libff::G2< other_curve< wppT > >, G2_variable< wppT >, G2_variable_selector_gadget< wppT > >
 
template<typename wppT >
using G2_add_variable_or_identity_gadget = add_variable_or_identity< wppT, libff::G2< other_curve< wppT > >, G2_variable< wppT >, G2_variable_selector_gadget< wppT >, G2_add_gadget< wppT > >
 
template<typename wppT >
using G2_add_variable_and_variable_or_identity_gadget = add_variable_and_variable_or_identity< wppT, libff::G2< other_curve< wppT > >, G2_variable< wppT >, G2_variable_selector_gadget< wppT >, G2_add_gadget< wppT > >
 
template<typename wppT >
using G2_dbl_variable_or_identity_gadget = dbl_variable_or_identity< wppT, libff::G2< other_curve< wppT > >, G2_variable< wppT >, G2_dbl_gadget< wppT > >
 
template<typename wppT >
using G2_mul_by_scalar_gadget = point_mul_by_scalar_gadget< wppT, libff::G2< other_curve< wppT > >, G2_variable< wppT >, G2_variable_selector_gadget< wppT >, G2_add_gadget< wppT >, G2_dbl_gadget< wppT > >
 
template<typename FieldT , typename HashT >
using memory_load_gadget = merkle_tree_check_read_gadget< FieldT, HashT >
 
template<typename FieldT , typename HashT >
using memory_load_store_gadget = merkle_tree_check_update_gadget< FieldT, HashT >
 
template<typename Fp4T >
using Fp4_mul_gadget = Fp4_direct_mul_gadget< Fp4T >
 
template<typename FieldT >
using CRH_with_field_out_gadget = knapsack_CRH_with_field_out_gadget< FieldT >
 
template<typename FieldT >
using CRH_with_bit_out_gadget = knapsack_CRH_with_bit_out_gadget< FieldT >
 
template<typename ppT >
using FqkT = typename pairing_selector< ppT >::FqkT
 
template<typename ppT >
using Fqe_variable = typename pairing_selector< ppT >::Fqe_variable_type
 
template<typename ppT >
using Fqe_mul_gadget = typename pairing_selector< ppT >::Fqe_mul_gadget_type
 
template<typename ppT >
using Fqe_mul_by_lc_gadget = typename pairing_selector< ppT >::Fqe_mul_by_lc_gadget_type
 
template<typename ppT >
using Fqe_sqr_gadget = typename pairing_selector< ppT >::Fqe_sqr_gadget_type
 
template<typename ppT >
using Fqk_variable = typename pairing_selector< ppT >::Fqk_variable_type
 
template<typename ppT >
using Fqk_mul_gadget = typename pairing_selector< ppT >::Fqk_mul_gadget_type
 
template<typename ppT >
using Fqk_sqr_gadget = typename pairing_selector< ppT >::Fqk_sqr_gadget_type
 
template<typename ppT >
using other_curve = typename pairing_selector< ppT >::other_curve_type
 
template<typename ppT >
using G1_checker = typename pairing_selector< ppT >::G1_checker_type
 
template<typename ppT >
using G2_checker = typename pairing_selector< ppT >::G2_checker_type
 
template<typename ppT >
using G1_precomputation = typename pairing_selector< ppT >::G1_precomputation_type
 
template<typename ppT >
using G2_precomputation = typename pairing_selector< ppT >::G2_precomputation_type
 
template<typename ppT >
using precompute_G1_gadget = typename pairing_selector< ppT >::precompute_G1_gadget_type
 
template<typename ppT >
using precompute_G2_gadget = typename pairing_selector< ppT >::precompute_G2_gadget_type
 
template<typename ppT >
using miller_loop_gadget = typename pairing_selector< ppT >::miller_loop_gadget_type
 
template<typename ppT >
using e_over_e_miller_loop_gadget = typename pairing_selector< ppT >::e_over_e_miller_loop_gadget_type
 
template<typename ppT >
using e_times_e_over_e_miller_loop_gadget = typename pairing_selector< ppT >::e_times_e_over_e_miller_loop_gadget_type
 
template<typename ppT >
using e_times_e_times_e_over_e_miller_loop_gadget = typename pairing_selector< ppT >::e_times_e_times_e_over_e_miller_loop_gadget_type
 
template<typename ppT >
using final_exp_gadget = typename pairing_selector< ppT >::final_exp_gadget_type
 
template<typename FieldT , typename HashT >
using set_commitment_variable = digest_variable< FieldT >
 
template<typename ppT >
using kzg10_commitment_variable = G1_variable< ppT >
 
template<typename ppT >
using kzg10_witness_variable = G1_variable< ppT >
 
typedef size_t lc_index_t
 
template<typename T1 , typename T2 >
using knowledge_commitment_vector = sparse_vector< knowledge_commitment< T1, T2 > >
 
template<typename FieldT >
using bacs_variable_assignment = std::vector< FieldT >
 
template<typename FieldT >
using bacs_primary_input = bacs_variable_assignment< FieldT >
 
template<typename FieldT >
using bacs_auxiliary_input = bacs_variable_assignment< FieldT >
 
typedef std::vector< bool > tbcs_variable_assignment
 
typedef size_t tbcs_wire_t
 
typedef tbcs_variable_assignment tbcs_primary_input
 
typedef tbcs_variable_assignment tbcs_auxiliary_input
 
template<typename FieldT >
using r1cs_primary_input = std::vector< FieldT >
 
template<typename FieldT >
using r1cs_auxiliary_input = std::vector< FieldT >
 
template<typename FieldT >
using r1cs_variable_assignment = std::vector< FieldT >
 
template<typename FieldT >
using uscs_constraint = linear_combination< FieldT >
 
template<typename FieldT >
using uscs_primary_input = std::vector< FieldT >
 
template<typename FieldT >
using uscs_auxiliary_input = std::vector< FieldT >
 
template<typename FieldT >
using uscs_variable_assignment = std::vector< FieldT >
 
typedef std::map< size_t, size_t > memory_contents
 
typedef std::pair< size_t, size_t > address_and_value
 
typedef std::vector< size_t > fooram_program
 
typedef std::vector< size_t > fooram_input_tape
 
typedef std::vector< size_t >::const_iterator fooram_input_tape_iterator
 
template<typename ramT >
using ram_base_field = typename ramT::base_field_type
 
template<typename ramT >
using ram_cpu_state = libff::bit_vector
 
template<typename ramT >
using ram_boot_trace = memory_store_trace
 
template<typename ramT >
using ram_protoboard = typename ramT::protoboard_type
 
template<typename ramT >
using ram_gadget_base = typename ramT::gadget_base_type
 
template<typename ramT >
using ram_cpu_checker = typename ramT::cpu_checker_type
 
template<typename ramT >
using ram_architecture_params = typename ramT::architecture_params_type
 
template<typename ramT >
using ram_input_tape = std::vector< size_t >
 
typedef size_t reg_count_t
 
typedef size_t reg_width_t
 
typedef std::vector< size_t > tinyram_input_tape
 
typedef tinyram_input_tape::const_iterator tinyram_input_tape_iterator
 
typedef size_t var_index_t
 
typedef long integer_coeff_t
 
template<typename FieldT >
using r1cs_pcd_witness = std::vector< FieldT >
 
template<typename PCD_ppT >
using r1cs_mp_ppzkpcd_compliance_predicate = r1cs_pcd_compliance_predicate< libff::Fr< typename PCD_ppT::curve_A_pp > >
 
template<typename PCD_ppT >
using r1cs_mp_ppzkpcd_message = r1cs_pcd_message< libff::Fr< typename PCD_ppT::curve_A_pp > >
 
template<typename PCD_ppT >
using r1cs_mp_ppzkpcd_local_data = r1cs_pcd_local_data< libff::Fr< typename PCD_ppT::curve_A_pp > >
 
template<typename PCD_ppT >
using r1cs_mp_ppzkpcd_variable_assignment = r1cs_variable_assignment< libff::Fr< typename PCD_ppT::curve_A_pp > >
 
template<typename PCD_ppT >
using r1cs_mp_ppzkpcd_primary_input = r1cs_pcd_compliance_predicate_primary_input< libff::Fr< typename PCD_ppT::curve_A_pp > >
 
template<typename PCD_ppT >
using r1cs_mp_ppzkpcd_auxiliary_input = r1cs_pcd_compliance_predicate_auxiliary_input< libff::Fr< typename PCD_ppT::curve_A_pp > >
 
template<typename PCD_ppT >
using r1cs_sp_ppzkpcd_proof = r1cs_ppzksnark_proof< typename PCD_ppT::curve_B_pp >
 
template<typename PCD_ppT >
using r1cs_sp_ppzkpcd_compliance_predicate = r1cs_pcd_compliance_predicate< libff::Fr< typename PCD_ppT::curve_A_pp > >
 
template<typename PCD_ppT >
using r1cs_sp_ppzkpcd_message = r1cs_pcd_message< libff::Fr< typename PCD_ppT::curve_A_pp > >
 
template<typename PCD_ppT >
using r1cs_sp_ppzkpcd_local_data = r1cs_pcd_local_data< libff::Fr< typename PCD_ppT::curve_A_pp > >
 
template<typename PCD_ppT >
using r1cs_sp_ppzkpcd_primary_input = r1cs_pcd_compliance_predicate_primary_input< libff::Fr< typename PCD_ppT::curve_A_pp > >
 
template<typename PCD_ppT >
using r1cs_sp_ppzkpcd_auxiliary_input = r1cs_pcd_compliance_predicate_auxiliary_input< libff::Fr< typename PCD_ppT::curve_A_pp > >
 
template<typename r1cs_ppzkadsnark_ppT >
using snark_pp = typename r1cs_ppzkadsnark_ppT::snark_pp
 
template<typename r1cs_ppzkadsnark_ppT >
using r1cs_ppzkadsnark_constraint_system = r1cs_constraint_system< libff::Fr< snark_pp< r1cs_ppzkadsnark_ppT > >>
 
template<typename r1cs_ppzkadsnark_ppT >
using r1cs_ppzkadsnark_primary_input = r1cs_primary_input< libff::Fr< snark_pp< r1cs_ppzkadsnark_ppT > >>
 
template<typename r1cs_ppzkadsnark_ppT >
using r1cs_ppzkadsnark_auxiliary_input = r1cs_auxiliary_input< libff::Fr< snark_pp< r1cs_ppzkadsnark_ppT > >>
 
template<typename r1cs_ppzkadsnark_ppT >
using r1cs_ppzkadsnark_skT = typename r1cs_ppzkadsnark_ppT::skT
 
template<typename r1cs_ppzkadsnark_ppT >
using r1cs_ppzkadsnark_vkT = typename r1cs_ppzkadsnark_ppT::vkT
 
template<typename r1cs_ppzkadsnark_ppT >
using r1cs_ppzkadsnark_sigT = typename r1cs_ppzkadsnark_ppT::sigT
 
template<typename r1cs_ppzkadsnark_ppT >
using r1cs_ppzkadsnark_prfKeyT = typename r1cs_ppzkadsnark_ppT::prfKeyT
 
template<typename ppT >
using bacs_ppzksnark_verification_key = r1cs_ppzksnark_verification_key< ppT >
 
template<typename ppT >
using bacs_ppzksnark_processed_verification_key = r1cs_ppzksnark_processed_verification_key< ppT >
 
template<typename ppT >
using bacs_ppzksnark_proof = r1cs_ppzksnark_proof< ppT >
 
template<typename ppT >
using bacs_ppzksnark_circuit = bacs_circuit< libff::Fr< ppT > >
 
template<typename ppT >
using bacs_ppzksnark_primary_input = bacs_primary_input< libff::Fr< ppT > >
 
template<typename ppT >
using bacs_ppzksnark_auxiliary_input = bacs_auxiliary_input< libff::Fr< ppT > >
 
template<typename ppT >
using r1cs_gg_ppzksnark_constraint_system = r1cs_constraint_system< libff::Fr< ppT > >
 
template<typename ppT >
using r1cs_gg_ppzksnark_primary_input = r1cs_primary_input< libff::Fr< ppT > >
 
template<typename ppT >
using r1cs_gg_ppzksnark_auxiliary_input = r1cs_auxiliary_input< libff::Fr< ppT > >
 
template<typename ppT >
using r1cs_ppzksnark_constraint_system = r1cs_constraint_system< libff::Fr< ppT > >
 
template<typename ppT >
using r1cs_ppzksnark_primary_input = r1cs_primary_input< libff::Fr< ppT > >
 
template<typename ppT >
using r1cs_ppzksnark_auxiliary_input = r1cs_auxiliary_input< libff::Fr< ppT > >
 
template<typename ppT >
using r1cs_se_ppzksnark_constraint_system = r1cs_constraint_system< libff::Fr< ppT > >
 
template<typename ppT >
using r1cs_se_ppzksnark_primary_input = r1cs_primary_input< libff::Fr< ppT > >
 
template<typename ppT >
using r1cs_se_ppzksnark_auxiliary_input = r1cs_auxiliary_input< libff::Fr< ppT > >
 
template<typename ram_ppzksnark_ppT >
using ram_ppzksnark_proof = r1cs_ppzksnark_proof< ram_ppzksnark_snark_pp< ram_ppzksnark_ppT > >
 
template<typename ram_ppzksnark_ppT >
using ram_ppzksnark_snark_pp = typename ram_ppzksnark_ppT::snark_pp
 
template<typename ram_ppzksnark_ppT >
using ram_ppzksnark_machine_pp = typename ram_ppzksnark_ppT::machine_pp
 
template<typename ram_ppzksnark_ppT >
using ram_ppzksnark_architecture_params = ram_architecture_params< ram_ppzksnark_machine_pp< ram_ppzksnark_ppT > >
 
template<typename ram_ppzksnark_ppT >
using ram_ppzksnark_primary_input = ram_boot_trace< ram_ppzksnark_machine_pp< ram_ppzksnark_ppT > >
 
template<typename ram_ppzksnark_ppT >
using ram_ppzksnark_auxiliary_input = ram_input_tape< ram_ppzksnark_machine_pp< ram_ppzksnark_ppT > >
 
template<typename ppT >
using tbcs_ppzksnark_verification_key = uscs_ppzksnark_verification_key< ppT >
 
template<typename ppT >
using tbcs_ppzksnark_processed_verification_key = uscs_ppzksnark_processed_verification_key< ppT >
 
template<typename ppT >
using tbcs_ppzksnark_proof = uscs_ppzksnark_proof< ppT >
 
typedef tbcs_circuit tbcs_ppzksnark_circuit
 
typedef tbcs_primary_input tbcs_ppzksnark_primary_input
 
typedef tbcs_auxiliary_input tbcs_ppzksnark_auxiliary_input
 
template<typename ppT >
using uscs_ppzksnark_constraint_system = uscs_constraint_system< libff::Fr< ppT > >
 
template<typename ppT >
using uscs_ppzksnark_primary_input = uscs_primary_input< libff::Fr< ppT > >
 
template<typename ppT >
using uscs_ppzksnark_auxiliary_input = uscs_auxiliary_input< libff::Fr< ppT > >
 
template<typename ram_zksnark_ppT >
using ram_zksnark_PCD_pp = typename ram_zksnark_ppT::PCD_pp
 
template<typename ram_zksnark_ppT >
using ram_zksnark_machine_pp = typename ram_zksnark_ppT::machine_pp
 
template<typename ram_zksnark_ppT >
using ram_zksnark_architecture_params = ram_architecture_params< ram_zksnark_machine_pp< ram_zksnark_ppT > >
 
template<typename ram_zksnark_ppT >
using ram_zksnark_primary_input = ram_boot_trace< ram_zksnark_machine_pp< ram_zksnark_ppT > >
 
template<typename ram_zksnark_ppT >
using ram_zksnark_auxiliary_input = ram_input_tape< ram_zksnark_machine_pp< ram_zksnark_ppT > >
 

Enumerations

enum  tbcs_gate_type {
  TBCS_GATE_CONSTANT_0 = 0, TBCS_GATE_AND = 1, TBCS_GATE_X_AND_NOT_Y = 2, TBCS_GATE_X = 3,
  TBCS_GATE_NOT_X_AND_Y = 4, TBCS_GATE_Y = 5, TBCS_GATE_XOR = 6, TBCS_GATE_OR = 7,
  TBCS_GATE_NOR = 8, TBCS_GATE_EQUIVALENCE = 9, TBCS_GATE_NOT_Y = 10, TBCS_GATE_IF_Y_THEN_X = 11,
  TBCS_GATE_NOT_X = 12, TBCS_GATE_IF_X_THEN_Y = 13, TBCS_GATE_NAND = 14, TBCS_GATE_CONSTANT_1 = 15
}
 
enum  tinyram_opcode {
  tinyram_opcode_AND = 0b00000, tinyram_opcode_OR = 0b00001, tinyram_opcode_XOR = 0b00010, tinyram_opcode_NOT = 0b00011,
  tinyram_opcode_ADD = 0b00100, tinyram_opcode_SUB = 0b00101, tinyram_opcode_MULL = 0b00110, tinyram_opcode_UMULH = 0b00111,
  tinyram_opcode_SMULH = 0b01000, tinyram_opcode_UDIV = 0b01001, tinyram_opcode_UMOD = 0b01010, tinyram_opcode_SHL = 0b01011,
  tinyram_opcode_SHR = 0b01100, tinyram_opcode_CMPE = 0b01101, tinyram_opcode_CMPA = 0b01110, tinyram_opcode_CMPAE = 0b01111,
  tinyram_opcode_CMPG = 0b10000, tinyram_opcode_CMPGE = 0b10001, tinyram_opcode_MOV = 0b10010, tinyram_opcode_CMOV = 0b10011,
  tinyram_opcode_JMP = 0b10100, tinyram_opcode_CJMP = 0b10101, tinyram_opcode_CNJMP = 0b10110, tinyram_opcode_10111 = 0b10111,
  tinyram_opcode_11000 = 0b11000, tinyram_opcode_11001 = 0b11001, tinyram_opcode_STOREB = 0b11010, tinyram_opcode_LOADB = 0b11011,
  tinyram_opcode_STOREW = 0b11100, tinyram_opcode_LOADW = 0b11101, tinyram_opcode_READ = 0b11110, tinyram_opcode_ANSWER = 0b11111
}
 
enum  tinyram_opcode_args {
  tinyram_opcode_args_des_arg1_arg2 = 1, tinyram_opcode_args_des_arg2 = 2, tinyram_opcode_args_arg1_arg2 = 3, tinyram_opcode_args_arg2 = 4,
  tinyram_opcode_args_none = 5, tinyram_opcode_args_arg2_des = 6
}
 

Functions

template<typename T >
std::ostream & operator<< (std::ostream &out, const accumulation_vector< T > &v)
 
template<typename T >
std::istream & operator>> (std::istream &in, accumulation_vector< T > &v)
 
std::ostream & operator<< (std::ostream &out, const set_membership_proof &proof)
 
std::istream & operator>> (std::istream &in, set_membership_proof &proof)
 
template<typename T >
std::ostream & operator<< (std::ostream &out, const sparse_vector< T > &v)
 
template<typename T >
std::istream & operator>> (std::istream &in, sparse_vector< T > &v)
 
size_t as_waksman_top_height (const size_t num_packets)
 
size_t as_waksman_switch_output (const size_t num_packets, const size_t row_offset, const size_t row_idx, const bool use_top)
 
size_t as_waksman_switch_input (const size_t num_packets, const size_t row_offset, const size_t row_idx, const bool use_top)
 
size_t as_waksman_num_columns (const size_t num_packets)
 
void construct_as_waksman_inner (const size_t left, const size_t right, const size_t lo, const size_t hi, const std::vector< size_t > rhs_dests, as_waksman_topology &neighbors)
 
as_waksman_topology generate_as_waksman_topology (const size_t num_packets)
 
size_t as_waksman_get_canonical_row_idx (const size_t row_offset, const size_t row_idx)
 
bool as_waksman_get_switch_setting_from_top_bottom_decision (const size_t row_offset, const size_t packet_idx, const bool use_top)
 
bool as_waksman_get_top_bottom_decision_from_switch_setting (const size_t row_offset, const size_t packet_idx, const bool switch_setting)
 
size_t as_waksman_other_output_position (const size_t row_offset, const size_t packet_idx)
 
size_t as_waksman_other_input_position (const size_t row_offset, const size_t packet_idx)
 
void as_waksman_route_inner (const size_t left, const size_t right, const size_t lo, const size_t hi, const integer_permutation &permutation, const integer_permutation &permutation_inv, as_waksman_routing &routing)
 
as_waksman_routing get_as_waksman_routing (const integer_permutation &permutation)
 
bool valid_as_waksman_routing (const integer_permutation &permutation, const as_waksman_routing &routing)
 
size_t benes_cross_edge_mask (const size_t dimension, const size_t column_idx)
 
size_t benes_lhs_packet_destination (const size_t dimension, const size_t column_idx, const size_t row_idx, const bool use_top)
 
size_t benes_rhs_packet_source (const size_t dimension, const size_t column_idx, const size_t row_idx, const bool use_top)
 
bool benes_get_switch_setting_from_subnetwork (const size_t dimension, const size_t column_idx, const size_t row_idx, const bool use_top)
 
size_t benes_packet_cross_destination (const size_t dimension, const size_t column_idx, const size_t row_idx)
 
size_t benes_packet_cross_source (const size_t dimension, const size_t column_idx, const size_t packet_idx)
 
size_t benes_num_columns (const size_t num_packets)
 
benes_topology generate_benes_topology (const size_t num_packets)
 
void route_benes_inner (const size_t dimension, const integer_permutation &permutation, const integer_permutation &permutation_inv, const size_t column_idx_start, const size_t column_idx_end, const size_t subnetwork_offset, const size_t subnetwork_size, benes_routing &routing)
 
benes_routing get_benes_routing (const integer_permutation &permutation)
 
template<typename T >
std::vector< std::vector< T > > route_by_benes (const benes_routing &routing, const std::vector< T > &start)
 
bool valid_benes_routing (const integer_permutation &permutation, const benes_routing &routing)
 
size_t PRINT_CONSTRAINT_PROFILING ()
 
template<typename FieldT >
r1cs_example< FieldT > gen_r1cs_example_from_protoboard (const size_t num_constraints, const size_t num_inputs)
 
template<typename FieldT >
void generate_boolean_r1cs_constraint (protoboard< FieldT > &pb, const pb_linear_combination< FieldT > &lc, const std::string &annotation_prefix="")
 
template<typename FieldT >
void generate_r1cs_equals_const_constraint (protoboard< FieldT > &pb, const pb_linear_combination< FieldT > &lc, const FieldT &c, const std::string &annotation_prefix="")
 
template<typename FieldT , typename VarT >
void create_linear_combination_constraints (protoboard< FieldT > &pb, const std::vector< FieldT > &base, const std::vector< std::pair< VarT, FieldT >> &v, const VarT &target, const std::string &annotation_prefix)
 
template<typename FieldT , typename VarT >
void create_linear_combination_witness (protoboard< FieldT > &pb, const std::vector< FieldT > &base, const std::vector< std::pair< VarT, FieldT >> &v, const VarT &target)
 
template<typename FieldT >
void test_ALU_and_gadget (const size_t w)
 
template<typename FieldT >
void test_ALU_or_gadget (const size_t w)
 
template<typename FieldT >
void test_ALU_xor_gadget (const size_t w)
 
template<typename FieldT >
void test_ALU_not_gadget (const size_t w)
 
void test_ALU_add_gadget (const size_t w)
 
void test_ALU_sub_gadget (const size_t w)
 
template<typename FieldT >
void test_ALU_mov_gadget (const size_t w)
 
template<typename FieldT >
void test_ALU_cmov_gadget (const size_t w)
 
template<typename FieldT >
void test_ALU_cmpe_gadget (const size_t w)
 
template<typename FieldT >
void test_ALU_cmpa_gadget (const size_t w)
 
template<typename FieldT >
void test_ALU_cmpae_gadget (const size_t w)
 
template<typename FieldT >
void test_ALU_cmpg_gadget (const size_t w)
 
template<typename FieldT >
void test_ALU_cmpge_gadget (const size_t w)
 
template<typename FieldT >
void test_ALU_mull_gadget (const size_t w)
 
template<typename FieldT >
void test_ALU_umulh_gadget (const size_t w)
 
template<typename FieldT >
void test_ALU_smulh_gadget (const size_t w)
 
template<typename FieldT >
void test_ALU_udiv_gadget (const size_t w)
 
template<typename FieldT >
void test_ALU_umod_gadget (const size_t w)
 
template<typename FieldT >
void test_ALU_shr_gadget (const size_t w)
 
template<typename FieldT >
void test_ALU_shl_gadget (const size_t w)
 
template<typename FieldT >
void test_ALU_jmp_gadget ()
 
template<typename FieldT >
void test_ALU_cjmp_gadget ()
 
template<typename FieldT >
void test_ALU_cnjmp_gadget ()
 
template<typename FieldT >
void test_argument_decoder_gadget ()
 
template<typename FpkT , template< class > class Fpk_variableT, template< class > class Fpk_mul_gadgetT, template< class > class Fpk_sqr_gadgetT, mp_size_t m>
void test_exponentiation_gadget (const libff::bigint< m > &power, const std::string &annotation)
 
template<typename Fp12T >
Fp6_3over2_variable< typename Fp12T::my_Fp6 > fp6_mul_by_non_residue (protoboard< typename Fp12T::my_Fp > &pb, const Fp6_3over2_variable< typename Fp12T::my_Fp6 > &c, const std::string &annotation_prefix)
 
template<typename Fp12T >
Fp6_3over2_variable< typename Fp12T::my_Fp6 > fp6_mul_by_non_residue_inverse (protoboard< typename Fp12T::my_Fp > &pb, const Fp6_3over2_variable< typename Fp12T::my_Fp6 > &c, const std::string &annotation_prefix)
 
template<typename FieldT >
void test_knapsack_CRH_with_bit_out_gadget ()
 
template<typename FieldT >
pb_linear_combination_array< FieldT > SHA256_default_IV (protoboard< FieldT > &pb)
 
template<typename FieldT , typename HashT >
void test_merkle_tree_check_read_gadget ()
 
template<typename FieldT , typename HashT >
void test_merkle_tree_check_update_gadget ()
 
template<typename wppT >
G2_variable< wppT > bls12_377_g2_untwist_frobenius_twist (protoboard< libff::Fr< wppT >> &pb, const G2_variable< wppT > &g2, size_t exp, const std::string &annotation_prefix)
 
template<typename FieldT >
void test_as_waksman_routing_gadget (const size_t num_packets, const size_t packet_size)
 
template<typename FieldT >
void test_benes_routing_gadget (const size_t num_packets, const size_t packet_size)
 
template<typename FieldT , typename HashT >
void test_set_commitment_gadget ()
 
template<typename FieldT >
pb_variable< FieldT > pb_variable_allocate (protoboard< FieldT > &pb, const std::string &annotation)
 
template<typename FieldT >
linear_combination< FieldT > pb_sum (const pb_linear_combination_array< FieldT > &v)
 
template<typename FieldT >
linear_combination< FieldT > pb_packing_sum (const pb_linear_combination_array< FieldT > &v)
 
template<typename FieldT >
linear_combination< FieldT > pb_coeff_sum (const pb_linear_combination_array< FieldT > &v, const std::vector< FieldT > &coeffs)
 
r1cs_example< libff::Fr< libff::default_ec_pp > > gen_r1cs_example_from_gadgetlib2_protoboard (const size_t size)
 
linear_combination< libff::Fr< libff::default_ec_pp > > convert_gadgetlib2_linear_combination (const gadgetlib2::GadgetLibAdapter::linear_combination_t &lc)
 
r1cs_constraint_system< libff::Fr< libff::default_ec_pp > > get_constraint_system_from_gadgetlib2 (const gadgetlib2::Protoboard &pb)
 
r1cs_variable_assignment< libff::Fr< libff::default_ec_pp > > get_variable_assignment_from_gadgetlib2 (const gadgetlib2::Protoboard &pb)
 
template<typename T1 , typename T2 , mp_size_t n>
knowledge_commitment< T1, T2 > opt_window_wnaf_exp (const knowledge_commitment< T1, T2 > &base, const libff::bigint< n > &scalar, const size_t scalar_bits)
 
template<typename T1 , typename T2 , typename FieldT , libff::multi_exp_method Method, libff::multi_exp_base_form BaseForm = libff::multi_exp_base_form_normal>
knowledge_commitment< T1, T2 > kc_multi_exp_with_mixed_addition (const knowledge_commitment_vector< T1, T2 > &vec, const size_t min_idx, const size_t max_idx, typename std::vector< FieldT >::const_iterator scalar_start, typename std::vector< FieldT >::const_iterator scalar_end, const size_t chunks)
 
template<typename T1 , typename T2 , typename FieldT >
knowledge_commitment_vector< T1, T2 > kc_batch_exp (const size_t scalar_size, const size_t T1_window, const size_t T2_window, const libff::window_table< T1 > &T1_table, const libff::window_table< T2 > &T2_table, const FieldT &T1_coeff, const FieldT &T2_coeff, const std::vector< FieldT > &v, const size_t suggested_num_chunks, const bool output_special=false)
 
template<typename T1 , typename T2 , mp_size_t m>
knowledge_commitment< T1, T2 > operator* (const libff::bigint< m > &lhs, const knowledge_commitment< T1, T2 > &rhs)
 
template<typename T1 , typename T2 , mp_size_t m, const libff::bigint< m > & modulus_p>
knowledge_commitment< T1, T2 > operator* (const libff::Fp_model< m, modulus_p > &lhs, const knowledge_commitment< T1, T2 > &rhs)
 
template<typename T1 , typename T2 >
std::ostream & operator<< (std::ostream &out, const knowledge_commitment< T1, T2 > &kc)
 
template<typename T1 , typename T2 >
std::istream & operator>> (std::istream &in, knowledge_commitment< T1, T2 > &kc)
 
template<typename FieldT >
r1cs_constraint_system< FieldT > bacs_to_r1cs_instance_map (const bacs_circuit< FieldT > &circuit)
 
template<typename FieldT >
r1cs_variable_assignment< FieldT > bacs_to_r1cs_witness_map (const bacs_circuit< FieldT > &circuit, const bacs_primary_input< FieldT > &primary_input, const bacs_auxiliary_input< FieldT > &auxiliary_input)
 
template<typename FieldT >
qap_instance< FieldT > r1cs_to_qap_instance_map (const r1cs_constraint_system< FieldT > &cs, bool force_pow_2_domain=false)
 
template<typename FieldT >
qap_instance_evaluation< FieldT > r1cs_to_qap_instance_map_with_evaluation (const r1cs_constraint_system< FieldT > &cs, const FieldT &t, bool force_pow_2_domain=false)
 
template<typename FieldT >
qap_witness< FieldT > r1cs_to_qap_witness_map (const r1cs_constraint_system< FieldT > &cs, const r1cs_primary_input< FieldT > &primary_input, const r1cs_auxiliary_input< FieldT > &auxiliary_input, const FieldT &d1, const FieldT &d2, const FieldT &d3, bool force_pow_2_domain=false)
 
template<typename FieldT >
std::shared_ptr< libfqfft::evaluation_domain< FieldT > > r1cs_to_sap_get_domain (const r1cs_constraint_system< FieldT > &cs)
 
template<typename FieldT >
sap_instance< FieldT > r1cs_to_sap_instance_map (const r1cs_constraint_system< FieldT > &cs)
 
template<typename FieldT >
sap_instance_evaluation< FieldT > r1cs_to_sap_instance_map_with_evaluation (const r1cs_constraint_system< FieldT > &cs, const FieldT &t)
 
template<typename FieldT >
sap_witness< FieldT > r1cs_to_sap_witness_map (const r1cs_constraint_system< FieldT > &cs, const r1cs_primary_input< FieldT > &primary_input, const r1cs_auxiliary_input< FieldT > &auxiliary_input, const FieldT &d1, const FieldT &d2)
 
template<typename FieldT >
uscs_constraint_system< FieldT > tbcs_to_uscs_instance_map (const tbcs_circuit &circuit)
 
template<typename FieldT >
uscs_variable_assignment< FieldT > tbcs_to_uscs_witness_map (const tbcs_circuit &circuit, const tbcs_primary_input &primary_input, const tbcs_auxiliary_input &auxiliary_input)
 
template<typename FieldT >
ssp_instance< FieldT > uscs_to_ssp_instance_map (const uscs_constraint_system< FieldT > &cs)
 
template<typename FieldT >
ssp_instance_evaluation< FieldT > uscs_to_ssp_instance_map_with_evaluation (const uscs_constraint_system< FieldT > &cs, const FieldT &t)
 
template<typename FieldT >
ssp_witness< FieldT > uscs_to_ssp_witness_map (const uscs_constraint_system< FieldT > &cs, const uscs_primary_input< FieldT > &primary_input, const uscs_auxiliary_input< FieldT > &auxiliary_input, const FieldT &d)
 
template<typename FieldT >
std::ostream & operator<< (std::ostream &out, const bacs_gate< FieldT > &g)
 
template<typename FieldT >
std::istream & operator>> (std::istream &in, bacs_gate< FieldT > &g)
 
template<typename FieldT >
std::ostream & operator<< (std::ostream &out, const bacs_circuit< FieldT > &circuit)
 
template<typename FieldT >
std::istream & operator>> (std::istream &in, bacs_circuit< FieldT > &circuit)
 
template<typename FieldT >
bacs_example< FieldT > generate_bacs_example (const size_t primary_input_size, const size_t auxiliary_input_size, const size_t num_gates, const size_t num_outputs)
 
tbcs_example generate_tbcs_example (const size_t primary_input_size, const size_t auxiliary_input_size, const size_t num_gates, const size_t num_outputs)
 
void print_tbcs_wire (const tbcs_wire_t wire, const std::map< size_t, std::string > &variable_annotations)
 
std::ostream & operator<< (std::ostream &out, const tbcs_gate &g)
 
std::istream & operator>> (std::istream &in, tbcs_gate &g)
 
std::ostream & operator<< (std::ostream &out, const tbcs_circuit &circuit)
 
std::istream & operator>> (std::istream &in, tbcs_circuit &circuit)
 
template<typename FieldT >
r1cs_example< FieldT > generate_r1cs_example_with_field_input (const size_t num_constraints, const size_t num_inputs)
 
template<typename FieldT >
r1cs_example< FieldT > generate_r1cs_example_with_binary_input (const size_t num_constraints, const size_t num_inputs)
 
template<typename FieldT >
std::ostream & operator<< (std::ostream &out, const r1cs_constraint< FieldT > &c)
 
template<typename FieldT >
std::istream & operator>> (std::istream &in, r1cs_constraint< FieldT > &c)
 
template<typename FieldT >
std::ostream & operator<< (std::ostream &out, const r1cs_constraint_system< FieldT > &cs)
 
template<typename FieldT >
std::istream & operator>> (std::istream &in, r1cs_constraint_system< FieldT > &cs)
 
template<typename FieldT >
uscs_example< FieldT > generate_uscs_example_with_field_input (const size_t num_constraints, const size_t num_inputs)
 
template<typename FieldT >
uscs_example< FieldT > generate_uscs_example_with_binary_input (const size_t num_constraints, const size_t num_inputs)
 
template<typename FieldT >
std::ostream & operator<< (std::ostream &out, const uscs_constraint_system< FieldT > &cs)
 
template<typename FieldT >
std::istream & operator>> (std::istream &in, uscs_constraint_system< FieldT > &cs)
 
memory_contents block_memory_contents (const size_t num_addresses, const size_t value_size, const size_t block1_size, const size_t block2_size)
 
memory_contents random_memory_contents (const size_t num_addresses, const size_t value_size, const size_t num_filled)
 
template<typename ramT >
ram_example< ramT > gen_ram_example_simple (const ram_architecture_params< ramT > &ap, const size_t boot_trace_size_bound, const size_t time_bound, const bool satisfiable=true)
 
template<typename ramT >
ram_example< ramT > gen_ram_example_complex (const ram_architecture_params< ramT > &ap, const size_t boot_trace_size_bound, const size_t time_bound, const bool satisfiable=true)
 
std::ostream & operator<< (std::ostream &out, const fooram_architecture_params &ap)
 
std::istream & operator>> (std::istream &in, fooram_architecture_params &ap)
 
void ensure_tinyram_opcode_value_map ()
 
std::vector< tinyram_instructiongenerate_tinyram_prelude (const tinyram_architecture_params &ap)
 
std::ostream & operator<< (std::ostream &out, const tinyram_architecture_params &ap)
 
std::istream & operator>> (std::istream &in, tinyram_architecture_params &ap)
 
tinyram_instruction random_tinyram_instruction (const tinyram_architecture_params &ap)
 
tinyram_program load_preprocessed_program (const tinyram_architecture_params &ap, std::istream &preprocessed)
 
memory_store_trace tinyram_boot_trace_from_program_and_input (const tinyram_architecture_params &ap, const size_t boot_trace_size_bound, const tinyram_program &program, const tinyram_input_tape &primary_input)
 
tinyram_input_tape load_tape (std::istream &tape)
 
template<typename FieldT >
linear_term< FieldT > operator* (const integer_coeff_t int_coeff, const variable< FieldT > &var)
 
template<typename FieldT >
linear_term< FieldT > operator* (const FieldT &field_coeff, const variable< FieldT > &var)
 
template<typename FieldT >
linear_combination< FieldT > operator+ (const integer_coeff_t int_coeff, const variable< FieldT > &var)
 
template<typename FieldT >
linear_combination< FieldT > operator+ (const FieldT &field_coeff, const variable< FieldT > &var)
 
template<typename FieldT >
linear_combination< FieldT > operator- (const integer_coeff_t int_coeff, const variable< FieldT > &var)
 
template<typename FieldT >
linear_combination< FieldT > operator- (const FieldT &field_coeff, const variable< FieldT > &var)
 
template<typename FieldT >
linear_term< FieldT > operator* (const integer_coeff_t int_coeff, const linear_term< FieldT > &lt)
 
template<typename FieldT >
linear_term< FieldT > operator* (const FieldT &field_coeff, const linear_term< FieldT > &lt)
 
template<typename FieldT >
linear_combination< FieldT > operator+ (const integer_coeff_t int_coeff, const linear_term< FieldT > &lt)
 
template<typename FieldT >
linear_combination< FieldT > operator+ (const FieldT &field_coeff, const linear_term< FieldT > &lt)
 
template<typename FieldT >
linear_combination< FieldT > operator- (const integer_coeff_t int_coeff, const linear_term< FieldT > &lt)
 
template<typename FieldT >
linear_combination< FieldT > operator- (const FieldT &field_coeff, const linear_term< FieldT > &lt)
 
template<typename FieldT >
std::ostream & operator<< (std::ostream &out, const linear_combination< FieldT > &lc)
 
template<typename FieldT >
std::istream & operator>> (std::istream &in, linear_combination< FieldT > &lc)
 
template<typename FieldT >
linear_combination< FieldT > operator* (const integer_coeff_t int_coeff, const linear_combination< FieldT > &lc)
 
template<typename FieldT >
linear_combination< FieldT > operator* (const FieldT &field_coeff, const linear_combination< FieldT > &lc)
 
template<typename FieldT >
linear_combination< FieldT > operator+ (const integer_coeff_t int_coeff, const linear_combination< FieldT > &lc)
 
template<typename FieldT >
linear_combination< FieldT > operator+ (const FieldT &field_coeff, const linear_combination< FieldT > &lc)
 
template<typename FieldT >
linear_combination< FieldT > operator- (const integer_coeff_t int_coeff, const linear_combination< FieldT > &lc)
 
template<typename FieldT >
linear_combination< FieldT > operator- (const FieldT &field_coeff, const linear_combination< FieldT > &lc)
 
template<typename FieldT >
std::ostream & operator<< (std::ostream &out, const r1cs_pcd_compliance_predicate< FieldT > &cp)
 
template<typename FieldT >
std::istream & operator>> (std::istream &in, r1cs_pcd_compliance_predicate< FieldT > &cp)
 
template<typename PCD_ppT >
bool run_r1cs_mp_ppzkpcd_tally_example (const size_t wordsize, const size_t max_arity, const size_t depth, const bool test_serialization, const bool test_multi_type, const bool test_same_type_optimization)
 
template<typename ppT >
r1cs_primary_input< libff::Fr< ppT > > get_mp_compliance_step_pcd_circuit_input (const set_commitment &commitment_to_translation_step_r1cs_vks, const r1cs_pcd_compliance_predicate_primary_input< libff::Fr< ppT >> &primary_input)
 
template<typename ppT >
r1cs_primary_input< libff::Fr< ppT > > get_mp_translation_step_pcd_circuit_input (const set_commitment &commitment_to_translation_step_r1cs_vks, const r1cs_pcd_compliance_predicate_primary_input< libff::Fr< other_curve< ppT >>> &primary_input)
 
template<typename PCD_ppT >
std::ostream & operator<< (std::ostream &out, const r1cs_mp_ppzkpcd_proving_key< PCD_ppT > &pk)
 
template<typename PCD_ppT >
std::istream & operator>> (std::istream &in, r1cs_mp_ppzkpcd_proving_key< PCD_ppT > &pk)
 
template<typename PCD_ppT >
std::ostream & operator<< (std::ostream &out, const r1cs_mp_ppzkpcd_verification_key< PCD_ppT > &vk)
 
template<typename PCD_ppT >
std::istream & operator>> (std::istream &in, r1cs_mp_ppzkpcd_verification_key< PCD_ppT > &vk)
 
template<typename PCD_ppT >
std::ostream & operator<< (std::ostream &out, const r1cs_mp_ppzkpcd_processed_verification_key< PCD_ppT > &pvk)
 
template<typename PCD_ppT >
std::istream & operator>> (std::istream &in, r1cs_mp_ppzkpcd_processed_verification_key< PCD_ppT > &pvk)
 
template<typename ppT >
std::ostream & operator<< (std::ostream &out, const r1cs_mp_ppzkpcd_proof< ppT > &proof)
 
template<typename ppT >
std::istream & operator>> (std::istream &in, r1cs_mp_ppzkpcd_proof< ppT > &proof)
 
template<typename PCD_ppT >
r1cs_mp_ppzkpcd_keypair< PCD_ppT > r1cs_mp_ppzkpcd_generator (const std::vector< r1cs_mp_ppzkpcd_compliance_predicate< PCD_ppT >> &compliance_predicates)
 
template<typename PCD_ppT >
r1cs_mp_ppzkpcd_proof< PCD_ppT > r1cs_mp_ppzkpcd_prover (const r1cs_mp_ppzkpcd_proving_key< PCD_ppT > &pk, const size_t compliance_predicate_name, const r1cs_mp_ppzkpcd_primary_input< PCD_ppT > &primary_input, const r1cs_mp_ppzkpcd_auxiliary_input< PCD_ppT > &auxiliary_input, const std::vector< r1cs_mp_ppzkpcd_proof< PCD_ppT >> &incoming_proofs)
 
template<typename PCD_ppT >
bool r1cs_mp_ppzkpcd_verifier (const r1cs_mp_ppzkpcd_verification_key< PCD_ppT > &vk, const r1cs_mp_ppzkpcd_primary_input< PCD_ppT > &primary_input, const r1cs_mp_ppzkpcd_proof< PCD_ppT > &proof)
 
template<typename PCD_ppT >
r1cs_mp_ppzkpcd_processed_verification_key< PCD_ppT > r1cs_mp_ppzkpcd_process_vk (const r1cs_mp_ppzkpcd_verification_key< PCD_ppT > &vk)
 
template<typename PCD_ppT >
bool r1cs_mp_ppzkpcd_online_verifier (const r1cs_mp_ppzkpcd_processed_verification_key< PCD_ppT > &pvk, const r1cs_mp_ppzkpcd_primary_input< PCD_ppT > &primary_input, const r1cs_mp_ppzkpcd_proof< PCD_ppT > &proof)
 
template<typename PCD_ppT >
bool run_r1cs_sp_ppzkpcd_tally_example (const size_t wordsize, const size_t arity, const size_t depth, const bool test_serialization)
 
template<typename PCD_ppT >
std::ostream & operator<< (std::ostream &out, const r1cs_sp_ppzkpcd_proving_key< PCD_ppT > &pk)
 
template<typename PCD_ppT >
std::istream & operator>> (std::istream &in, r1cs_sp_ppzkpcd_proving_key< PCD_ppT > &pk)
 
template<typename PCD_ppT >
std::ostream & operator<< (std::ostream &out, const r1cs_sp_ppzkpcd_verification_key< PCD_ppT > &vk)
 
template<typename PCD_ppT >
std::istream & operator>> (std::istream &in, r1cs_sp_ppzkpcd_verification_key< PCD_ppT > &vk)
 
template<typename PCD_ppT >
std::ostream & operator<< (std::ostream &out, const r1cs_sp_ppzkpcd_processed_verification_key< PCD_ppT > &pvk)
 
template<typename PCD_ppT >
std::istream & operator>> (std::istream &in, r1cs_sp_ppzkpcd_processed_verification_key< PCD_ppT > &pvk)
 
template<typename PCD_ppT >
r1cs_sp_ppzkpcd_keypair< PCD_ppT > r1cs_sp_ppzkpcd_generator (const r1cs_sp_ppzkpcd_compliance_predicate< PCD_ppT > &compliance_predicate)
 
template<typename PCD_ppT >
r1cs_sp_ppzkpcd_proof< PCD_ppT > r1cs_sp_ppzkpcd_prover (const r1cs_sp_ppzkpcd_proving_key< PCD_ppT > &pk, const r1cs_sp_ppzkpcd_primary_input< PCD_ppT > &primary_input, const r1cs_sp_ppzkpcd_auxiliary_input< PCD_ppT > &auxiliary_input, const std::vector< r1cs_sp_ppzkpcd_proof< PCD_ppT >> &incoming_proofs)
 
template<typename PCD_ppT >
bool r1cs_sp_ppzkpcd_verifier (const r1cs_sp_ppzkpcd_verification_key< PCD_ppT > &vk, const r1cs_sp_ppzkpcd_primary_input< PCD_ppT > &primary_input, const r1cs_sp_ppzkpcd_proof< PCD_ppT > &proof)
 
template<typename PCD_ppT >
r1cs_sp_ppzkpcd_processed_verification_key< PCD_ppT > r1cs_sp_ppzkpcd_process_vk (const r1cs_sp_ppzkpcd_verification_key< PCD_ppT > &vk)
 
template<typename PCD_ppT >
bool r1cs_sp_ppzkpcd_online_verifier (const r1cs_sp_ppzkpcd_processed_verification_key< PCD_ppT > &pvk, const r1cs_sp_ppzkpcd_primary_input< PCD_ppT > &primary_input, const r1cs_sp_ppzkpcd_proof< PCD_ppT > &proof)
 
template<typename ppT >
r1cs_primary_input< libff::Fr< ppT > > get_sp_compliance_step_pcd_circuit_input (const libff::bit_vector &sp_translation_step_vk_bits, const r1cs_pcd_compliance_predicate_primary_input< libff::Fr< ppT >> &primary_input)
 
template<typename ppT >
r1cs_primary_input< libff::Fr< ppT > > get_sp_translation_step_pcd_circuit_input (const libff::bit_vector &sp_translation_step_vk_bits, const r1cs_pcd_compliance_predicate_primary_input< libff::Fr< other_curve< ppT >>> &primary_input)
 
template<typename ppT >
bool run_r1cs_ppzkadsnark (const r1cs_example< libff::Fr< snark_pp< ppT >>> &example, const bool test_serialization)
 
template<typename ppT >
std::ostream & operator<< (std::ostream &out, const r1cs_ppzkadsnark_pub_auth_prms< ppT > &pap)
 
template<typename ppT >
std::istream & operator>> (std::istream &in, r1cs_ppzkadsnark_pub_auth_prms< ppT > &pap)
 
template<typename ppT >
std::ostream & operator<< (std::ostream &out, const r1cs_ppzkadsnark_sec_auth_key< ppT > &key)
 
template<typename ppT >
std::istream & operator>> (std::istream &in, r1cs_ppzkadsnark_sec_auth_key< ppT > &key)
 
template<typename ppT >
std::ostream & operator<< (std::ostream &out, const r1cs_ppzkadsnark_pub_auth_key< ppT > &key)
 
template<typename ppT >
std::istream & operator>> (std::istream &in, r1cs_ppzkadsnark_pub_auth_key< ppT > &key)
 
template<typename ppT >
std::ostream & operator<< (std::ostream &out, const r1cs_ppzkadsnark_auth_data< ppT > &data)
 
template<typename ppT >
std::istream & operator>> (std::istream &in, r1cs_ppzkadsnark_auth_data< ppT > &data)
 
template<typename ppT >
std::ostream & operator<< (std::ostream &out, const r1cs_ppzkadsnark_proving_key< ppT > &pk)
 
template<typename ppT >
std::istream & operator>> (std::istream &in, r1cs_ppzkadsnark_proving_key< ppT > &pk)
 
template<typename ppT >
std::ostream & operator<< (std::ostream &out, const r1cs_ppzkadsnark_verification_key< ppT > &vk)
 
template<typename ppT >
std::istream & operator>> (std::istream &in, r1cs_ppzkadsnark_verification_key< ppT > &vk)
 
template<typename ppT >
std::ostream & operator<< (std::ostream &out, const r1cs_ppzkadsnark_processed_verification_key< ppT > &pvk)
 
template<typename ppT >
std::istream & operator>> (std::istream &in, r1cs_ppzkadsnark_processed_verification_key< ppT > &pvk)
 
template<typename ppT >
std::ostream & operator<< (std::ostream &out, const r1cs_ppzkadsnark_proof< ppT > &proof)
 
template<typename ppT >
std::istream & operator>> (std::istream &in, r1cs_ppzkadsnark_proof< ppT > &proof)
 
template<typename ppT , libff::multi_exp_base_form BaseForm = libff::multi_exp_base_form_normal>
r1cs_ppzkadsnark_auth_keys< ppT > r1cs_ppzkadsnark_auth_generator (void)
 
template<typename ppT >
std::vector< r1cs_ppzkadsnark_auth_data< ppT > > r1cs_ppzkadsnark_auth_sign (const std::vector< libff::Fr< snark_pp< ppT >>> &ins, const r1cs_ppzkadsnark_sec_auth_key< ppT > &sk, const std::vector< labelT > labels)
 
template<typename ppT >
bool r1cs_ppzkadsnark_auth_verify (const std::vector< libff::Fr< snark_pp< ppT >>> &data, const std::vector< r1cs_ppzkadsnark_auth_data< ppT >> &auth_data, const r1cs_ppzkadsnark_sec_auth_key< ppT > &sak, const std::vector< labelT > &labels)
 
template<typename ppT >
bool r1cs_ppzkadsnark_auth_verify (const std::vector< libff::Fr< snark_pp< ppT >>> &data, const std::vector< r1cs_ppzkadsnark_auth_data< ppT >> &auth_data, const r1cs_ppzkadsnark_pub_auth_key< ppT > &pak, const std::vector< labelT > &labels)
 
template<typename ppT >
r1cs_ppzkadsnark_keypair< ppT > r1cs_ppzkadsnark_generator (const r1cs_ppzkadsnark_constraint_system< ppT > &cs, const r1cs_ppzkadsnark_pub_auth_prms< ppT > &prms)
 
template<typename ppT >
r1cs_ppzkadsnark_proof< ppT > r1cs_ppzkadsnark_prover (const r1cs_ppzkadsnark_proving_key< ppT > &pk, const r1cs_ppzkadsnark_primary_input< ppT > &primary_input, const r1cs_ppzkadsnark_auxiliary_input< ppT > &auxiliary_input, const std::vector< r1cs_ppzkadsnark_auth_data< ppT >> &auth_data)
 
template<typename ppT >
r1cs_ppzkadsnark_processed_verification_key< ppT > r1cs_ppzkadsnark_verifier_process_vk (const r1cs_ppzkadsnark_verification_key< ppT > &vk)
 
template<typename ppT >
bool r1cs_ppzkadsnark_verifier (const r1cs_ppzkadsnark_verification_key< ppT > &vk, const r1cs_ppzkadsnark_proof< ppT > &proof, const r1cs_ppzkadsnark_sec_auth_key< ppT > &sak, const std::vector< labelT > &labels)
 
template<typename ppT >
bool r1cs_ppzkadsnark_online_verifier (const r1cs_ppzkadsnark_processed_verification_key< ppT > &pvk, const r1cs_ppzkadsnark_proof< ppT > &proof, const r1cs_ppzkadsnark_sec_auth_key< ppT > &sak, const std::vector< labelT > &labels)
 
template<typename ppT >
bool r1cs_ppzkadsnark_verifier (const r1cs_ppzkadsnark_verification_key< ppT > &vk, const std::vector< r1cs_ppzkadsnark_auth_data< ppT >> &auth_data, const r1cs_ppzkadsnark_proof< ppT > &proof, const r1cs_ppzkadsnark_pub_auth_key< ppT > &pak, const std::vector< labelT > &labels)
 
template<typename ppT >
bool r1cs_ppzkadsnark_online_verifier (const r1cs_ppzkadsnark_processed_verification_key< ppT > &pvk, const std::vector< r1cs_ppzkadsnark_auth_data< ppT >> &auth_data, const r1cs_ppzkadsnark_proof< ppT > &proof, const r1cs_ppzkadsnark_pub_auth_key< ppT > &pak, const std::vector< labelT > &labels)
 
template<typename ppT >
r1cs_ppzkadsnark_prfKeyT< ppT > prfGen ()
 
template<typename ppT >
libff::Fr< snark_pp< ppT > > prfCompute (const r1cs_ppzkadsnark_prfKeyT< ppT > &key, const labelT &label)
 
template<typename ppT >
kpT< ppT > sigGen (void)
 
template<typename ppT >
r1cs_ppzkadsnark_sigT< ppT > sigSign (const r1cs_ppzkadsnark_skT< ppT > &sk, const labelT &label, const libff::G2< snark_pp< ppT >> &Lambda)
 
template<typename ppT >
bool sigVerif (const r1cs_ppzkadsnark_vkT< ppT > &vk, const labelT &label, const libff::G2< snark_pp< ppT >> &Lambda, const r1cs_ppzkadsnark_sigT< ppT > &sig)
 
template<typename ppT >
bool sigBatchVerif (const r1cs_ppzkadsnark_vkT< ppT > &vk, const std::vector< labelT > &labels, const std::vector< libff::G2< snark_pp< ppT >>> &Lambdas, const std::vector< r1cs_ppzkadsnark_sigT< ppT >> &sigs)
 
template<typename ppT >
std::ostream & operator<< (std::ostream &out, const bacs_ppzksnark_proving_key< ppT > &pk)
 
template<typename ppT >
std::istream & operator>> (std::istream &in, bacs_ppzksnark_proving_key< ppT > &pk)
 
template<typename ppT >
bacs_ppzksnark_keypair< ppT > bacs_ppzksnark_generator (const bacs_ppzksnark_circuit< ppT > &circuit)
 
template<typename ppT >
bacs_ppzksnark_proof< ppT > bacs_ppzksnark_prover (const bacs_ppzksnark_proving_key< ppT > &pk, const bacs_ppzksnark_primary_input< ppT > &primary_input, const bacs_ppzksnark_auxiliary_input< ppT > &auxiliary_input)
 
template<typename ppT >
bool bacs_ppzksnark_verifier_weak_IC (const bacs_ppzksnark_verification_key< ppT > &vk, const bacs_ppzksnark_primary_input< ppT > &primary_input, const bacs_ppzksnark_proof< ppT > &proof)
 
template<typename ppT >
bool bacs_ppzksnark_verifier_strong_IC (const bacs_ppzksnark_verification_key< ppT > &vk, const bacs_ppzksnark_primary_input< ppT > &primary_input, const bacs_ppzksnark_proof< ppT > &proof)
 
template<typename ppT >
bacs_ppzksnark_processed_verification_key< ppT > bacs_ppzksnark_verifier_process_vk (const bacs_ppzksnark_verification_key< ppT > &vk)
 
template<typename ppT >
bool bacs_ppzksnark_online_verifier_weak_IC (const bacs_ppzksnark_processed_verification_key< ppT > &pvk, const bacs_ppzksnark_primary_input< ppT > &primary_input, const bacs_ppzksnark_proof< ppT > &proof)
 
template<typename ppT >
bool bacs_ppzksnark_online_verifier_strong_IC (const bacs_ppzksnark_processed_verification_key< ppT > &pvk, const bacs_ppzksnark_primary_input< ppT > &primary_input, const bacs_ppzksnark_proof< ppT > &proof)
 
template<typename ppT >
bool run_bacs_ppzksnark (const bacs_example< libff::Fr< ppT >> &example, const bool test_serialization)
 
template<typename ppT >
bool run_r1cs_gg_ppzksnark (const r1cs_example< libff::Fr< ppT >> &example, const bool test_serialization)
 
template<typename ppT >
std::ostream & operator<< (std::ostream &out, const r1cs_gg_ppzksnark_proving_key< ppT > &pk)
 
template<typename ppT >
std::istream & operator>> (std::istream &in, r1cs_gg_ppzksnark_proving_key< ppT > &pk)
 
template<typename ppT >
std::ostream & operator<< (std::ostream &out, const r1cs_gg_ppzksnark_verification_key< ppT > &vk)
 
template<typename ppT >
std::istream & operator>> (std::istream &in, r1cs_gg_ppzksnark_verification_key< ppT > &vk)
 
template<typename ppT >
std::ostream & operator<< (std::ostream &out, const r1cs_gg_ppzksnark_processed_verification_key< ppT > &pvk)
 
template<typename ppT >
std::istream & operator>> (std::istream &in, r1cs_gg_ppzksnark_processed_verification_key< ppT > &pvk)
 
template<typename ppT >
std::ostream & operator<< (std::ostream &out, const r1cs_gg_ppzksnark_proof< ppT > &proof)
 
template<typename ppT >
std::istream & operator>> (std::istream &in, r1cs_gg_ppzksnark_proof< ppT > &proof)
 
template<typename ppT , libff::multi_exp_base_form BaseForm = libff::multi_exp_base_form_special>
r1cs_gg_ppzksnark_keypair< ppT > r1cs_gg_ppzksnark_generator_from_secrets (const r1cs_gg_ppzksnark_constraint_system< ppT > &cs, const libff::Fr< ppT > &t, const libff::Fr< ppT > &alpha, const libff::Fr< ppT > &beta, const libff::Fr< ppT > &delta, const libff::G1< ppT > &g1_generator, const libff::G2< ppT > &g2_generator, bool force_pow_2_domain=false)
 
template<typename ppT , libff::multi_exp_base_form BaseForm = libff::multi_exp_base_form_special>
r1cs_gg_ppzksnark_keypair< ppT > r1cs_gg_ppzksnark_generator (const r1cs_gg_ppzksnark_constraint_system< ppT > &cs, bool force_pow_2_domain=false)
 
template<typename ppT , libff::multi_exp_method Method = libff::multi_exp_method_BDLO12_signed, libff::multi_exp_base_form BaseForm = libff::multi_exp_base_form_special>
r1cs_gg_ppzksnark_proof< ppT > r1cs_gg_ppzksnark_prover (const r1cs_gg_ppzksnark_proving_key< ppT > &pk, const r1cs_gg_ppzksnark_primary_input< ppT > &primary_input, const r1cs_gg_ppzksnark_auxiliary_input< ppT > &auxiliary_input, bool force_pow_2_domain=false)
 
template<typename ppT >
bool r1cs_gg_ppzksnark_verifier_weak_IC (const r1cs_gg_ppzksnark_verification_key< ppT > &vk, const r1cs_gg_ppzksnark_primary_input< ppT > &primary_input, const r1cs_gg_ppzksnark_proof< ppT > &proof)
 
template<typename ppT >
bool r1cs_gg_ppzksnark_verifier_strong_IC (const r1cs_gg_ppzksnark_verification_key< ppT > &vk, const r1cs_gg_ppzksnark_primary_input< ppT > &primary_input, const r1cs_gg_ppzksnark_proof< ppT > &proof)
 
template<typename ppT >
r1cs_gg_ppzksnark_processed_verification_key< ppT > r1cs_gg_ppzksnark_verifier_process_vk (const r1cs_gg_ppzksnark_verification_key< ppT > &vk)
 
template<typename ppT >
bool r1cs_gg_ppzksnark_online_verifier_weak_IC (const r1cs_gg_ppzksnark_processed_verification_key< ppT > &pvk, const r1cs_gg_ppzksnark_primary_input< ppT > &input, const r1cs_gg_ppzksnark_proof< ppT > &proof)
 
template<typename ppT >
bool r1cs_gg_ppzksnark_online_verifier_strong_IC (const r1cs_gg_ppzksnark_processed_verification_key< ppT > &pvk, const r1cs_gg_ppzksnark_primary_input< ppT > &primary_input, const r1cs_gg_ppzksnark_proof< ppT > &proof)
 
template<typename ppT >
bool r1cs_gg_ppzksnark_affine_verifier_weak_IC (const r1cs_gg_ppzksnark_verification_key< ppT > &vk, const r1cs_gg_ppzksnark_primary_input< ppT > &primary_input, const r1cs_gg_ppzksnark_proof< ppT > &proof)
 
template<typename ppT >
bool run_r1cs_ppzksnark (const r1cs_example< libff::Fr< ppT >> &example, const bool test_serialization)
 
template<typename ppT >
std::ostream & operator<< (std::ostream &out, const r1cs_ppzksnark_proving_key< ppT > &pk)
 
template<typename ppT >
std::istream & operator>> (std::istream &in, r1cs_ppzksnark_proving_key< ppT > &pk)
 
template<typename ppT >
std::ostream & operator<< (std::ostream &out, const r1cs_ppzksnark_verification_key< ppT > &vk)
 
template<typename ppT >
std::istream & operator>> (std::istream &in, r1cs_ppzksnark_verification_key< ppT > &vk)
 
template<typename ppT >
std::ostream & operator<< (std::ostream &out, const r1cs_ppzksnark_processed_verification_key< ppT > &pvk)
 
template<typename ppT >
std::istream & operator>> (std::istream &in, r1cs_ppzksnark_processed_verification_key< ppT > &pvk)
 
template<typename ppT >
std::ostream & operator<< (std::ostream &out, const r1cs_ppzksnark_proof< ppT > &proof)
 
template<typename ppT >
std::istream & operator>> (std::istream &in, r1cs_ppzksnark_proof< ppT > &proof)
 
template<typename ppT , libff::multi_exp_base_form BaseForm = libff::multi_exp_base_form_normal>
r1cs_ppzksnark_keypair< ppT > r1cs_ppzksnark_generator (const r1cs_ppzksnark_constraint_system< ppT > &cs)
 
template<typename ppT , libff::multi_exp_method Method = libff::multi_exp_method_bos_coster, libff::multi_exp_base_form BaseForm = libff::multi_exp_base_form_normal>
r1cs_ppzksnark_proof< ppT > r1cs_ppzksnark_prover (const r1cs_ppzksnark_proving_key< ppT > &pk, const r1cs_ppzksnark_primary_input< ppT > &primary_input, const r1cs_ppzksnark_auxiliary_input< ppT > &auxiliary_input)
 
template<typename ppT >
bool r1cs_ppzksnark_verifier_weak_IC (const r1cs_ppzksnark_verification_key< ppT > &vk, const r1cs_ppzksnark_primary_input< ppT > &primary_input, const r1cs_ppzksnark_proof< ppT > &proof)
 
template<typename ppT >
bool r1cs_ppzksnark_verifier_strong_IC (const r1cs_ppzksnark_verification_key< ppT > &vk, const r1cs_ppzksnark_primary_input< ppT > &primary_input, const r1cs_ppzksnark_proof< ppT > &proof)
 
template<typename ppT >
r1cs_ppzksnark_processed_verification_key< ppT > r1cs_ppzksnark_verifier_process_vk (const r1cs_ppzksnark_verification_key< ppT > &vk)
 
template<typename ppT >
bool r1cs_ppzksnark_online_verifier_weak_IC (const r1cs_ppzksnark_processed_verification_key< ppT > &pvk, const r1cs_ppzksnark_primary_input< ppT > &input, const r1cs_ppzksnark_proof< ppT > &proof)
 
template<typename ppT >
bool r1cs_ppzksnark_online_verifier_strong_IC (const r1cs_ppzksnark_processed_verification_key< ppT > &pvk, const r1cs_ppzksnark_primary_input< ppT > &primary_input, const r1cs_ppzksnark_proof< ppT > &proof)
 
template<typename ppT >
bool r1cs_ppzksnark_affine_verifier_weak_IC (const r1cs_ppzksnark_verification_key< ppT > &vk, const r1cs_ppzksnark_primary_input< ppT > &primary_input, const r1cs_ppzksnark_proof< ppT > &proof)
 
template<typename ppT >
bool run_r1cs_se_ppzksnark (const r1cs_example< libff::Fr< ppT >> &example, const bool test_serialization)
 
template<typename ppT >
std::ostream & operator<< (std::ostream &out, const r1cs_se_ppzksnark_proving_key< ppT > &pk)
 
template<typename ppT >
std::istream & operator>> (std::istream &in, r1cs_se_ppzksnark_proving_key< ppT > &pk)
 
template<typename ppT >
std::ostream & operator<< (std::ostream &out, const r1cs_se_ppzksnark_verification_key< ppT > &vk)
 
template<typename ppT >
std::istream & operator>> (std::istream &in, r1cs_se_ppzksnark_verification_key< ppT > &vk)
 
template<typename ppT >
std::ostream & operator<< (std::ostream &out, const r1cs_se_ppzksnark_processed_verification_key< ppT > &pvk)
 
template<typename ppT >
std::istream & operator>> (std::istream &in, r1cs_se_ppzksnark_processed_verification_key< ppT > &pvk)
 
template<typename ppT >
std::ostream & operator<< (std::ostream &out, const r1cs_se_ppzksnark_proof< ppT > &proof)
 
template<typename ppT >
std::istream & operator>> (std::istream &in, r1cs_se_ppzksnark_proof< ppT > &proof)
 
template<typename ppT , libff::multi_exp_base_form BaseForm = libff::multi_exp_base_form_normal>
r1cs_se_ppzksnark_keypair< ppT > r1cs_se_ppzksnark_generator (const r1cs_se_ppzksnark_constraint_system< ppT > &cs)
 
template<typename ppT , libff::multi_exp_method Method = libff::multi_exp_method_BDLO12, libff::multi_exp_base_form BaseForm = libff::multi_exp_base_form_normal>
r1cs_se_ppzksnark_proof< ppT > r1cs_se_ppzksnark_prover (const r1cs_se_ppzksnark_proving_key< ppT > &pk, const r1cs_se_ppzksnark_primary_input< ppT > &primary_input, const r1cs_se_ppzksnark_auxiliary_input< ppT > &auxiliary_input)
 
template<typename ppT >
bool r1cs_se_ppzksnark_verifier_weak_IC (const r1cs_se_ppzksnark_verification_key< ppT > &vk, const r1cs_se_ppzksnark_primary_input< ppT > &primary_input, const r1cs_se_ppzksnark_proof< ppT > &proof)
 
template<typename ppT >
bool r1cs_se_ppzksnark_verifier_strong_IC (const r1cs_se_ppzksnark_verification_key< ppT > &vk, const r1cs_se_ppzksnark_primary_input< ppT > &primary_input, const r1cs_se_ppzksnark_proof< ppT > &proof)
 
template<typename ppT >
r1cs_se_ppzksnark_processed_verification_key< ppT > r1cs_se_ppzksnark_verifier_process_vk (const r1cs_se_ppzksnark_verification_key< ppT > &vk)
 
template<typename ppT >
bool r1cs_se_ppzksnark_online_verifier_weak_IC (const r1cs_se_ppzksnark_processed_verification_key< ppT > &pvk, const r1cs_se_ppzksnark_primary_input< ppT > &input, const r1cs_se_ppzksnark_proof< ppT > &proof)
 
template<typename ppT >
bool r1cs_se_ppzksnark_online_verifier_strong_IC (const r1cs_se_ppzksnark_processed_verification_key< ppT > &pvk, const r1cs_se_ppzksnark_primary_input< ppT > &primary_input, const r1cs_se_ppzksnark_proof< ppT > &proof)
 
template<typename ram_ppzksnark_ppT >
bool run_ram_ppzksnark (const ram_example< ram_ppzksnark_machine_pp< ram_ppzksnark_ppT >> &example, const bool test_serialization)
 
template<typename ram_ppzksnark_ppT >
std::ostream & operator<< (std::ostream &out, const ram_ppzksnark_proving_key< ram_ppzksnark_ppT > &pk)
 
template<typename ram_ppzksnark_ppT >
std::istream & operator>> (std::istream &in, ram_ppzksnark_proving_key< ram_ppzksnark_ppT > &pk)
 
template<typename ram_ppzksnark_ppT >
std::ostream & operator<< (std::ostream &out, const ram_ppzksnark_verification_key< ram_ppzksnark_ppT > &vk)
 
template<typename ram_ppzksnark_ppT >
std::istream & operator>> (std::istream &in, ram_ppzksnark_verification_key< ram_ppzksnark_ppT > &vk)
 
template<typename ram_ppzksnark_ppT >
ram_ppzksnark_keypair< ram_ppzksnark_ppT > ram_ppzksnark_generator (const ram_ppzksnark_architecture_params< ram_ppzksnark_ppT > &ap, const size_t primary_input_size_bound, const size_t time_bound)
 
template<typename ram_ppzksnark_ppT >
ram_ppzksnark_proof< ram_ppzksnark_ppT > ram_ppzksnark_prover (const ram_ppzksnark_proving_key< ram_ppzksnark_ppT > &pk, const ram_ppzksnark_primary_input< ram_ppzksnark_ppT > &primary_input, const ram_ppzksnark_auxiliary_input< ram_ppzksnark_ppT > &auxiliary_input)
 
template<typename ram_ppzksnark_ppT >
bool ram_ppzksnark_verifier (const ram_ppzksnark_verification_key< ram_ppzksnark_ppT > &vk, const ram_ppzksnark_primary_input< ram_ppzksnark_ppT > &primary_input, const ram_ppzksnark_proof< ram_ppzksnark_ppT > &proof)
 
template<typename ppT >
bool run_tbcs_ppzksnark (const tbcs_example &example, const bool test_serialization)
 
template<typename ppT >
std::ostream & operator<< (std::ostream &out, const tbcs_ppzksnark_proving_key< ppT > &pk)
 
template<typename ppT >
std::istream & operator>> (std::istream &in, tbcs_ppzksnark_proving_key< ppT > &pk)
 
template<typename ppT >
tbcs_ppzksnark_keypair< ppT > tbcs_ppzksnark_generator (const tbcs_ppzksnark_circuit &circuit)
 
template<typename ppT >
tbcs_ppzksnark_proof< ppT > tbcs_ppzksnark_prover (const tbcs_ppzksnark_proving_key< ppT > &pk, const tbcs_ppzksnark_primary_input &primary_input, const tbcs_ppzksnark_auxiliary_input &auxiliary_input)
 
template<typename ppT >
bool tbcs_ppzksnark_verifier_weak_IC (const tbcs_ppzksnark_verification_key< ppT > &vk, const tbcs_ppzksnark_primary_input &primary_input, const tbcs_ppzksnark_proof< ppT > &proof)
 
template<typename ppT >
bool tbcs_ppzksnark_verifier_strong_IC (const tbcs_ppzksnark_verification_key< ppT > &vk, const tbcs_ppzksnark_primary_input &primary_input, const tbcs_ppzksnark_proof< ppT > &proof)
 
template<typename ppT >
tbcs_ppzksnark_processed_verification_key< ppT > tbcs_ppzksnark_verifier_process_vk (const tbcs_ppzksnark_verification_key< ppT > &vk)
 
template<typename ppT >
bool tbcs_ppzksnark_online_verifier_weak_IC (const tbcs_ppzksnark_processed_verification_key< ppT > &pvk, const tbcs_ppzksnark_primary_input &primary_input, const tbcs_ppzksnark_proof< ppT > &proof)
 
template<typename ppT >
bool tbcs_ppzksnark_online_verifier_strong_IC (const tbcs_ppzksnark_processed_verification_key< ppT > &pvk, const tbcs_ppzksnark_primary_input &primary_input, const tbcs_ppzksnark_proof< ppT > &proof)
 
template<typename ppT >
bool run_uscs_ppzksnark (const uscs_example< libff::Fr< ppT >> &example, const bool test_serialization)
 
template<typename ppT >
std::ostream & operator<< (std::ostream &out, const uscs_ppzksnark_proving_key< ppT > &pk)
 
template<typename ppT >
std::istream & operator>> (std::istream &in, uscs_ppzksnark_proving_key< ppT > &pk)
 
template<typename ppT >
std::ostream & operator<< (std::ostream &out, const uscs_ppzksnark_verification_key< ppT > &vk)
 
template<typename ppT >
std::istream & operator>> (std::istream &in, uscs_ppzksnark_verification_key< ppT > &vk)
 
template<typename ppT >
std::ostream & operator<< (std::ostream &out, const uscs_ppzksnark_processed_verification_key< ppT > &pvk)
 
template<typename ppT >
std::istream & operator>> (std::istream &in, uscs_ppzksnark_processed_verification_key< ppT > &pvk)
 
template<typename ppT >
std::ostream & operator<< (std::ostream &out, const uscs_ppzksnark_proof< ppT > &proof)
 
template<typename ppT >
std::istream & operator>> (std::istream &in, uscs_ppzksnark_proof< ppT > &proof)
 
template<typename ppT , libff::multi_exp_base_form BaseForm = libff::multi_exp_base_form_normal>
uscs_ppzksnark_keypair< ppT > uscs_ppzksnark_generator (const uscs_ppzksnark_constraint_system< ppT > &cs)
 
template<typename ppT , libff::multi_exp_method Method = libff::multi_exp_method_BDLO12, libff::multi_exp_base_form BaseForm = libff::multi_exp_base_form_normal>
uscs_ppzksnark_proof< ppT > uscs_ppzksnark_prover (const uscs_ppzksnark_proving_key< ppT > &pk, const uscs_ppzksnark_primary_input< ppT > &primary_input, const uscs_ppzksnark_auxiliary_input< ppT > &auxiliary_input)
 
template<typename ppT >
bool uscs_ppzksnark_verifier_weak_IC (const uscs_ppzksnark_verification_key< ppT > &vk, const uscs_ppzksnark_primary_input< ppT > &primary_input, const uscs_ppzksnark_proof< ppT > &proof)
 
template<typename ppT >
bool uscs_ppzksnark_verifier_strong_IC (const uscs_ppzksnark_verification_key< ppT > &vk, const uscs_ppzksnark_primary_input< ppT > &primary_input, const uscs_ppzksnark_proof< ppT > &proof)
 
template<typename ppT >
uscs_ppzksnark_processed_verification_key< ppT > uscs_ppzksnark_verifier_process_vk (const uscs_ppzksnark_verification_key< ppT > &vk)
 
template<typename ppT >
bool uscs_ppzksnark_online_verifier_weak_IC (const uscs_ppzksnark_processed_verification_key< ppT > &pvk, const uscs_ppzksnark_primary_input< ppT > &primary_input, const uscs_ppzksnark_proof< ppT > &proof)
 
template<typename ppT >
bool uscs_ppzksnark_online_verifier_strong_IC (const uscs_ppzksnark_processed_verification_key< ppT > &pvk, const uscs_ppzksnark_primary_input< ppT > &primary_input, const uscs_ppzksnark_proof< ppT > &proof)
 
template<typename ram_zksnark_ppT >
bool run_ram_zksnark (const ram_example< ram_zksnark_machine_pp< ram_zksnark_ppT >> &example, const bool test_serialization)
 
template<typename ram_zksnark_ppT >
std::ostream & operator<< (std::ostream &out, const ram_zksnark_proving_key< ram_zksnark_ppT > &pk)
 
template<typename ram_zksnark_ppT >
std::istream & operator>> (std::istream &in, ram_zksnark_proving_key< ram_zksnark_ppT > &pk)
 
template<typename ram_zksnark_ppT >
std::ostream & operator<< (std::ostream &out, const ram_zksnark_verification_key< ram_zksnark_ppT > &vk)
 
template<typename ram_zksnark_ppT >
std::istream & operator>> (std::istream &in, ram_zksnark_verification_key< ram_zksnark_ppT > &vk)
 
template<typename ram_zksnark_ppT >
std::ostream & operator<< (std::ostream &out, const ram_zksnark_proof< ram_zksnark_ppT > &proof)
 
template<typename ram_zksnark_ppT >
std::istream & operator>> (std::istream &in, ram_zksnark_proof< ram_zksnark_ppT > &proof)
 
template<typename ram_zksnark_ppT >
ram_zksnark_keypair< ram_zksnark_ppT > ram_zksnark_generator (const ram_zksnark_architecture_params< ram_zksnark_ppT > &ap)
 
template<typename ram_zksnark_ppT >
ram_zksnark_proof< ram_zksnark_ppT > ram_zksnark_prover (const ram_zksnark_proving_key< ram_zksnark_ppT > &pk, const ram_zksnark_primary_input< ram_zksnark_ppT > &primary_input, const size_t time_bound, const ram_zksnark_auxiliary_input< ram_zksnark_ppT > &auxiliary_input)
 
template<typename ram_zksnark_ppT >
bool ram_zksnark_verifier (const ram_zksnark_verification_key< ram_zksnark_ppT > &vk, const ram_zksnark_primary_input< ram_zksnark_ppT > &primary_input, const size_t time_bound, const ram_zksnark_proof< ram_zksnark_ppT > &proof)
 

Variables

size_t constraint_profiling_indent = 0
 
std::vector< constraint_profiling_entryconstraint_profiling_table
 
const size_t SHA256_digest_size = 256
 
const size_t SHA256_block_size = 512
 
tinyram_instruction tinyram_default_instruction
 
std::map< tinyram_opcode, std::string > tinyram_opcode_names
 
std::map< tinyram_opcode, tinyram_opcode_argsopcode_args
 
std::map< std::string, tinyram_opcodeopcode_values
 

Detailed Description

Author
This file is part of libsnark, developed by SCIPR Lab and contributors (see AUTHORS).

Reference [DOSD06] "Multiplication and Squaring on Pairing-Friendly Fields" Devegili, OhEig, Scott and Dahab, IACR Cryptology ePrint Archive 2006, https://eprint.iacr.org/2006/471.pdf

Reference:

The native implementation can be found in: libsnark/polynomial_commitments/kzg10.{hpp,tcc}

Reference [BGM17]: "Scalable Multi-party Computation for zk-SNARK Parameters in the Random Beacon Model" Sean Bowe and Ariel Gabizon and Ian Miers, IACR Cryptology ePrint Archive 2017, http://eprint.iacr.org/2017/1050

Reference:

Reference:

Reference:

Typedef Documentation

◆ address_and_value

typedef std::pair<size_t, size_t> libsnark::address_and_value

A pair consisting of an address and a value. It represents a memory store.

Definition at line 24 of file memory_store_trace.hpp.

◆ as_waksman_routing

typedef std::vector<std::map<size_t, bool> > libsnark::as_waksman_routing

A routing assigns a bit to each switch in the AS-Waksman routing network.

More precisely:

  • as_waksman_routing[column_idx][packet_idx]=false, if switch with canonical position of (column_idx,packet_idx) is set to "straight" setting, and
  • as_waksman_routing[column_idx][packet_idx]=true, if switch with canonical position of (column_idx,packet_idx) is set to "cross" setting.

Note that as_waksman_routing[column_idx][packet_idx] does contain entries for the positions associated with the bottom ports of the switches, i.e. only canonical positions are present.

Definition at line 102 of file as_waksman_routing_algorithm.hpp.

◆ as_waksman_topology

typedef std::vector<std::vector<std::pair<size_t, size_t> > > libsnark::as_waksman_topology

When laid out on num_packets \times num_columns grid, each switch occupies two positions: its top input and output ports are at position (column_idx, row_idx) and the bottom input and output ports are at position (column_idx, row_idx+1).

We call the position assigned to the top ports of a switch its "canonical" position. A data structure that stores the topology of an AS-Waksman network.

For a given column index column_idx and packet index packet_idx, as_waksman_topology[column_idx][packet_idx] specifies the two possible destinations at column_idx+1-th column where the packet_idx-th packet in the column_idx-th column could be routed after passing the switch, which has (column_idx, packet_idx) as one of its occupied positions.

This information is stored as a pair of indices, where:

  • the first index denotes the destination when the switch is operated in "straight" setting, and
  • the second index denotes the destination when the switch is operated in "cross" setting.

If no switch occupies a position (column_idx, packet_idx), i.e. there is just a wire passing through that position, then the two indices are set to be equal and the packet is always routed to the specified destination at the column_idx+1-th column.

Definition at line 83 of file as_waksman_routing_algorithm.hpp.

◆ bacs_auxiliary_input

template<typename FieldT >
using libsnark::bacs_auxiliary_input = typedef bacs_variable_assignment<FieldT>

A BACS auxiliary input is a BACS variable assigment.

Definition at line 85 of file bacs.hpp.

◆ bacs_ppzksnark_auxiliary_input

template<typename ppT >
using libsnark::bacs_ppzksnark_auxiliary_input = typedef bacs_auxiliary_input<libff::Fr<ppT> >

Definition at line 32 of file bacs_ppzksnark_params.hpp.

◆ bacs_ppzksnark_circuit

template<typename ppT >
using libsnark::bacs_ppzksnark_circuit = typedef bacs_circuit<libff::Fr<ppT> >

Below are various template aliases (used for convenience).

Definition at line 26 of file bacs_ppzksnark_params.hpp.

◆ bacs_ppzksnark_primary_input

template<typename ppT >
using libsnark::bacs_ppzksnark_primary_input = typedef bacs_primary_input<libff::Fr<ppT> >

Definition at line 29 of file bacs_ppzksnark_params.hpp.

◆ bacs_ppzksnark_processed_verification_key

A processed verification key for the BACS ppzkSNARK.

Compared to a (non-processed) verification key, a processed verification key contains a small constant amount of additional pre-computed information that enables a faster verification time.

Definition at line 124 of file bacs_ppzksnark.hpp.

◆ bacs_ppzksnark_proof

template<typename ppT >
using libsnark::bacs_ppzksnark_proof = typedef r1cs_ppzksnark_proof<ppT>

A proof for the BACS ppzkSNARK.

Definition at line 160 of file bacs_ppzksnark.hpp.

◆ bacs_ppzksnark_verification_key

template<typename ppT >
using libsnark::bacs_ppzksnark_verification_key = typedef r1cs_ppzksnark_verification_key<ppT>

A verification key for the BACS ppzkSNARK.

Definition at line 111 of file bacs_ppzksnark.hpp.

◆ bacs_primary_input

template<typename FieldT >
using libsnark::bacs_primary_input = typedef bacs_variable_assignment<FieldT>

A BACS primary input is a BACS variable assignment.

Definition at line 79 of file bacs.hpp.

◆ bacs_variable_assignment

template<typename FieldT >
using libsnark::bacs_variable_assignment = typedef std::vector<FieldT>

A BACS variable assignment is a vector of field elements.

Definition at line 33 of file bacs.hpp.

◆ benes_routing

typedef std::vector<libff::bit_vector> libsnark::benes_routing

A routing assigns a bit to each switch in a Benes network.

For a d-dimensional Benes network, the switch bits are stored in a vector consisting of 2*d entries, and each entry contains 2^d bits. That is, we have one switch per packet, but switch settings are not independent.

Definition at line 61 of file benes_routing_algorithm.hpp.

◆ benes_topology

typedef std::vector<std::vector<std::pair<size_t, size_t> > > libsnark::benes_topology

A data structure that stores the topology of a Benes network.

For a given column index column_idx and packet index packet_idx, benes_topology[column_idx][packet_idx] specifies the two possible destinations where the packet_idx-th packet in the column_idx-th column could be routed. This information is stored as a pair of indices, where:

  • the first index denotes the destination when the switch is in "straight" mode, and
  • the second index denotes the destination when the switch is in "cross" mode.

(The topology has a very succinct description and can be easily queried at an arbitrary position, see implementation of generate_benes_topology for details.)

Definition at line 51 of file benes_routing_algorithm.hpp.

◆ CRH_with_bit_out_gadget

template<typename FieldT >
using libsnark::CRH_with_bit_out_gadget = typedef knapsack_CRH_with_bit_out_gadget<FieldT>

Definition at line 21 of file crh_gadget.hpp.

◆ CRH_with_field_out_gadget

template<typename FieldT >
using libsnark::CRH_with_field_out_gadget = typedef knapsack_CRH_with_field_out_gadget<FieldT>

Definition at line 18 of file crh_gadget.hpp.

◆ default_bacs_ppzksnark_pp

typedef libff::default_ec_pp libsnark::default_bacs_ppzksnark_pp

Definition at line 21 of file bacs_ppzksnark_pp.hpp.

◆ default_r1cs_gg_ppzksnark_pp

typedef libff::default_ec_pp libsnark::default_r1cs_gg_ppzksnark_pp

Definition at line 20 of file r1cs_gg_ppzksnark_pp.hpp.

◆ default_r1cs_ppzksnark_pp

typedef libff::default_ec_pp libsnark::default_r1cs_ppzksnark_pp

Definition at line 20 of file r1cs_ppzksnark_pp.hpp.

◆ default_r1cs_se_ppzksnark_pp

typedef libff::default_ec_pp libsnark::default_r1cs_se_ppzksnark_pp

Definition at line 20 of file r1cs_se_ppzksnark_pp.hpp.

◆ default_ram_ppzksnark_pp

Definition at line 21 of file ram_ppzksnark_pp.hpp.

◆ default_ram_zksnark_pp

Definition at line 21 of file ram_zksnark_pp.hpp.

◆ default_tbcs_ppzksnark_pp

typedef libff::default_ec_pp libsnark::default_tbcs_ppzksnark_pp

Definition at line 21 of file tbcs_ppzksnark_pp.hpp.

◆ default_uscs_ppzksnark_pp

typedef libff::default_ec_pp libsnark::default_uscs_ppzksnark_pp

Definition at line 21 of file uscs_ppzksnark_pp.hpp.

◆ e_over_e_miller_loop_gadget

template<typename ppT >
using libsnark::e_over_e_miller_loop_gadget = typedef typename pairing_selector<ppT>::e_over_e_miller_loop_gadget_type

Definition at line 147 of file pairing_params.hpp.

◆ e_times_e_over_e_miller_loop_gadget

template<typename ppT >
using libsnark::e_times_e_over_e_miller_loop_gadget = typedef typename pairing_selector<ppT>::e_times_e_over_e_miller_loop_gadget_type

Definition at line 151 of file pairing_params.hpp.

◆ e_times_e_times_e_over_e_miller_loop_gadget

template<typename ppT >
using libsnark::e_times_e_times_e_over_e_miller_loop_gadget = typedef typename pairing_selector< ppT>::e_times_e_times_e_over_e_miller_loop_gadget_type

Definition at line 155 of file pairing_params.hpp.

◆ final_exp_gadget

template<typename ppT >
using libsnark::final_exp_gadget = typedef typename pairing_selector<ppT>::final_exp_gadget_type

Definition at line 158 of file pairing_params.hpp.

◆ fooram_input_tape

typedef std::vector<size_t> libsnark::fooram_input_tape

Definition at line 24 of file fooram_aux.hpp.

◆ fooram_input_tape_iterator

typedef std::vector<size_t>::const_iterator libsnark::fooram_input_tape_iterator

Definition at line 25 of file fooram_aux.hpp.

◆ fooram_program

typedef std::vector<size_t> libsnark::fooram_program

Definition at line 23 of file fooram_aux.hpp.

◆ Fp4_mul_gadget

template<typename Fp4T >
using libsnark::Fp4_mul_gadget = typedef Fp4_direct_mul_gadget<Fp4T>

Alias default multiplication gadget

Definition at line 132 of file fp4_gadgets.hpp.

◆ Fqe_mul_by_lc_gadget

template<typename ppT >
using libsnark::Fqe_mul_by_lc_gadget = typedef typename pairing_selector<ppT>::Fqe_mul_by_lc_gadget_type

Definition at line 102 of file pairing_params.hpp.

◆ Fqe_mul_gadget

template<typename ppT >
using libsnark::Fqe_mul_gadget = typedef typename pairing_selector<ppT>::Fqe_mul_gadget_type

Definition at line 98 of file pairing_params.hpp.

◆ Fqe_sqr_gadget

template<typename ppT >
using libsnark::Fqe_sqr_gadget = typedef typename pairing_selector<ppT>::Fqe_sqr_gadget_type

Definition at line 105 of file pairing_params.hpp.

◆ Fqe_variable

template<typename ppT >
using libsnark::Fqe_variable = typedef typename pairing_selector<ppT>::Fqe_variable_type

Definition at line 95 of file pairing_params.hpp.

◆ Fqk_mul_gadget

template<typename ppT >
using libsnark::Fqk_mul_gadget = typedef typename pairing_selector<ppT>::Fqk_mul_gadget_type

Definition at line 111 of file pairing_params.hpp.

◆ Fqk_sqr_gadget

template<typename ppT >
using libsnark::Fqk_sqr_gadget = typedef typename pairing_selector<ppT>::Fqk_sqr_gadget_type

Definition at line 114 of file pairing_params.hpp.

◆ Fqk_variable

template<typename ppT >
using libsnark::Fqk_variable = typedef typename pairing_selector<ppT>::Fqk_variable_type

Definition at line 108 of file pairing_params.hpp.

◆ FqkT

template<typename ppT >
using libsnark::FqkT = typedef typename pairing_selector<ppT>::FqkT

Below are various template aliases (used for convenience).

Definition at line 92 of file pairing_params.hpp.

◆ G1_add_variable_and_variable_or_identity_gadget

Definition at line 239 of file weierstrass_g1_gadget.hpp.

◆ G1_add_variable_or_identity_gadget

template<typename wppT >
using libsnark::G1_add_variable_or_identity_gadget = typedef add_variable_or_identity< wppT, libff::G1<other_curve<wppT> >, G1_variable<wppT>, G1_variable_selector_gadget<wppT>, G1_add_gadget<wppT> >

Definition at line 230 of file weierstrass_g1_gadget.hpp.

◆ G1_checker

template<typename ppT >
using libsnark::G1_checker = typedef typename pairing_selector<ppT>::G1_checker_type

Definition at line 120 of file pairing_params.hpp.

◆ G1_dbl_variable_or_identity_gadget

template<typename wppT >
using libsnark::G1_dbl_variable_or_identity_gadget = typedef dbl_variable_or_identity< wppT, libff::G1<other_curve<wppT> >, G1_variable<wppT>, G1_dbl_gadget<wppT> >

Definition at line 246 of file weierstrass_g1_gadget.hpp.

◆ G1_mul_by_const_scalar_gadget

template<typename wppT , mp_size_t scalarLimbs>
using libsnark::G1_mul_by_const_scalar_gadget = typedef point_mul_by_const_scalar_gadget< libff::G1<other_curve<wppT> >, G1_variable<wppT>, G1_add_gadget<wppT>, G1_dbl_gadget<wppT>, libff::bigint<scalarLimbs> >

Multiplication by constant scalar (leverages point_mul_by_const_scalar_gadget - scalar_multiplication.hpp).

Definition at line 203 of file weierstrass_g1_gadget.hpp.

◆ G1_mul_by_scalar_gadget

template<typename wppT >
using libsnark::G1_mul_by_scalar_gadget = typedef point_mul_by_scalar_gadget< wppT, libff::G1<other_curve<wppT> >, G1_variable<wppT>, G1_variable_selector_gadget<wppT>, G1_add_gadget<wppT>, G1_dbl_gadget<wppT> >

Definition at line 255 of file weierstrass_g1_gadget.hpp.

◆ G1_precomputation

template<typename ppT >
using libsnark::G1_precomputation = typedef typename pairing_selector<ppT>::G1_precomputation_type

Definition at line 127 of file pairing_params.hpp.

◆ G1_variable_and_variable_or_identity_selector_gadget

Definition at line 222 of file weierstrass_g1_gadget.hpp.

◆ G1_variable_or_identity

template<typename wppT >
using libsnark::G1_variable_or_identity = typedef variable_or_identity<wppT, libff::G1<other_curve<wppT> >, G1_variable<wppT> >

Definition at line 207 of file weierstrass_g1_gadget.hpp.

◆ G1_variable_or_identity_selector_gadget

template<typename wppT >
using libsnark::G1_variable_or_identity_selector_gadget = typedef variable_or_identity_selector< wppT, libff::G1<other_curve<wppT> >, G1_variable<wppT>, G1_variable_selector_gadget<wppT> >

Definition at line 214 of file weierstrass_g1_gadget.hpp.

◆ G2_add_variable_and_variable_or_identity_gadget

Definition at line 277 of file weierstrass_g2_gadget.hpp.

◆ G2_add_variable_or_identity_gadget

template<typename wppT >
using libsnark::G2_add_variable_or_identity_gadget = typedef add_variable_or_identity< wppT, libff::G2<other_curve<wppT> >, G2_variable<wppT>, G2_variable_selector_gadget<wppT>, G2_add_gadget<wppT> >

Definition at line 268 of file weierstrass_g2_gadget.hpp.

◆ G2_checker

template<typename ppT >
using libsnark::G2_checker = typedef typename pairing_selector<ppT>::G2_checker_type

Definition at line 123 of file pairing_params.hpp.

◆ G2_dbl_variable_or_identity_gadget

template<typename wppT >
using libsnark::G2_dbl_variable_or_identity_gadget = typedef dbl_variable_or_identity< wppT, libff::G2<other_curve<wppT> >, G2_variable<wppT>, G2_dbl_gadget<wppT> >

Definition at line 284 of file weierstrass_g2_gadget.hpp.

◆ G2_mul_by_const_scalar_gadget

template<typename wppT , mp_size_t scalarLimbs>
using libsnark::G2_mul_by_const_scalar_gadget = typedef point_mul_by_const_scalar_gadget< libff::G2<other_curve<wppT> >, G2_variable<wppT>, G2_add_gadget<wppT>, G2_dbl_gadget<wppT>, libff::bigint<scalarLimbs> >

Multiplication by constant scalar (leverages point_mul_by_const_scalar_gadget - scalar_multiplication.hpp).

Definition at line 241 of file weierstrass_g2_gadget.hpp.

◆ G2_mul_by_scalar_gadget

template<typename wppT >
using libsnark::G2_mul_by_scalar_gadget = typedef point_mul_by_scalar_gadget< wppT, libff::G2<other_curve<wppT> >, G2_variable<wppT>, G2_variable_selector_gadget<wppT>, G2_add_gadget<wppT>, G2_dbl_gadget<wppT> >

Definition at line 293 of file weierstrass_g2_gadget.hpp.

◆ G2_precomputation

template<typename ppT >
using libsnark::G2_precomputation = typedef typename pairing_selector<ppT>::G2_precomputation_type

Definition at line 131 of file pairing_params.hpp.

◆ G2_variable_and_variable_or_identity_selector_gadget

Definition at line 260 of file weierstrass_g2_gadget.hpp.

◆ G2_variable_or_identity

template<typename wppT >
using libsnark::G2_variable_or_identity = typedef variable_or_identity<wppT, libff::G2<other_curve<wppT> >, G2_variable<wppT> >

Definition at line 245 of file weierstrass_g2_gadget.hpp.

◆ G2_variable_or_identity_selector_gadget

template<typename wppT >
using libsnark::G2_variable_or_identity_selector_gadget = typedef variable_or_identity_selector< wppT, libff::G2<other_curve<wppT> >, G2_variable<wppT>, G2_variable_selector_gadget<wppT> >

Definition at line 252 of file weierstrass_g2_gadget.hpp.

◆ integer_coeff_t

Definition at line 30 of file variable.hpp.

◆ knowledge_commitment_vector

template<typename T1 , typename T2 >
using libsnark::knowledge_commitment_vector = typedef sparse_vector<knowledge_commitment<T1, T2> >

A knowledge commitment vector is a sparse vector of knowledge commitments.

Definition at line 104 of file knowledge_commitment.hpp.

◆ kzg10_commitment_variable

template<typename ppT >
using libsnark::kzg10_commitment_variable = typedef G1_variable<ppT>

The polynomial for the KZG10 scheme, as protoboard variables. This is just a G1_variable (see the native implementation).

Definition at line 49 of file kzg10_verifier_gadget.hpp.

◆ kzg10_witness_variable

template<typename ppT >
using libsnark::kzg10_witness_variable = typedef G1_variable<ppT>

The witness for the evaluation of a polynomial, as protoboard variables. This is also a single G1_variable (see the native implementation).

Definition at line 53 of file kzg10_verifier_gadget.hpp.

◆ lc_index_t

typedef size_t libsnark::lc_index_t

Definition at line 20 of file pb_variable.hpp.

◆ memory_contents

typedef std::map<size_t, size_t> libsnark::memory_contents

A function from addresses to values that represents a memory's contents.

Definition at line 25 of file memory_interface.hpp.

◆ memory_load_gadget

template<typename FieldT , typename HashT >
using libsnark::memory_load_gadget = typedef merkle_tree_check_read_gadget<FieldT, HashT>

Definition at line 22 of file memory_load_gadget.hpp.

◆ memory_load_store_gadget

template<typename FieldT , typename HashT >
using libsnark::memory_load_store_gadget = typedef merkle_tree_check_update_gadget<FieldT, HashT>

Definition at line 24 of file memory_load_store_gadget.hpp.

◆ merkle_authentication_node

typedef libff::bit_vector libsnark::merkle_authentication_node

A Merkle tree is maintained as two maps:

  • a map from addresses to values, and
  • a map from addresses to hashes.

The second map maintains the intermediate hashes of a Merkle tree built atop the values currently stored in the tree (the implementation admits a very efficient support for sparse trees). Besides offering methods to load and store values, the class offers methods to retrieve the root of the Merkle tree and to obtain the authentication paths for (the value at) a given address.

Definition at line 35 of file merkle_tree.hpp.

◆ merkle_authentication_path

Definition at line 36 of file merkle_tree.hpp.

◆ miller_loop_gadget

template<typename ppT >
using libsnark::miller_loop_gadget = typedef typename pairing_selector<ppT>::miller_loop_gadget_type

Definition at line 143 of file pairing_params.hpp.

◆ other_curve

template<typename ppT >
using libsnark::other_curve = typedef typename pairing_selector<ppT>::other_curve_type

Definition at line 117 of file pairing_params.hpp.

◆ polynomial

template<typename FieldT >
using libsnark::polynomial = typedef std::vector<FieldT>

Polynomial type, as a list of coefficients (currently only represents univariate polynomials). Value at index i is the coefficient of x^i.

Definition at line 17 of file polynomial.hpp.

◆ precompute_G1_gadget

template<typename ppT >
using libsnark::precompute_G1_gadget = typedef typename pairing_selector<ppT>::precompute_G1_gadget_type

Definition at line 135 of file pairing_params.hpp.

◆ precompute_G2_gadget

template<typename ppT >
using libsnark::precompute_G2_gadget = typedef typename pairing_selector<ppT>::precompute_G2_gadget_type

Definition at line 139 of file pairing_params.hpp.

◆ r1cs_auxiliary_input

template<typename FieldT >
using libsnark::r1cs_auxiliary_input = typedef std::vector<FieldT>

Definition at line 84 of file r1cs.hpp.

◆ r1cs_gg_ppzksnark_auxiliary_input

template<typename ppT >
using libsnark::r1cs_gg_ppzksnark_auxiliary_input = typedef r1cs_auxiliary_input<libff::Fr<ppT> >

Definition at line 33 of file r1cs_gg_ppzksnark_params.hpp.

◆ r1cs_gg_ppzksnark_constraint_system

template<typename ppT >
using libsnark::r1cs_gg_ppzksnark_constraint_system = typedef r1cs_constraint_system<libff::Fr<ppT> >

Below are various template aliases (used for convenience).

Definition at line 27 of file r1cs_gg_ppzksnark_params.hpp.

◆ r1cs_gg_ppzksnark_primary_input

template<typename ppT >
using libsnark::r1cs_gg_ppzksnark_primary_input = typedef r1cs_primary_input<libff::Fr<ppT> >

Definition at line 30 of file r1cs_gg_ppzksnark_params.hpp.

◆ r1cs_mp_ppzkpcd_auxiliary_input

template<typename PCD_ppT >
using libsnark::r1cs_mp_ppzkpcd_auxiliary_input = typedef r1cs_pcd_compliance_predicate_auxiliary_input< libff::Fr<typename PCD_ppT::curve_A_pp> >

Definition at line 42 of file r1cs_mp_ppzkpcd_params.hpp.

◆ r1cs_mp_ppzkpcd_compliance_predicate

template<typename PCD_ppT >
using libsnark::r1cs_mp_ppzkpcd_compliance_predicate = typedef r1cs_pcd_compliance_predicate<libff::Fr<typename PCD_ppT::curve_A_pp> >

Definition at line 25 of file ppzkpcd_compliance_predicate.hpp.

◆ r1cs_mp_ppzkpcd_local_data

template<typename PCD_ppT >
using libsnark::r1cs_mp_ppzkpcd_local_data = typedef r1cs_pcd_local_data<libff::Fr<typename PCD_ppT::curve_A_pp> >

Definition at line 33 of file ppzkpcd_compliance_predicate.hpp.

◆ r1cs_mp_ppzkpcd_message

template<typename PCD_ppT >
using libsnark::r1cs_mp_ppzkpcd_message = typedef r1cs_pcd_message<libff::Fr<typename PCD_ppT::curve_A_pp> >

Definition at line 29 of file ppzkpcd_compliance_predicate.hpp.

◆ r1cs_mp_ppzkpcd_primary_input

template<typename PCD_ppT >
using libsnark::r1cs_mp_ppzkpcd_primary_input = typedef r1cs_pcd_compliance_predicate_primary_input< libff::Fr<typename PCD_ppT::curve_A_pp> >

Definition at line 37 of file r1cs_mp_ppzkpcd_params.hpp.

◆ r1cs_mp_ppzkpcd_variable_assignment

template<typename PCD_ppT >
using libsnark::r1cs_mp_ppzkpcd_variable_assignment = typedef r1cs_variable_assignment<libff::Fr<typename PCD_ppT::curve_A_pp> >

Definition at line 37 of file ppzkpcd_compliance_predicate.hpp.

◆ r1cs_pcd_witness

template<typename FieldT >
using libsnark::r1cs_pcd_witness = typedef std::vector<FieldT>

Definition at line 65 of file compliance_predicate.hpp.

◆ r1cs_ppzkadsnark_auxiliary_input

template<typename r1cs_ppzkadsnark_ppT >
using libsnark::r1cs_ppzkadsnark_auxiliary_input = typedef r1cs_auxiliary_input<libff::Fr<snark_pp<r1cs_ppzkadsnark_ppT> >>

Definition at line 45 of file r1cs_ppzkadsnark_params.hpp.

◆ r1cs_ppzkadsnark_constraint_system

template<typename r1cs_ppzkadsnark_ppT >
using libsnark::r1cs_ppzkadsnark_constraint_system = typedef r1cs_constraint_system<libff::Fr<snark_pp<r1cs_ppzkadsnark_ppT> >>

Definition at line 37 of file r1cs_ppzkadsnark_params.hpp.

◆ r1cs_ppzkadsnark_prfKeyT

template<typename r1cs_ppzkadsnark_ppT >
using libsnark::r1cs_ppzkadsnark_prfKeyT = typedef typename r1cs_ppzkadsnark_ppT::prfKeyT

Definition at line 57 of file r1cs_ppzkadsnark_params.hpp.

◆ r1cs_ppzkadsnark_primary_input

template<typename r1cs_ppzkadsnark_ppT >
using libsnark::r1cs_ppzkadsnark_primary_input = typedef r1cs_primary_input<libff::Fr<snark_pp<r1cs_ppzkadsnark_ppT> >>

Definition at line 41 of file r1cs_ppzkadsnark_params.hpp.

◆ r1cs_ppzkadsnark_sigT

template<typename r1cs_ppzkadsnark_ppT >
using libsnark::r1cs_ppzkadsnark_sigT = typedef typename r1cs_ppzkadsnark_ppT::sigT

Definition at line 54 of file r1cs_ppzkadsnark_params.hpp.

◆ r1cs_ppzkadsnark_skT

template<typename r1cs_ppzkadsnark_ppT >
using libsnark::r1cs_ppzkadsnark_skT = typedef typename r1cs_ppzkadsnark_ppT::skT

Definition at line 48 of file r1cs_ppzkadsnark_params.hpp.

◆ r1cs_ppzkadsnark_vkT

template<typename r1cs_ppzkadsnark_ppT >
using libsnark::r1cs_ppzkadsnark_vkT = typedef typename r1cs_ppzkadsnark_ppT::vkT

Definition at line 51 of file r1cs_ppzkadsnark_params.hpp.

◆ r1cs_ppzksnark_auxiliary_input

template<typename ppT >
using libsnark::r1cs_ppzksnark_auxiliary_input = typedef r1cs_auxiliary_input<libff::Fr<ppT> >

Definition at line 32 of file r1cs_ppzksnark_params.hpp.

◆ r1cs_ppzksnark_constraint_system

template<typename ppT >
using libsnark::r1cs_ppzksnark_constraint_system = typedef r1cs_constraint_system<libff::Fr<ppT> >

Below are various template aliases (used for convenience).

Definition at line 26 of file r1cs_ppzksnark_params.hpp.

◆ r1cs_ppzksnark_primary_input

template<typename ppT >
using libsnark::r1cs_ppzksnark_primary_input = typedef r1cs_primary_input<libff::Fr<ppT> >

Definition at line 29 of file r1cs_ppzksnark_params.hpp.

◆ r1cs_primary_input

template<typename FieldT >
using libsnark::r1cs_primary_input = typedef std::vector<FieldT>

A R1CS variable assignment is a vector of <FieldT> elements that represents a candidate solution to a R1CS constraint system (see below).

Definition at line 82 of file r1cs.hpp.

◆ r1cs_se_ppzksnark_auxiliary_input

template<typename ppT >
using libsnark::r1cs_se_ppzksnark_auxiliary_input = typedef r1cs_auxiliary_input<libff::Fr<ppT> >

Definition at line 33 of file r1cs_se_ppzksnark_params.hpp.

◆ r1cs_se_ppzksnark_constraint_system

template<typename ppT >
using libsnark::r1cs_se_ppzksnark_constraint_system = typedef r1cs_constraint_system<libff::Fr<ppT> >

Below are various template aliases (used for convenience).

Definition at line 27 of file r1cs_se_ppzksnark_params.hpp.

◆ r1cs_se_ppzksnark_primary_input

template<typename ppT >
using libsnark::r1cs_se_ppzksnark_primary_input = typedef r1cs_primary_input<libff::Fr<ppT> >

Definition at line 30 of file r1cs_se_ppzksnark_params.hpp.

◆ r1cs_sp_ppzkpcd_auxiliary_input

template<typename PCD_ppT >
using libsnark::r1cs_sp_ppzkpcd_auxiliary_input = typedef r1cs_pcd_compliance_predicate_auxiliary_input< libff::Fr<typename PCD_ppT::curve_A_pp> >

Definition at line 42 of file r1cs_sp_ppzkpcd_params.hpp.

◆ r1cs_sp_ppzkpcd_compliance_predicate

template<typename PCD_ppT >
using libsnark::r1cs_sp_ppzkpcd_compliance_predicate = typedef r1cs_pcd_compliance_predicate<libff::Fr<typename PCD_ppT::curve_A_pp> >

Definition at line 24 of file r1cs_sp_ppzkpcd_params.hpp.

◆ r1cs_sp_ppzkpcd_local_data

template<typename PCD_ppT >
using libsnark::r1cs_sp_ppzkpcd_local_data = typedef r1cs_pcd_local_data<libff::Fr<typename PCD_ppT::curve_A_pp> >

Definition at line 32 of file r1cs_sp_ppzkpcd_params.hpp.

◆ r1cs_sp_ppzkpcd_message

template<typename PCD_ppT >
using libsnark::r1cs_sp_ppzkpcd_message = typedef r1cs_pcd_message<libff::Fr<typename PCD_ppT::curve_A_pp> >

Definition at line 28 of file r1cs_sp_ppzkpcd_params.hpp.

◆ r1cs_sp_ppzkpcd_primary_input

template<typename PCD_ppT >
using libsnark::r1cs_sp_ppzkpcd_primary_input = typedef r1cs_pcd_compliance_predicate_primary_input< libff::Fr<typename PCD_ppT::curve_A_pp> >

Definition at line 37 of file r1cs_sp_ppzkpcd_params.hpp.

◆ r1cs_sp_ppzkpcd_proof

template<typename PCD_ppT >
using libsnark::r1cs_sp_ppzkpcd_proof = typedef r1cs_ppzksnark_proof<typename PCD_ppT::curve_B_pp>

A proof for the R1CS (single-predicate) ppzkPCD.

Definition at line 275 of file r1cs_sp_ppzkpcd.hpp.

◆ r1cs_variable_assignment

template<typename FieldT >
using libsnark::r1cs_variable_assignment = typedef std::vector<FieldT>

Definition at line 88 of file r1cs.hpp.

◆ ram_architecture_params

template<typename ramT >
using libsnark::ram_architecture_params = typedef typename ramT::architecture_params_type

Definition at line 53 of file ram_params.hpp.

◆ ram_base_field

template<typename ramT >
using libsnark::ram_base_field = typedef typename ramT::base_field_type

Definition at line 40 of file ram_params.hpp.

◆ ram_boot_trace

template<typename ramT >
using libsnark::ram_boot_trace = typedef memory_store_trace

Definition at line 44 of file ram_params.hpp.

◆ ram_cpu_checker

template<typename ramT >
using libsnark::ram_cpu_checker = typedef typename ramT::cpu_checker_type

Definition at line 50 of file ram_params.hpp.

◆ ram_cpu_state

template<typename ramT >
using libsnark::ram_cpu_state = typedef libff::bit_vector

Definition at line 42 of file ram_params.hpp.

◆ ram_gadget_base

template<typename ramT >
using libsnark::ram_gadget_base = typedef typename ramT::gadget_base_type

Definition at line 48 of file ram_params.hpp.

◆ ram_input_tape

template<typename ramT >
using libsnark::ram_input_tape = typedef std::vector<size_t>

Definition at line 55 of file ram_params.hpp.

◆ ram_ppzksnark_architecture_params

template<typename ram_ppzksnark_ppT >
using libsnark::ram_ppzksnark_architecture_params = typedef ram_architecture_params<ram_ppzksnark_machine_pp<ram_ppzksnark_ppT> >

Definition at line 68 of file ram_ppzksnark_params.hpp.

◆ ram_ppzksnark_auxiliary_input

template<typename ram_ppzksnark_ppT >
using libsnark::ram_ppzksnark_auxiliary_input = typedef ram_input_tape<ram_ppzksnark_machine_pp<ram_ppzksnark_ppT> >

Definition at line 76 of file ram_ppzksnark_params.hpp.

◆ ram_ppzksnark_machine_pp

template<typename ram_ppzksnark_ppT >
using libsnark::ram_ppzksnark_machine_pp = typedef typename ram_ppzksnark_ppT::machine_pp

Definition at line 64 of file ram_ppzksnark_params.hpp.

◆ ram_ppzksnark_primary_input

template<typename ram_ppzksnark_ppT >
using libsnark::ram_ppzksnark_primary_input = typedef ram_boot_trace<ram_ppzksnark_machine_pp<ram_ppzksnark_ppT> >

Definition at line 72 of file ram_ppzksnark_params.hpp.

◆ ram_ppzksnark_proof

template<typename ram_ppzksnark_ppT >
using libsnark::ram_ppzksnark_proof = typedef r1cs_ppzksnark_proof<ram_ppzksnark_snark_pp<ram_ppzksnark_ppT> >

A proof for the RAM ppzkSNARK.

Definition at line 207 of file ram_ppzksnark.hpp.

◆ ram_ppzksnark_snark_pp

template<typename ram_ppzksnark_ppT >
using libsnark::ram_ppzksnark_snark_pp = typedef typename ram_ppzksnark_ppT::snark_pp

The interfaces of the RAM ppzkSNARK are templatized via the parameter ram_ppzksnark_ppT. When used, the interfaces must be invoked with a particular parameter choice; let 'my_ram_ppzksnark_pp' denote this choice.

my_ram_ppzksnark_pp needs to contain typedefs for the typenames

  • snark_pp, and
  • machine_pp. as well as a method with the following signature:
  • static void init_public_params();

For example, if you want to use the types my_snark_pp and my_machine_pp, then you could declare my_ram_ppzksnark_pp as follows:

class my_ram_ppzksnark_pp { public: typedef my_snark_pp snark_pp; typedef my_machine_pp machine_pp; static void init_public params() { snark_pp::init_public_params(); // and additional initialization if needed } };

Having done the above, my_ram_ppzksnark_pp can be used as a template parameter.

Look for for default_tinyram_ppzksnark_pp in the file

common/default_types/ram_ppzksnark_pp.hpp

for an example of the above steps for the case of "RAM=TinyRAM". Below are various template aliases (used for convenience).

Definition at line 61 of file ram_ppzksnark_params.hpp.

◆ ram_protoboard

template<typename ramT >
using libsnark::ram_protoboard = typedef typename ramT::protoboard_type

Definition at line 46 of file ram_params.hpp.

◆ ram_zksnark_architecture_params

template<typename ram_zksnark_ppT >
using libsnark::ram_zksnark_architecture_params = typedef ram_architecture_params<ram_zksnark_machine_pp<ram_zksnark_ppT> >

Definition at line 68 of file ram_zksnark_params.hpp.

◆ ram_zksnark_auxiliary_input

template<typename ram_zksnark_ppT >
using libsnark::ram_zksnark_auxiliary_input = typedef ram_input_tape<ram_zksnark_machine_pp<ram_zksnark_ppT> >

Definition at line 76 of file ram_zksnark_params.hpp.

◆ ram_zksnark_machine_pp

template<typename ram_zksnark_ppT >
using libsnark::ram_zksnark_machine_pp = typedef typename ram_zksnark_ppT::machine_pp

Definition at line 64 of file ram_zksnark_params.hpp.

◆ ram_zksnark_PCD_pp

template<typename ram_zksnark_ppT >
using libsnark::ram_zksnark_PCD_pp = typedef typename ram_zksnark_ppT::PCD_pp

The interfaces of the RAM zkSNARK are templatized via the parameter ram_zksnark_ppT. When used, the interfaces must be invoked with a particular parameter choice; let 'my_ram_zksnark_pp' denote this choice.

The class my_ram_zksnark_pp must contain typedefs for the typenames

  • PCD_pp, and
  • machine_pp.

As well as a method with type signature: static void init_public_params()

For example, if you want to use the types my_PCD_pp and my_machine_pp, then you would declare my_ram_zksnark_pp as follows:

class my_ram_zksnark_pp { public: typedef my_PCD_pp PCD_pp; typedef my_machine_pp machine_pp; static void init_public_params() { PCD_pp::init_public_params(); // plus other necessary initialization } };

Having done the above, my_ram_zksnark_pp can be used as a template parameter.

See default_tinyram_zksnark_pp in the file

common/default_types/tinyram_zksnark_pp.hpp

for an example of the above steps for the case of "RAM=TinyRAM".

Definition at line 61 of file ram_zksnark_params.hpp.

◆ ram_zksnark_primary_input

template<typename ram_zksnark_ppT >
using libsnark::ram_zksnark_primary_input = typedef ram_boot_trace<ram_zksnark_machine_pp<ram_zksnark_ppT> >

Definition at line 72 of file ram_zksnark_params.hpp.

◆ reg_count_t

typedef size_t libsnark::reg_count_t

Definition at line 111 of file tinyram_aux.hpp.

◆ reg_width_t

typedef size_t libsnark::reg_width_t

Definition at line 112 of file tinyram_aux.hpp.

◆ set_commitment

typedef libff::bit_vector libsnark::set_commitment

Definition at line 22 of file set_commitment.hpp.

◆ set_commitment_variable

template<typename FieldT , typename HashT >
using libsnark::set_commitment_variable = typedef digest_variable<FieldT>

Definition at line 20 of file set_commitment_gadget.hpp.

◆ snark_pp

template<typename r1cs_ppzkadsnark_ppT >
using libsnark::snark_pp = typedef typename r1cs_ppzkadsnark_ppT::snark_pp

Below are various template aliases (used for convenience).

Definition at line 33 of file r1cs_ppzkadsnark_params.hpp.

◆ tbcs_auxiliary_input

A TBCS auxiliary input is a TBCS variable assignment.

Definition at line 119 of file tbcs.hpp.

◆ tbcs_ppzksnark_auxiliary_input

Definition at line 29 of file tbcs_ppzksnark_params.hpp.

◆ tbcs_ppzksnark_circuit

Below are various typedefs aliases (used for uniformity with other proof systems).

Definition at line 25 of file tbcs_ppzksnark_params.hpp.

◆ tbcs_ppzksnark_primary_input

Definition at line 27 of file tbcs_ppzksnark_params.hpp.

◆ tbcs_ppzksnark_processed_verification_key

A processed verification key for the TBCS ppzkSNARK.

Compared to a (non-processed) verification key, a processed verification key contains a small constant amount of additional pre-computed information that enables a faster verification time.

Definition at line 126 of file tbcs_ppzksnark.hpp.

◆ tbcs_ppzksnark_proof

template<typename ppT >
using libsnark::tbcs_ppzksnark_proof = typedef uscs_ppzksnark_proof<ppT>

A proof for the TBCS ppzkSNARK.

Definition at line 162 of file tbcs_ppzksnark.hpp.

◆ tbcs_ppzksnark_verification_key

template<typename ppT >
using libsnark::tbcs_ppzksnark_verification_key = typedef uscs_ppzksnark_verification_key<ppT>

A verification key for the TBCS ppzkSNARK.

Definition at line 113 of file tbcs_ppzksnark.hpp.

◆ tbcs_primary_input

A TBCS primary input is a TBCS variable assignment.

Definition at line 114 of file tbcs.hpp.

◆ tbcs_variable_assignment

typedef std::vector<bool> libsnark::tbcs_variable_assignment

A TBCS variable assignment is a vector of bools.

Definition at line 31 of file tbcs.hpp.

◆ tbcs_wire_t

typedef size_t libsnark::tbcs_wire_t

Definition at line 35 of file tbcs.hpp.

◆ tinyram_input_tape

typedef std::vector<size_t> libsnark::tinyram_input_tape

Definition at line 122 of file tinyram_aux.hpp.

◆ tinyram_input_tape_iterator

typedef tinyram_input_tape::const_iterator libsnark::tinyram_input_tape_iterator

Definition at line 124 of file tinyram_aux.hpp.

◆ uscs_auxiliary_input

template<typename FieldT >
using libsnark::uscs_auxiliary_input = typedef std::vector<FieldT>

Definition at line 51 of file uscs.hpp.

◆ uscs_constraint

template<typename FieldT >
using libsnark::uscs_constraint = typedef linear_combination<FieldT>

A USCS constraint is a formal expression of the form

           \sum_{i=1}^{m} a_i * x_{i} ,

where each a_i is in <FieldT> and each x_{i} is a formal variable.

A USCS constraint is used to construct a USCS constraint system (see below).

Definition at line 41 of file uscs.hpp.

◆ uscs_ppzksnark_auxiliary_input

template<typename ppT >
using libsnark::uscs_ppzksnark_auxiliary_input = typedef uscs_auxiliary_input<libff::Fr<ppT> >

Definition at line 32 of file uscs_ppzksnark_params.hpp.

◆ uscs_ppzksnark_constraint_system

template<typename ppT >
using libsnark::uscs_ppzksnark_constraint_system = typedef uscs_constraint_system<libff::Fr<ppT> >

Below are various template aliases (used for convenience).

Definition at line 26 of file uscs_ppzksnark_params.hpp.

◆ uscs_ppzksnark_primary_input

template<typename ppT >
using libsnark::uscs_ppzksnark_primary_input = typedef uscs_primary_input<libff::Fr<ppT> >

Definition at line 29 of file uscs_ppzksnark_params.hpp.

◆ uscs_primary_input

template<typename FieldT >
using libsnark::uscs_primary_input = typedef std::vector<FieldT>

A USCS variable assignment is a vector of <FieldT> elements that represents a candidate solution to a USCS constraint system (see below).

Definition at line 49 of file uscs.hpp.

◆ uscs_variable_assignment

template<typename FieldT >
using libsnark::uscs_variable_assignment = typedef std::vector<FieldT>

Definition at line 53 of file uscs.hpp.

◆ var_index_t

typedef size_t libsnark::var_index_t

Mnemonic typedefs.

Definition at line 29 of file variable.hpp.

Enumeration Type Documentation

◆ tbcs_gate_type

Types of TBCS gates (2-input boolean gates).

The order and names used below is taken from page 4 of [1].

Note that each gate's truth table is encoded in its 4-bit opcode. Namely, if g(X,Y) denotes the output of gate g with inputs X and Y, then OPCODE(g) = (g(0,0),g(0,1),g(1,0),g(1,1)) For example, if g is of type IF_X_THEN_Y, which has opcode 13, then the truth table of g is 1101 (13 in binary).

(Note that MSB above is g(0,0) and LSB is g(1,1))

References:

[1] = https://mitpress.mit.edu/sites/default/files/titles/content/9780262640688_sch_0001.pdf

Enumerator
TBCS_GATE_CONSTANT_0 
TBCS_GATE_AND 
TBCS_GATE_X_AND_NOT_Y 
TBCS_GATE_X 
TBCS_GATE_NOT_X_AND_Y 
TBCS_GATE_Y 
TBCS_GATE_XOR 
TBCS_GATE_OR 
TBCS_GATE_NOR 
TBCS_GATE_EQUIVALENCE 
TBCS_GATE_NOT_Y 
TBCS_GATE_IF_Y_THEN_X 
TBCS_GATE_NOT_X 
TBCS_GATE_IF_X_THEN_Y 
TBCS_GATE_NAND 
TBCS_GATE_CONSTANT_1 

Definition at line 55 of file tbcs.hpp.

55  {
57  TBCS_GATE_AND = 1,
59  TBCS_GATE_X = 3,
61  TBCS_GATE_Y = 5,
62  TBCS_GATE_XOR = 6,
63  TBCS_GATE_OR = 7,
64  TBCS_GATE_NOR = 8,
66  TBCS_GATE_NOT_Y = 10,
68  TBCS_GATE_NOT_X = 12,
70  TBCS_GATE_NAND = 14,
72 };

◆ tinyram_opcode

Enumerator
tinyram_opcode_AND 
tinyram_opcode_OR 
tinyram_opcode_XOR 
tinyram_opcode_NOT 
tinyram_opcode_ADD 
tinyram_opcode_SUB 
tinyram_opcode_MULL 
tinyram_opcode_UMULH 
tinyram_opcode_SMULH 
tinyram_opcode_UDIV 
tinyram_opcode_UMOD 
tinyram_opcode_SHL 
tinyram_opcode_SHR 
tinyram_opcode_CMPE 
tinyram_opcode_CMPA 
tinyram_opcode_CMPAE 
tinyram_opcode_CMPG 
tinyram_opcode_CMPGE 
tinyram_opcode_MOV 
tinyram_opcode_CMOV 
tinyram_opcode_JMP 
tinyram_opcode_CJMP 
tinyram_opcode_CNJMP 
tinyram_opcode_10111 
tinyram_opcode_11000 
tinyram_opcode_11001 
tinyram_opcode_STOREB 
tinyram_opcode_LOADB 
tinyram_opcode_STOREW 
tinyram_opcode_LOADW 
tinyram_opcode_READ 
tinyram_opcode_ANSWER 

Definition at line 26 of file tinyram_aux.hpp.

26  {
27  tinyram_opcode_AND = 0b00000,
28  tinyram_opcode_OR = 0b00001,
29  tinyram_opcode_XOR = 0b00010,
30  tinyram_opcode_NOT = 0b00011,
31  tinyram_opcode_ADD = 0b00100,
32  tinyram_opcode_SUB = 0b00101,
33  tinyram_opcode_MULL = 0b00110,
34  tinyram_opcode_UMULH = 0b00111,
35  tinyram_opcode_SMULH = 0b01000,
36  tinyram_opcode_UDIV = 0b01001,
37  tinyram_opcode_UMOD = 0b01010,
38  tinyram_opcode_SHL = 0b01011,
39  tinyram_opcode_SHR = 0b01100,
40 
41  tinyram_opcode_CMPE = 0b01101,
42  tinyram_opcode_CMPA = 0b01110,
43  tinyram_opcode_CMPAE = 0b01111,
44  tinyram_opcode_CMPG = 0b10000,
45  tinyram_opcode_CMPGE = 0b10001,
46 
47  tinyram_opcode_MOV = 0b10010,
48  tinyram_opcode_CMOV = 0b10011,
49 
50  tinyram_opcode_JMP = 0b10100,
51  tinyram_opcode_CJMP = 0b10101,
52  tinyram_opcode_CNJMP = 0b10110,
53 
54  tinyram_opcode_10111 = 0b10111,
55  tinyram_opcode_11000 = 0b11000,
56  tinyram_opcode_11001 = 0b11001,
57 
58  tinyram_opcode_STOREB = 0b11010,
59  tinyram_opcode_LOADB = 0b11011,
60  tinyram_opcode_STOREW = 0b11100,
61  tinyram_opcode_LOADW = 0b11101,
62  tinyram_opcode_READ = 0b11110,
63  tinyram_opcode_ANSWER = 0b11111
64 };

◆ tinyram_opcode_args

Enumerator
tinyram_opcode_args_des_arg1_arg2 
tinyram_opcode_args_des_arg2 
tinyram_opcode_args_arg1_arg2 
tinyram_opcode_args_arg2 
tinyram_opcode_args_none 
tinyram_opcode_args_arg2_des 

Definition at line 66 of file tinyram_aux.hpp.

Function Documentation

◆ as_waksman_get_canonical_row_idx()

size_t libsnark::as_waksman_get_canonical_row_idx ( const size_t  row_offset,
const size_t  row_idx 
)

Given either a position occupied either by its top or bottom ports, return the row index of its canonical position.

This function is agnostic to column_idx, given row_offset, so we omit column_idx.

Definition at line 227 of file as_waksman_routing_algorithm.cpp.

229 {
230  /* translate back relative to row_offset, clear LSB, and then translate
231  * forward */
232  return (((row_idx - row_offset) & ~1) + row_offset);
233 }
Here is the caller graph for this function:

◆ as_waksman_get_switch_setting_from_top_bottom_decision()

bool libsnark::as_waksman_get_switch_setting_from_top_bottom_decision ( const size_t  row_offset,
const size_t  packet_idx,
const bool  use_top 
)

Return a switch value that makes switch row_idx = as_waksman_switch_position_from_wire_position(row_offset, packet_idx) to route the wire packet_idx via the top (if top = true), resp., bottom (if top = false) subnetwork.

NOTE: pos is assumed to be

  • the input position for the LHS switches, and
  • the output position for the RHS switches.

Definition at line 245 of file as_waksman_routing_algorithm.cpp.

247 {
248  const size_t row_idx =
249  as_waksman_get_canonical_row_idx(row_offset, packet_idx);
250  return (packet_idx == row_idx) ^ use_top;
251 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ as_waksman_get_top_bottom_decision_from_switch_setting()

bool libsnark::as_waksman_get_top_bottom_decision_from_switch_setting ( const size_t  row_offset,
const size_t  packet_idx,
const bool  switch_setting 
)

Return true if the switch with input port at (column_idx, row_idx) when set to "straight" (if top = true), resp., "cross" (if top = false), routes the packet at (column_idx, row_idx) via the top subnetwork.

NOTE: packet_idx is assumed to be

  • the input position for the RHS switches, and
  • the output position for the LHS switches.

Definition at line 263 of file as_waksman_routing_algorithm.cpp.

265 {
266  const size_t row_idx =
267  as_waksman_get_canonical_row_idx(row_offset, packet_idx);
268  return (row_idx == packet_idx) ^ switch_setting;
269 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ as_waksman_num_columns()

size_t libsnark::as_waksman_num_columns ( const size_t  num_packets)

Return the number of (switch) columns in a AS-Waksman network for a given number of packets.

For example:

  • as_waksman_num_columns(2) = 1,
  • as_waksman_num_columns(3) = 3,
  • as_waksman_num_columns(4) = 3, and so on.

Definition at line 69 of file as_waksman_routing_algorithm.cpp.

70 {
71  return (num_packets > 1 ? 2 * libff::log2(num_packets) - 1 : 0);
72 }
Here is the caller graph for this function:

◆ as_waksman_other_input_position()

size_t libsnark::as_waksman_other_input_position ( const size_t  row_offset,
const size_t  packet_idx 
)

Given an input wire of a LHS switch, compute and return the input position of the other wire also connected to this switch.

Definition at line 287 of file as_waksman_routing_algorithm.cpp.

289 {
290  /* Due to symmetry, this function equals as_waksman_other_output_position.
291  */
292  return as_waksman_other_output_position(row_offset, packet_idx);
293 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ as_waksman_other_output_position()

size_t libsnark::as_waksman_other_output_position ( const size_t  row_offset,
const size_t  packet_idx 
)

Given an output wire of a RHS switch, compute and return the output position of the other wire also connected to this switch.

Definition at line 275 of file as_waksman_routing_algorithm.cpp.

277 {
278  const size_t row_idx =
279  as_waksman_get_canonical_row_idx(row_offset, packet_idx);
280  return (1 - (packet_idx - row_idx)) + row_idx;
281 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ as_waksman_route_inner()

void libsnark::as_waksman_route_inner ( const size_t  left,
const size_t  right,
const size_t  lo,
const size_t  hi,
const integer_permutation permutation,
const integer_permutation permutation_inv,
as_waksman_routing routing 
)

Compute AS-Waksman switch settings for the subnetwork occupying switch columns [left,left+1,...,right] that will route

  • from left-hand side inputs [lo,lo+1,...,hi]
  • to right-hand side destinations pi[lo],pi[lo+1],...,pi[hi].

The permutation

  • pi maps [lo, lo+1, ... hi] to itself, offset by lo, and
  • piinv is the inverse of pi.

NOTE: due to offsets, neither pi or piinv are instances of integer_permutation.

If there is more space for the routing network than required, then the topology for this subnetwork includes straight edges along its sides and no switches, so it suffices to recurse.

Non-trivial base case: switch settings for a 2-element permutation

The algorithm first assigns a setting to a LHS switch, route its target to RHS, which will enforce a RHS switch setting. Then, it back-routes the RHS value back to LHS. If this enforces a LHS switch setting, then forward-route that; otherwise we will select the next value from LHS to route.

ODD CASE: we first deal with the bottom-most straight wire, which is not connected to any of the switches at this level of recursion and just passed into the lower subnetwork.

Easy sub-case: it is routed directly to the bottom-most wire on RHS, so no switches need to be touched.

Other sub-case: the straight wire is routed to a switch on RHS, so route the other value from that switch using the lower subnetwork.

EVEN CASE: the bottom-most switch is fixed to a constant straight setting. So we route wire hi accordingly.

INVARIANT: the wire ‘to_route’ on LHS (if route_left = true), resp., RHS (if route_left = false) can be routed.

We have routed to the straight wire for the odd case, so now we back-route from it.

We know that the corresponding switch on the right-hand side cannot be set, so we set it according to the incoming wire.

We have arrived on the right-hand side, so the switch setting is fixed. Next, we back route from here.

Definition at line 308 of file as_waksman_routing_algorithm.cpp.

316 {
317  if (left > right) {
318  return;
319  }
320 
321  const size_t subnetwork_size = (hi - lo + 1);
322  const size_t subnetwork_width = as_waksman_num_columns(subnetwork_size);
323  assert(right - left + 1 >= subnetwork_width);
324 
325 #ifdef DEBUG
326  assert(permutation.min_element == lo);
327  assert(permutation.max_element == hi);
328  assert(permutation.size() == subnetwork_size);
329  assert(permutation.is_valid());
330  assert(permutation.inverse() == permutation_inv);
331 #endif
332 
333  if (right - left + 1 > subnetwork_width) {
340  left + 1, right - 1, lo, hi, permutation, permutation_inv, routing);
341  } else if (subnetwork_size == 2) {
345  assert(permutation.get(lo) == lo || permutation.get(lo) == lo + 1);
346  assert(
347  permutation.get(lo + 1) == lo || permutation.get(lo + 1) == lo + 1);
348  assert(permutation.get(lo) != permutation.get(lo + 1));
349 
350  routing[left][lo] = (permutation.get(lo) != lo);
351  } else {
359  integer_permutation new_permutation(lo, hi);
360  integer_permutation new_permutation_inv(lo, hi);
361  // offset by lo, i.e. lhs_routed[packet_idx-lo] is set if
362  // packet packet_idx is routed
363  std::vector<bool> lhs_routed(subnetwork_size, false);
364 
365  size_t to_route;
366  size_t max_unrouted;
367  bool route_left;
368 
369  if (subnetwork_size % 2 == 1) {
375  if (permutation.get(hi) == hi) {
380  new_permutation.set(hi, hi);
381  new_permutation_inv.set(hi, hi);
382  to_route = hi - 1;
383  route_left = true;
384  } else {
390  const size_t rhs_switch =
391  as_waksman_get_canonical_row_idx(lo, permutation.get(hi));
392  const bool rhs_switch_setting =
394  lo, permutation.get(hi), false);
395  routing[right][rhs_switch] = rhs_switch_setting;
396  size_t tprime = as_waksman_switch_input(
397  subnetwork_size, lo, rhs_switch, false);
398  new_permutation.set(hi, tprime);
399  new_permutation_inv.set(tprime, hi);
400 
401  to_route =
402  as_waksman_other_output_position(lo, permutation.get(hi));
403  route_left = false;
404  }
405 
406  lhs_routed[hi - lo] = true;
407  max_unrouted = hi - 1;
408  } else {
413  routing[left][hi - 1] = false;
414  to_route = hi;
415  route_left = true;
416  max_unrouted = hi;
417  }
418 
419  while (1) {
424  if (route_left) {
425  // If switch value has not been assigned, assign it arbitrarily.
426  const size_t lhs_switch =
427  as_waksman_get_canonical_row_idx(lo, to_route);
428  if (routing[left].find(lhs_switch) == routing[left].end()) {
429  routing[left][lhs_switch] = false;
430  }
431  const bool lhs_switch_setting = routing[left][lhs_switch];
432  const bool use_top =
434  lo, to_route, lhs_switch_setting);
435  const size_t t = as_waksman_switch_output(
436  subnetwork_size, lo, lhs_switch, use_top);
437  if (permutation.get(to_route) == hi) {
442  new_permutation.set(t, hi);
443  new_permutation_inv.set(hi, t);
444  lhs_routed[to_route - lo] = true;
445  to_route = max_unrouted;
446  route_left = true;
447  } else {
448  const size_t rhs_switch = as_waksman_get_canonical_row_idx(
449  lo, permutation.get(to_route));
455  assert(
456  routing[right].find(rhs_switch) ==
457  routing[right].end());
458  routing[right][rhs_switch] =
460  lo, permutation.get(to_route), use_top);
461  const size_t tprime = as_waksman_switch_input(
462  subnetwork_size, lo, rhs_switch, use_top);
463  new_permutation.set(t, tprime);
464  new_permutation_inv.set(tprime, t);
465 
466  lhs_routed[to_route - lo] = true;
468  lo, permutation.get(to_route));
469  route_left = false;
470  }
471  } else {
476  const size_t rhs_switch =
477  as_waksman_get_canonical_row_idx(lo, to_route);
478  const size_t lhs_switch = as_waksman_get_canonical_row_idx(
479  lo, permutation_inv.get(to_route));
480  assert(routing[right].find(rhs_switch) != routing[right].end());
481  const bool rhs_switch_setting = routing[right][rhs_switch];
482  const bool use_top =
484  lo, to_route, rhs_switch_setting);
485  const bool lhs_switch_setting =
487  lo, permutation_inv.get(to_route), use_top);
488 
489  /* The value on the left-hand side is either the same or not
490  * set. */
491 #ifndef NDEBUG
492  auto it = routing[left].find(lhs_switch);
493 #endif
494  assert(
495  it == routing[left].end() ||
496  it->second == lhs_switch_setting);
497  routing[left][lhs_switch] = lhs_switch_setting;
498 
499  const size_t t = as_waksman_switch_input(
500  subnetwork_size, lo, rhs_switch, use_top);
501  const size_t tprime = as_waksman_switch_output(
502  subnetwork_size, lo, lhs_switch, use_top);
503  new_permutation.set(tprime, t);
504  new_permutation_inv.set(t, tprime);
505 
506  lhs_routed[permutation_inv.get(to_route) - lo] = true;
508  lo, permutation_inv.get(to_route));
509  route_left = true;
510  }
511 
512  /* If the next packet to be routed hasn't been routed before, then
513  * try routing it. */
514  if (!route_left || !lhs_routed[to_route - lo]) {
515  continue;
516  }
517 
518  /* Otherwise just find the next unrouted packet. */
519  while (max_unrouted > lo && lhs_routed[max_unrouted - lo]) {
520  --max_unrouted;
521  }
522 
523  // lhs_routed[0] = corresponds to lo shifted by lo
524  if (max_unrouted < lo || (max_unrouted == lo && lhs_routed[0])) {
525  // All routed!
526  break;
527  } else {
528  to_route = max_unrouted;
529  route_left = true;
530  }
531  }
532 
533  if (subnetwork_size % 2 == 0) {
534  /* Remove the AS-Waksman switch with the fixed value. */
535  routing[left].erase(hi - 1);
536  }
537 
538  const size_t d = as_waksman_top_height(subnetwork_size);
539  const integer_permutation new_permutation_upper =
540  new_permutation.slice(lo, lo + d - 1);
541  const integer_permutation new_permutation_lower =
542  new_permutation.slice(lo + d, hi);
543 
544  const integer_permutation new_permutation_inv_upper =
545  new_permutation_inv.slice(lo, lo + d - 1);
546  const integer_permutation new_permutation_inv_lower =
547  new_permutation_inv.slice(lo + d, hi);
548 
550  left + 1,
551  right - 1,
552  lo,
553  lo + d - 1,
554  new_permutation_upper,
555  new_permutation_inv_upper,
556  routing);
558  left + 1,
559  right - 1,
560  lo + d,
561  hi,
562  new_permutation_lower,
563  new_permutation_inv_lower,
564  routing);
565  }
566 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ as_waksman_switch_input()

size_t libsnark::as_waksman_switch_input ( const size_t  num_packets,
const size_t  row_offset,
const size_t  row_idx,
const bool  use_top 
)

Return the input wire of a right-hand side switch of an AS-Waksman network for a given number of packets.

This function is analogous to as_waksman_switch_output above.

Definition at line 59 of file as_waksman_routing_algorithm.cpp.

64 {
65  /* Due to symmetry, this function equals as_waksman_switch_output. */
66  return as_waksman_switch_output(num_packets, row_offset, row_idx, use_top);
67 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ as_waksman_switch_output()

size_t libsnark::as_waksman_switch_output ( const size_t  num_packets,
const size_t  row_offset,
const size_t  row_idx,
const bool  use_top 
)

Return the input wire of a left-hand side switch of an AS-Waksman network for a given number of packets.

A switch is specified by a row index row_idx, relative to a "row_offset" that records the level of recursion. (The corresponding column index column_idx can be inferred from row_offset and num_packets, and it is easier to reason about implicitly.)

If top = true, return the top wire, otherwise return bottom wire.

Definition at line 41 of file as_waksman_routing_algorithm.cpp.

46 {
47  size_t relpos = row_idx - row_offset;
48  assert(relpos % 2 == 0 && relpos + 1 < num_packets);
49  return row_offset + (relpos / 2) +
50  (use_top ? 0 : as_waksman_top_height(num_packets));
51 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ as_waksman_top_height()

size_t libsnark::as_waksman_top_height ( const size_t  num_packets)

Return the height of the AS-Waksman network's top sub-network.

Definition at line 25 of file as_waksman_routing_algorithm.cpp.

26 {
27  return num_packets / 2;
28 }
Here is the caller graph for this function:

◆ bacs_ppzksnark_generator()

template<typename ppT >
bacs_ppzksnark_keypair<ppT> libsnark::bacs_ppzksnark_generator ( const bacs_ppzksnark_circuit< ppT > &  circuit)

A generator algorithm for the BACS ppzkSNARK.

Given a BACS circuit C, this algorithm produces proving and verification keys for C.

◆ bacs_ppzksnark_online_verifier_strong_IC()

template<typename ppT >
bool libsnark::bacs_ppzksnark_online_verifier_strong_IC ( const bacs_ppzksnark_processed_verification_key< ppT > &  pvk,
const bacs_ppzksnark_primary_input< ppT > &  primary_input,
const bacs_ppzksnark_proof< ppT > &  proof 
)

A verifier algorithm for the BACS ppzkSNARK that: (1) accepts a processed verification key, and (2) has strong input consistency.

◆ bacs_ppzksnark_online_verifier_weak_IC()

template<typename ppT >
bool libsnark::bacs_ppzksnark_online_verifier_weak_IC ( const bacs_ppzksnark_processed_verification_key< ppT > &  pvk,
const bacs_ppzksnark_primary_input< ppT > &  primary_input,
const bacs_ppzksnark_proof< ppT > &  proof 
)

A verifier algorithm for the BACS ppzkSNARK that: (1) accepts a processed verification key, and (2) has weak input consistency.

◆ bacs_ppzksnark_prover()

template<typename ppT >
bacs_ppzksnark_proof<ppT> libsnark::bacs_ppzksnark_prover ( const bacs_ppzksnark_proving_key< ppT > &  pk,
const bacs_ppzksnark_primary_input< ppT > &  primary_input,
const bacs_ppzksnark_auxiliary_input< ppT > &  auxiliary_input 
)

A prover algorithm for the BACS ppzkSNARK.

Given a BACS primary input X and a BACS auxiliary input Y, this algorithm produces a proof (of knowledge) that attests to the following statement: `‘there exists Y such that C(X,Y)=0’'. Above, C is the BACS circuit that was given as input to the generator algorithm.

◆ bacs_ppzksnark_verifier_process_vk()

template<typename ppT >
bacs_ppzksnark_processed_verification_key<ppT> libsnark::bacs_ppzksnark_verifier_process_vk ( const bacs_ppzksnark_verification_key< ppT > &  vk)

Convert a (non-processed) verification key into a processed verification key.

◆ bacs_ppzksnark_verifier_strong_IC()

template<typename ppT >
bool libsnark::bacs_ppzksnark_verifier_strong_IC ( const bacs_ppzksnark_verification_key< ppT > &  vk,
const bacs_ppzksnark_primary_input< ppT > &  primary_input,
const bacs_ppzksnark_proof< ppT > &  proof 
)

A verifier algorithm for the BACS ppzkSNARK that: (1) accepts a non-processed verification key, and (2) has strong input consistency.

◆ bacs_ppzksnark_verifier_weak_IC()

template<typename ppT >
bool libsnark::bacs_ppzksnark_verifier_weak_IC ( const bacs_ppzksnark_verification_key< ppT > &  vk,
const bacs_ppzksnark_primary_input< ppT > &  primary_input,
const bacs_ppzksnark_proof< ppT > &  proof 
)

A verifier algorithm for the BACS ppzkSNARK that: (1) accepts a non-processed verification key, and (2) has weak input consistency.

◆ bacs_to_r1cs_instance_map()

template<typename FieldT >
r1cs_constraint_system<FieldT> libsnark::bacs_to_r1cs_instance_map ( const bacs_circuit< FieldT > &  circuit)

Instance map for the BACS-to-R1CS reduction.

◆ bacs_to_r1cs_witness_map()

template<typename FieldT >
r1cs_variable_assignment<FieldT> libsnark::bacs_to_r1cs_witness_map ( const bacs_circuit< FieldT > &  circuit,
const bacs_primary_input< FieldT > &  primary_input,
const bacs_auxiliary_input< FieldT > &  auxiliary_input 
)

Witness map for the BACS-to-R1CS reduction.

◆ benes_cross_edge_mask()

size_t libsnark::benes_cross_edge_mask ( const size_t  dimension,
const size_t  column_idx 
)

Compute the mask for all the cross edges originating at a particular column.

Namely, the packet (column_idx, row_idx) (with column_idx < num_columns) can be routed to two destinations:

  • (column_idx+1, row_idx), if the switch handling that packet is set to the "straight" setting, and
  • (column_idx+1, row_idx XOR benes_cross_edge_mask(dimension, column_idx)) if the switch handling that packet is set to "cross" setting.

For example, all cross edges in the 0-th column flip the most significant bit of row_idx.

Definition at line 37 of file benes_routing_algorithm.cpp.

38 {
39  return (
40  column_idx < dimension ? 1ul << (dimension - 1 - column_idx)
41  : 1ul << (column_idx - dimension));
42 }
Here is the caller graph for this function:

◆ benes_get_switch_setting_from_subnetwork()

bool libsnark::benes_get_switch_setting_from_subnetwork ( const size_t  dimension,
const size_t  column_idx,
const size_t  row_idx,
const bool  use_top 
)

For a switch located at column_idx-th column and row_idx-th row, return the switch setting that would route its packet using the top subnetwork.

Definition at line 99 of file benes_routing_algorithm.cpp.

104 {
105  return (
106  row_idx !=
107  benes_lhs_packet_destination(dimension, column_idx, row_idx, use_top));
108 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ benes_lhs_packet_destination()

size_t libsnark::benes_lhs_packet_destination ( const size_t  dimension,
const size_t  column_idx,
const size_t  row_idx,
const bool  use_top 
)

Return the specified destination of packet of the left-hand side of the routing network, based on the subnetwork (recall that each packet has two possible destinations – one at the top subnetwork and one at the bottom subnetwork).

That is for a packet located at column_idx-th column and row_idx-th row, return:

  • row_idx' of the destination packet (column_idx+1, row_idx') at the top subnetwork (if use_top = true)
  • row_idx' of the destination packet (column_idx+1, row_idx') at the bottom subnetwork (if use_top = false)

Definition at line 59 of file benes_routing_algorithm.cpp.

64 {
65  const size_t mask = benes_cross_edge_mask(dimension, column_idx);
66  return (use_top ? row_idx & ~mask : row_idx | mask);
67 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ benes_num_columns()

size_t libsnark::benes_num_columns ( const size_t  num_packets)

Return the number of (switch) columns in a Benes network for a given number of packets.

For example:

  • benes_num_columns(2) = 2,
  • benes_num_columns(4) = 4,
  • benes_num_columns(8) = 6, and so on.

Definition at line 136 of file benes_routing_algorithm.cpp.

137 {
138  const size_t dimension = libff::log2(num_packets);
139  assert(num_packets == 1ul << dimension);
140 
141  return 2 * dimension;
142 }
Here is the caller graph for this function:

◆ benes_packet_cross_destination()

size_t libsnark::benes_packet_cross_destination ( const size_t  dimension,
const size_t  column_idx,
const size_t  row_idx 
)

A packet column_idx-th column and row_idx-th row of the routing network has two destinations (see comment by benes_cross_edge_mask), this returns row_idx' of the "cross" destination.

Definition at line 116 of file benes_routing_algorithm.cpp.

118 {
119  const size_t mask = benes_cross_edge_mask(dimension, column_idx);
120  return row_idx ^ mask;
121 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ benes_packet_cross_source()

size_t libsnark::benes_packet_cross_source ( const size_t  dimension,
const size_t  column_idx,
const size_t  packet_idx 
)

A packet column_idx-th column and row_idx-th row of the routing network has two source packets that could give rise to it (see comment by benes_cross_edge_mask), this returns row_idx' of the "cross" source packet.

Definition at line 129 of file benes_routing_algorithm.cpp.

131 {
133  dimension, column_idx - 1, packet_idx); /* by symmetry */
134 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ benes_rhs_packet_source()

size_t libsnark::benes_rhs_packet_source ( const size_t  dimension,
const size_t  column_idx,
const size_t  row_idx,
const bool  use_top 
)

Return the specified source of packet of the right-hand side of the routing network, based on the subnetwork (recall that each packet has two possible source packets – one at the top subnetwork and one at the bottom subnetwork).

That is for a packet located at column_idx-th column and row_idx-th row, return:

  • row_idx' of the destination packet (column_idx-1, row_idx') at the top subnetwork (if use_top = true)
  • row_idx' of the destination packet (column_idx-1, row_idx') at the bottom subnetwork (if use_top = false)

Definition at line 84 of file benes_routing_algorithm.cpp.

89 {
91  dimension, column_idx - 1, row_idx, use_top); /* by symmetry */
92 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ block_memory_contents()

memory_contents libsnark::block_memory_contents ( const size_t  num_addresses,
const size_t  value_size,
const size_t  block1_size,
const size_t  block2_size 
)

Sample memory contents consisting of two blocks of random values; the first block is located at the beginning of memory, while the second block is located half-way through memory.

Definition at line 23 of file memory_contents_examples.cpp.

28 {
29  const size_t max_unit = 1ul << value_size;
30 
31  memory_contents result;
32  for (size_t i = 0; i < block1_size; ++i) {
33  result[i] = std::rand() % max_unit;
34  }
35 
36  for (size_t i = 0; i < block2_size; ++i) {
37  result[num_addresses / 2 + i] = std::rand() % max_unit;
38  }
39 
40  return result;
41 }

◆ bls12_377_g2_untwist_frobenius_twist()

template<typename wppT >
G2_variable<wppT> libsnark::bls12_377_g2_untwist_frobenius_twist ( protoboard< libff::Fr< wppT >> &  pb,
const G2_variable< wppT > &  g2,
size_t  exp,
const std::string &  annotation_prefix 
)

Untwist-Frobenius-Twist operation on BLS12-377 G2 elements. (Note that evaluate should be called on the result, or its components, before using it in witness generation).

◆ construct_as_waksman_inner()

void libsnark::construct_as_waksman_inner ( const size_t  left,
const size_t  right,
const size_t  lo,
const size_t  hi,
const std::vector< size_t >  rhs_dests,
as_waksman_topology neighbors 
)

Construct AS-Waksman subnetwork occupying switch columns [left,left+1, ..., right] that will route

  • from left-hand side inputs [lo,lo+1,...,hi]
  • to right-hand side destinations rhs_dests[0],rhs_dests[1],...,rhs_dests[hi-lo+1]. That is, rhs_dests are 0-indexed w.r.t. row_offset of lo.

Note that rhs_dests is not a permutation of [lo, lo+1, ... hi].

This function fills out neighbors[left] and neighbors[right-1].

If there is more space for the routing network than needed, just add straight edges. This also handles the size-1 base case.

Networks of size sz > 2 are handled by adding two columns of switches alongside the network and recursing.

This adds floor(sz/2) switches alongside the network.

As per the AS-Waksman construction, one of the switches in the even case can be eliminated (i.e., set to a constant). We handle this later.

Odd special case: the last wire is not connected to any switch, and the wire is merely routed "straight".

Even special case: fix the bottom-most left-hand-side switch to a constant "straight" setting.

Definition at line 87 of file as_waksman_routing_algorithm.cpp.

94 {
95  if (left > right) {
96  return;
97  }
98 
99  const size_t subnetwork_size = (hi - lo + 1);
100  assert(rhs_dests.size() == subnetwork_size);
101  const size_t subnetwork_width = as_waksman_num_columns(subnetwork_size);
102  assert(right - left + 1 >= subnetwork_width);
103 
104  if (right - left + 1 > subnetwork_width) {
109  for (size_t packet_idx = lo; packet_idx <= hi; ++packet_idx) {
110  neighbors[left][packet_idx].first =
111  neighbors[left][packet_idx].second = packet_idx;
112  neighbors[right][packet_idx].first =
113  neighbors[right][packet_idx].second =
114  rhs_dests[packet_idx - lo];
115  }
116 
117  std::vector<size_t> new_rhs_dests(subnetwork_size, -1);
118  for (size_t packet_idx = lo; packet_idx <= hi; ++packet_idx) {
119  new_rhs_dests[packet_idx - lo] = packet_idx;
120  }
121 
123  left + 1, right - 1, lo, hi, new_rhs_dests, neighbors);
124  } else if (subnetwork_size == 2) {
125  /* Non-trivial base case: routing a 2-element permutation. */
126  neighbors[left][lo].first = neighbors[left][hi].second = rhs_dests[0];
127  neighbors[left][lo].second = neighbors[left][hi].first = rhs_dests[1];
128  } else {
133  std::vector<size_t> new_rhs_dests(subnetwork_size, -1);
134 
142  for (size_t row_idx = lo;
143  row_idx < (subnetwork_size % 2 == 1 ? hi : hi + 1);
144  row_idx += 2) {
145  neighbors[left][row_idx].first =
146  neighbors[left][row_idx + 1].second = as_waksman_switch_output(
147  subnetwork_size, lo, row_idx, true);
148  neighbors[left][row_idx].second =
149  neighbors[left][row_idx + 1].first = as_waksman_switch_output(
150  subnetwork_size, lo, row_idx, false);
151 
152  new_rhs_dests
153  [as_waksman_switch_input(subnetwork_size, lo, row_idx, true) -
154  lo] = row_idx;
155  new_rhs_dests
156  [as_waksman_switch_input(subnetwork_size, lo, row_idx, false) -
157  lo] = row_idx + 1;
158 
159  neighbors[right][row_idx].first =
160  neighbors[right][row_idx + 1].second = rhs_dests[row_idx - lo];
161  neighbors[right][row_idx].second =
162  neighbors[right][row_idx + 1].first =
163  rhs_dests[row_idx + 1 - lo];
164  }
165 
166  if (subnetwork_size % 2 == 1) {
172  neighbors[left][hi].first = neighbors[left][hi].second = hi;
173  neighbors[right][hi].first = neighbors[right][hi].second =
174  rhs_dests[hi - lo];
175  new_rhs_dests[hi - lo] = hi;
176  } else {
182  neighbors[left][hi - 1].second = neighbors[left][hi - 1].first;
183  neighbors[left][hi].second = neighbors[left][hi].first;
184  }
185 
186  const size_t d = as_waksman_top_height(subnetwork_size);
187  const std::vector<size_t> new_rhs_dests_top(
188  new_rhs_dests.begin(), new_rhs_dests.begin() + d);
189  const std::vector<size_t> new_rhs_dests_bottom(
190  new_rhs_dests.begin() + d, new_rhs_dests.end());
191 
193  left + 1, right - 1, lo, lo + d - 1, new_rhs_dests_top, neighbors);
195  left + 1, right - 1, lo + d, hi, new_rhs_dests_bottom, neighbors);
196  }
197 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ convert_gadgetlib2_linear_combination()

linear_combination<libff::Fr<libff::default_ec_pp> > libsnark::convert_gadgetlib2_linear_combination ( const gadgetlib2::GadgetLibAdapter::linear_combination_t lc)

Definition at line 15 of file integration.cpp.

17 {
18  typedef libff::Fr<libff::default_ec_pp> FieldT;
20 
21  linear_combination<FieldT> result = lc.second * variable<FieldT>(0);
22  for (const GLA::linear_term_t &lt : lc.first) {
23  result = result + lt.second * variable<FieldT>(lt.first + 1);
24  }
25 
26  return result;
27 }
Here is the caller graph for this function:

◆ create_linear_combination_constraints()

template<typename FieldT , typename VarT >
void libsnark::create_linear_combination_constraints ( protoboard< FieldT > &  pb,
const std::vector< FieldT > &  base,
const std::vector< std::pair< VarT, FieldT >> &  v,
const VarT &  target,
const std::string &  annotation_prefix 
)

◆ create_linear_combination_witness()

template<typename FieldT , typename VarT >
void libsnark::create_linear_combination_witness ( protoboard< FieldT > &  pb,
const std::vector< FieldT > &  base,
const std::vector< std::pair< VarT, FieldT >> &  v,
const VarT &  target 
)

◆ ensure_tinyram_opcode_value_map()

void libsnark::ensure_tinyram_opcode_value_map ( )

Definition at line 102 of file tinyram_aux.cpp.

103 {
104  if (opcode_values.empty()) {
105  for (auto it : tinyram_opcode_names) {
106  opcode_values[it.second] = it.first;
107  }
108  }
109 }
Here is the caller graph for this function:

◆ fp6_mul_by_non_residue()

template<typename Fp12T >
Fp6_3over2_variable<typename Fp12T::my_Fp6> libsnark::fp6_mul_by_non_residue ( protoboard< typename Fp12T::my_Fp > &  pb,
const Fp6_3over2_variable< typename Fp12T::my_Fp6 > &  c,
const std::string &  annotation_prefix 
)

Multiply an element in Fq6 by Fq12::non_residue. Let c = c0 + c1 * v + c2 * v^2 be an element of Fq6T, where v is a root of: v^3 - Fq6::non_residue Return c * v.

Note, this simplification does not save any complexity in the final circuit since Fp6_3over2_variable::operator*(const Fp6T &) (multiplication by a constant) can be implemented as linear combinations.

◆ fp6_mul_by_non_residue_inverse()

template<typename Fp12T >
Fp6_3over2_variable<typename Fp12T::my_Fp6> libsnark::fp6_mul_by_non_residue_inverse ( protoboard< typename Fp12T::my_Fp > &  pb,
const Fp6_3over2_variable< typename Fp12T::my_Fp6 > &  c,
const std::string &  annotation_prefix 
)

Let c = c0 + c1 * v + c2 * v^2 be an element of Fq6T, where v is a root of: v^3 - Fq6::non_residue and v is used as Fp12::non_residue. Return c * v^{-1} (= c * Fp12::non_residue^{-1})

◆ gen_r1cs_example_from_gadgetlib2_protoboard()

r1cs_example< libff::Fr< libff::default_ec_pp > > libsnark::gen_r1cs_example_from_gadgetlib2_protoboard ( const size_t  size)

Definition at line 19 of file simple_example.cpp.

20 {
21  typedef libff::Fr<libff::default_ec_pp> FieldT;
22 
24  // necessary in case a protoboard was built before, libsnark assumes
25  // variable indices always begin with 0 so we must reset the index before
26  // creating constraints which will be used by libsnark
28 
29  // create a gadgetlib2 gadget. This part is done by both generator and
30  // prover.
32  gadgetlib2::VariableArray A(size, "A");
33  gadgetlib2::VariableArray B(size, "B");
34  gadgetlib2::Variable result("result");
35  auto g = gadgetlib2::InnerProduct_Gadget::create(pb, A, B, result);
36  // create constraints. This part is done by generator.
37  g->generateConstraints();
38  // create assignment (witness). This part is done by prover.
39  for (size_t k = 0; k < size; ++k) {
40  pb->val(A[k]) = std::rand() % 2;
41  pb->val(B[k]) = std::rand() % 2;
42  }
43  g->generateWitness();
44  // translate constraint system to libsnark format.
45  r1cs_constraint_system<FieldT> cs =
47  // translate full variable assignment to libsnark format
48  const r1cs_variable_assignment<FieldT> full_assignment =
50  // extract primary and auxiliary input
51  const r1cs_primary_input<FieldT> primary_input(
52  full_assignment.begin(), full_assignment.begin() + cs.num_inputs());
53  const r1cs_auxiliary_input<FieldT> auxiliary_input(
54  full_assignment.begin() + cs.num_inputs(), full_assignment.end());
55 
56  assert(cs.is_valid());
57  assert(cs.is_satisfied(primary_input, auxiliary_input));
58 
59  return r1cs_example<FieldT>(cs, primary_input, auxiliary_input);
60 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gen_r1cs_example_from_protoboard()

template<typename FieldT >
r1cs_example<FieldT> libsnark::gen_r1cs_example_from_protoboard ( const size_t  num_constraints,
const size_t  num_inputs 
)

◆ gen_ram_example_complex()

template<typename ramT >
ram_example<ramT> libsnark::gen_ram_example_complex ( const ram_architecture_params< ramT > &  ap,
const size_t  boot_trace_size_bound,
const size_t  time_bound,
const bool  satisfiable = true 
)

For now: only specialized to TinyRAM

◆ gen_ram_example_simple()

template<typename ramT >
ram_example<ramT> libsnark::gen_ram_example_simple ( const ram_architecture_params< ramT > &  ap,
const size_t  boot_trace_size_bound,
const size_t  time_bound,
const bool  satisfiable = true 
)

For now: only specialized to TinyRAM

◆ generate_as_waksman_topology()

as_waksman_topology libsnark::generate_as_waksman_topology ( const size_t  num_packets)

Return the topology of an AS-Waksman network for a given number of packets.

See as_waksman_topology (above) for details.

Definition at line 199 of file as_waksman_routing_algorithm.cpp.

200 {
201  assert(num_packets > 1);
202  const size_t width = as_waksman_num_columns(num_packets);
203 
204  as_waksman_topology neighbors(
205  width,
206  std::vector<std::pair<size_t, size_t>>(
207  num_packets, std::make_pair<size_t, size_t>(-1, -1)));
208 
209  std::vector<size_t> rhs_dests(num_packets);
210  for (size_t packet_idx = 0; packet_idx < num_packets; ++packet_idx) {
211  rhs_dests[packet_idx] = packet_idx;
212  }
213 
215  0, width - 1, 0, num_packets - 1, rhs_dests, neighbors);
216 
217  return neighbors;
218 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ generate_bacs_example()

template<typename FieldT >
bacs_example<FieldT> libsnark::generate_bacs_example ( const size_t  primary_input_size,
const size_t  auxiliary_input_size,
const size_t  num_gates,
const size_t  num_outputs 
)

Generate a BACS example such that:

  • the primary input has size primary_input_size;
  • the auxiliary input has size auxiliary_input_size;
  • the circuit has num_gates gates;
  • the circuit has num_outputs (<= num_gates) output gates.

This is done by first selecting primary and auxiliary inputs uniformly at random, and then for each gate:

  • selecting random left and right wires from primary inputs, auxiliary inputs, and outputs of previous gates,
  • selecting random linear combinations for left and right wires, consisting of 1, 2, 3 or 4 terms each, with random coefficients,
  • if the gate is an output gate, then adding a random non-output wire to either left or right linear combination, with appropriate coefficient, so that the linear combination evaluates to 0.

◆ generate_benes_topology()

benes_topology libsnark::generate_benes_topology ( const size_t  num_packets)

Return the topology of a Benes network for a given number of packets.

See benes_topology (above) for details.

Definition at line 144 of file benes_routing_algorithm.cpp.

145 {
146  const size_t num_columns = benes_num_columns(num_packets);
147  const size_t dimension = libff::log2(num_packets);
148  assert(num_packets == 1ul << dimension);
149 
150  benes_topology result(num_columns);
151 
152  for (size_t column_idx = 0; column_idx < num_columns; ++column_idx) {
153  result[column_idx].resize(num_packets);
154  for (size_t packet_idx = 0; packet_idx < num_packets; ++packet_idx) {
155  result[column_idx][packet_idx].first = packet_idx;
156  result[column_idx][packet_idx].second =
158  dimension, column_idx, packet_idx);
159  }
160  }
161 
162  return result;
163 }
Here is the call graph for this function:

◆ generate_boolean_r1cs_constraint()

template<typename FieldT >
void libsnark::generate_boolean_r1cs_constraint ( protoboard< FieldT > &  pb,
const pb_linear_combination< FieldT > &  lc,
const std::string &  annotation_prefix = "" 
)

◆ generate_r1cs_equals_const_constraint()

template<typename FieldT >
void libsnark::generate_r1cs_equals_const_constraint ( protoboard< FieldT > &  pb,
const pb_linear_combination< FieldT > &  lc,
const FieldT &  c,
const std::string &  annotation_prefix = "" 
)

◆ generate_r1cs_example_with_binary_input()

template<typename FieldT >
r1cs_example<FieldT> libsnark::generate_r1cs_example_with_binary_input ( const size_t  num_constraints,
const size_t  num_inputs 
)

Generate a R1CS example such that:

  • the number of constraints of the R1CS constraint system is num_constraints;
  • the number of variables of the R1CS constraint system is (approximately) num_constraints;
  • the number of inputs of the R1CS constraint system is num_inputs;
  • the R1CS input consists of binary values (as opposed to `‘full’' field elements).

◆ generate_r1cs_example_with_field_input()

template<typename FieldT >
r1cs_example<FieldT> libsnark::generate_r1cs_example_with_field_input ( const size_t  num_constraints,
const size_t  num_inputs 
)

Generate a R1CS example such that:

  • the number of constraints of the R1CS constraint system is num_constraints;
  • the number of variables of the R1CS constraint system is (approximately) num_constraints;
  • the number of inputs of the R1CS constraint system is num_inputs;
  • the R1CS input consists of `‘full’' field elements (typically require the whole log|Field| bits to represent).
Here is the caller graph for this function:

◆ generate_tbcs_example()

tbcs_example libsnark::generate_tbcs_example ( const size_t  primary_input_size,
const size_t  auxiliary_input_size,
const size_t  num_gates,
const size_t  num_outputs 
)

Generate a TBCS example such that:

  • the primary input has size primary_input_size;
  • the auxiliary input has size auxiliary_input_size;
  • the circuit has num_gates gates;
  • the circuit has num_outputs (<= num_gates) output gates.

This is done by first selecting primary and auxiliary inputs uniformly at random, and then for each gate:

  • selecting random left and right wires from primary inputs, auxiliary inputs, and outputs of previous gates,
  • selecting a gate type at random (subject to the constraint "output = 0" if this is an output gate).

Definition at line 22 of file tbcs_examples.cpp.

27 {
28  tbcs_example example;
29  for (size_t i = 0; i < primary_input_size; ++i) {
30  example.primary_input.push_back(std::rand() % 2 == 0 ? false : true);
31  }
32 
33  for (size_t i = 0; i < auxiliary_input_size; ++i) {
34  example.auxiliary_input.push_back(std::rand() % 2 == 0 ? false : true);
35  }
36 
37  example.circuit.primary_input_size = primary_input_size;
38  example.circuit.auxiliary_input_size = auxiliary_input_size;
39 
40  tbcs_variable_assignment all_vals;
41  all_vals.insert(
42  all_vals.end(),
43  example.primary_input.begin(),
44  example.primary_input.end());
45  all_vals.insert(
46  all_vals.end(),
47  example.auxiliary_input.begin(),
48  example.auxiliary_input.end());
49 
50  for (size_t i = 0; i < num_gates; ++i) {
51  const size_t num_variables =
52  primary_input_size + auxiliary_input_size + i;
53  tbcs_gate gate;
54  gate.left_wire = std::rand() % (num_variables + 1);
55  gate.right_wire = std::rand() % (num_variables + 1);
56  gate.output = num_variables + 1;
57 
58  if (i >= num_gates - num_outputs) {
59  /* make gate a circuit output and fix */
60  do {
61  gate.type = (tbcs_gate_type)(std::rand() % num_tbcs_gate_types);
62  } while (gate.evaluate(all_vals));
63 
64  gate.is_circuit_output = true;
65  } else {
66  gate.type = (tbcs_gate_type)(std::rand() % num_tbcs_gate_types);
67  gate.is_circuit_output = false;
68  }
69 
70  example.circuit.add_gate(gate);
71  all_vals.push_back(gate.evaluate(all_vals));
72  }
73 
74  assert(example.circuit.is_satisfied(
75  example.primary_input, example.auxiliary_input));
76 
77  return example;
78 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ generate_tinyram_prelude()

std::vector< tinyram_instruction > libsnark::generate_tinyram_prelude ( const tinyram_architecture_params ap)

Definition at line 111 of file tinyram_aux.cpp.

113 {
114  std::vector<tinyram_instruction> result;
115  const size_t increment = libff::log2(ap.w) / 8;
116  const size_t mem_start = 1ul << (ap.w - 1);
117  // 0: store.w 0, r0
118  result.emplace_back(
119  tinyram_instruction(tinyram_opcode_STOREW, true, 0, 0, 0));
120  // 1: mov r0, 2^{W-1}
121  result.emplace_back(
122  tinyram_instruction(tinyram_opcode_MOV, true, 0, 0, mem_start));
123  // 2: read r1, 0
124  result.emplace_back(
125  tinyram_instruction(tinyram_opcode_READ, true, 1, 0, 0));
126  // 3: cjmp 7
127  result.emplace_back(
128  tinyram_instruction(tinyram_opcode_CJMP, true, 0, 0, 7));
129  // 4: add r0, r0, INCREMENT
130  result.emplace_back(
131  tinyram_instruction(tinyram_opcode_ADD, true, 0, 0, increment));
132  // 5: store.w r0, r1
133  result.emplace_back(
134  tinyram_instruction(tinyram_opcode_STOREW, false, 1, 0, 0));
135  // 6: jmp 2
136  result.emplace_back(tinyram_instruction(tinyram_opcode_JMP, true, 0, 0, 2));
137  // 7: store.w 2^{W-1}, r0
138  result.emplace_back(
139  tinyram_instruction(tinyram_opcode_STOREW, true, 0, 0, mem_start));
140  return result;
141 }
Here is the caller graph for this function:

◆ generate_uscs_example_with_binary_input()

template<typename FieldT >
uscs_example<FieldT> libsnark::generate_uscs_example_with_binary_input ( const size_t  num_constraints,
const size_t  num_inputs 
)

Generate a USCS example such that:

  • the number of constraints of the USCS constraint system is num_constraints;
  • the number of variables of the USCS constraint system is (approximately) num_constraints;
  • the number of inputs of the USCS constraint system is num_inputs;
  • the USCS input consists of binary values (as opposed to `‘full’' field elements).

◆ generate_uscs_example_with_field_input()

template<typename FieldT >
uscs_example<FieldT> libsnark::generate_uscs_example_with_field_input ( const size_t  num_constraints,
const size_t  num_inputs 
)

Generate a USCS example such that:

  • the number of constraints of the USCS constraint system is num_constraints;
  • the number of variables of the USCS constraint system is (approximately) num_constraints;
  • the number of inputs of the USCS constraint system is num_inputs;
  • the USCS input consists of `‘full’' field elements (typically require the whole log|Field| bits to represent).
Here is the caller graph for this function:

◆ get_as_waksman_routing()

as_waksman_routing libsnark::get_as_waksman_routing ( const integer_permutation permutation)

Route the given permutation on an AS-Waksman network of suitable size.

Definition at line 568 of file as_waksman_routing_algorithm.cpp.

570 {
571  const size_t num_packets = permutation.size();
572  const size_t width = as_waksman_num_columns(num_packets);
573 
574  as_waksman_routing routing(width);
576  0,
577  width - 1,
578  0,
579  num_packets - 1,
580  permutation,
581  permutation.inverse(),
582  routing);
583  return routing;
584 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_benes_routing()

benes_routing libsnark::get_benes_routing ( const integer_permutation permutation)

Route the given permutation on a Benes network of suitable size.

Definition at line 320 of file benes_routing_algorithm.cpp.

321 {
322  const size_t num_packets = permutation.size();
323  const size_t num_columns = benes_num_columns(num_packets);
324  const size_t dimension = libff::log2(num_packets);
325 
326  benes_routing routing(num_columns, libff::bit_vector(num_packets));
327 
329  dimension,
330  permutation,
331  permutation.inverse(),
332  0,
333  num_columns,
334  0,
335  num_packets,
336  routing);
337 
338  return routing;
339 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_constraint_system_from_gadgetlib2()

r1cs_constraint_system< libff::Fr< libff::default_ec_pp > > libsnark::get_constraint_system_from_gadgetlib2 ( const gadgetlib2::Protoboard pb)

Definition at line 30 of file integration.cpp.

31 {
32  typedef libff::Fr<libff::default_ec_pp> FieldT;
34 
35  r1cs_constraint_system<FieldT> result;
36  const GLA adapter;
37 
38  GLA::protoboard_t converted_pb = adapter.convert(pb);
39  for (const GLA::constraint_t &constr : converted_pb.first) {
40  result.constraints.emplace_back(r1cs_constraint<FieldT>(
41  convert_gadgetlib2_linear_combination(std::get<0>(constr)),
42  convert_gadgetlib2_linear_combination(std::get<1>(constr)),
43  convert_gadgetlib2_linear_combination(std::get<2>(constr))));
44  }
45  // The number of variables is the highest index created.
46  // TODO: If there are multiple protoboards, or variables not assigned to a
47  // protoboard, then getNextFreeIndex() is *not* the number of variables! See
48  // also in get_variable_assignment_from_gadgetlib2.
49  const size_t num_variables = GLA::getNextFreeIndex();
50  result.primary_input_size = pb.numInputs();
51  result.auxiliary_input_size = num_variables - pb.numInputs();
52  return result;
53 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_mp_compliance_step_pcd_circuit_input()

template<typename ppT >
r1cs_primary_input<libff::Fr<ppT> > libsnark::get_mp_compliance_step_pcd_circuit_input ( const set_commitment commitment_to_translation_step_r1cs_vks,
const r1cs_pcd_compliance_predicate_primary_input< libff::Fr< ppT >> &  primary_input 
)

Obtain the primary input for a compliance-step PCD circuit.

◆ get_mp_translation_step_pcd_circuit_input()

template<typename ppT >
r1cs_primary_input<libff::Fr<ppT> > libsnark::get_mp_translation_step_pcd_circuit_input ( const set_commitment commitment_to_translation_step_r1cs_vks,
const r1cs_pcd_compliance_predicate_primary_input< libff::Fr< other_curve< ppT >>> &  primary_input 
)

Obtain the primary input for a translation-step PCD circuit.

◆ get_sp_compliance_step_pcd_circuit_input()

template<typename ppT >
r1cs_primary_input<libff::Fr<ppT> > libsnark::get_sp_compliance_step_pcd_circuit_input ( const libff::bit_vector &  sp_translation_step_vk_bits,
const r1cs_pcd_compliance_predicate_primary_input< libff::Fr< ppT >> &  primary_input 
)

Obtain the primary input for a compliance-step PCD circuit.

◆ get_sp_translation_step_pcd_circuit_input()

template<typename ppT >
r1cs_primary_input<libff::Fr<ppT> > libsnark::get_sp_translation_step_pcd_circuit_input ( const libff::bit_vector &  sp_translation_step_vk_bits,
const r1cs_pcd_compliance_predicate_primary_input< libff::Fr< other_curve< ppT >>> &  primary_input 
)

Obtain the primary input for a translation-step PCD circuit.

◆ get_variable_assignment_from_gadgetlib2()

r1cs_variable_assignment< libff::Fr< libff::default_ec_pp > > libsnark::get_variable_assignment_from_gadgetlib2 ( const gadgetlib2::Protoboard pb)

Definition at line 56 of file integration.cpp.

57 {
58  typedef libff::Fr<libff::default_ec_pp> FieldT;
60 
61  // The number of variables is the highest index created. This is also the
62  // required size for the assignment vector.
63  // TODO: If there are multiple protoboards, or variables not assigned to a
64  // protoboard, then getNextFreeIndex() is *not* the number of variables! See
65  // also in get_constraint_system_from_gadgetlib2.
66  const size_t num_vars = GLA::getNextFreeIndex();
67  const GLA adapter;
68  r1cs_variable_assignment<FieldT> result(num_vars, FieldT::zero());
69  VariableAssignment assignment = pb.assignment();
70 
71  // Go over all assigned values of the protoboard, from every variable-value
72  // pair, put the value in the variable.index place of the new assignment.
73  for (VariableAssignment::iterator iter = assignment.begin();
74  iter != assignment.end();
75  ++iter) {
76  result[GLA::getVariableIndex(iter->first)] =
77  adapter.convert(iter->second);
78  }
79 
80  return result;
81 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ kc_batch_exp()

template<typename T1 , typename T2 , typename FieldT >
knowledge_commitment_vector<T1, T2> libsnark::kc_batch_exp ( const size_t  scalar_size,
const size_t  T1_window,
const size_t  T2_window,
const libff::window_table< T1 > &  T1_table,
const libff::window_table< T2 > &  T2_table,
const FieldT &  T1_coeff,
const FieldT &  T2_coeff,
const std::vector< FieldT > &  v,
const size_t  suggested_num_chunks,
const bool  output_special = false 
)

◆ kc_multi_exp_with_mixed_addition()

template<typename T1 , typename T2 , typename FieldT , libff::multi_exp_method Method, libff::multi_exp_base_form BaseForm = libff::multi_exp_base_form_normal>
knowledge_commitment<T1, T2> libsnark::kc_multi_exp_with_mixed_addition ( const knowledge_commitment_vector< T1, T2 > &  vec,
const size_t  min_idx,
const size_t  max_idx,
typename std::vector< FieldT >::const_iterator  scalar_start,
typename std::vector< FieldT >::const_iterator  scalar_end,
const size_t  chunks 
)

◆ load_preprocessed_program()

tinyram_program libsnark::load_preprocessed_program ( const tinyram_architecture_params ap,
std::istream &  preprocessed 
)

Definition at line 312 of file tinyram_aux.cpp.

314 {
316 
317  tinyram_program program;
318 
319  libff::enter_block("Loading program");
320  std::string instr, line;
321 
322  while (preprocessed >> instr) {
323  libff::print_indent();
324  size_t immflag, des, a1;
325  long long int a2;
326  if (preprocessed.good()) {
327  preprocessed >> immflag >> des >> a1 >> a2;
328  a2 = ((1ul << ap.w) + (a2 % (1ul << ap.w))) % (1ul << ap.w);
329  program.add_instruction(tinyram_instruction(
330  opcode_values[instr], immflag, des, a1, a2));
331  }
332  }
333  libff::leave_block("Loading program");
334 
335  return program;
336 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_tape()

tinyram_input_tape libsnark::load_tape ( std::istream &  tape)

Definition at line 369 of file tinyram_aux.cpp.

370 {
371  libff::enter_block("Loading tape");
372  tinyram_input_tape result;
373 
374  libff::print_indent();
375  printf("Tape contents:");
376  size_t cell;
377  while (tape >> cell) {
378  printf("\t%zu", cell);
379  result.emplace_back(cell);
380  }
381  printf("\n");
382 
383  libff::leave_block("Loading tape");
384  return result;
385 }
Here is the caller graph for this function:

◆ operator*() [1/8]

template<typename FieldT >
linear_combination<FieldT> libsnark::operator* ( const FieldT &  field_coeff,
const linear_combination< FieldT > &  lc 
)

◆ operator*() [2/8]

template<typename FieldT >
linear_term<FieldT> libsnark::operator* ( const FieldT &  field_coeff,
const linear_term< FieldT > &  lt 
)

◆ operator*() [3/8]

template<typename FieldT >
linear_term<FieldT> libsnark::operator* ( const FieldT &  field_coeff,
const variable< FieldT > &  var 
)

◆ operator*() [4/8]

template<typename FieldT >
linear_combination<FieldT> libsnark::operator* ( const integer_coeff_t  int_coeff,
const linear_combination< FieldT > &  lc 
)

◆ operator*() [5/8]

template<typename FieldT >
linear_term<FieldT> libsnark::operator* ( const integer_coeff_t  int_coeff,
const linear_term< FieldT > &  lt 
)

◆ operator*() [6/8]

template<typename FieldT >
linear_term<FieldT> libsnark::operator* ( const integer_coeff_t  int_coeff,
const variable< FieldT > &  var 
)

◆ operator*() [7/8]

template<typename T1 , typename T2 , mp_size_t m>
knowledge_commitment<T1, T2> libsnark::operator* ( const libff::bigint< m > &  lhs,
const knowledge_commitment< T1, T2 > &  rhs 
)

◆ operator*() [8/8]

template<typename T1 , typename T2 , mp_size_t m, const libff::bigint< m > & modulus_p>
knowledge_commitment<T1, T2> libsnark::operator* ( const libff::Fp_model< m, modulus_p > &  lhs,
const knowledge_commitment< T1, T2 > &  rhs 
)

◆ operator+() [1/6]

template<typename FieldT >
linear_combination<FieldT> libsnark::operator+ ( const FieldT &  field_coeff,
const linear_combination< FieldT > &  lc 
)

◆ operator+() [2/6]

template<typename FieldT >
linear_combination<FieldT> libsnark::operator+ ( const FieldT &  field_coeff,
const linear_term< FieldT > &  lt 
)

◆ operator+() [3/6]

template<typename FieldT >
linear_combination<FieldT> libsnark::operator+ ( const FieldT &  field_coeff,
const variable< FieldT > &  var 
)

◆ operator+() [4/6]

template<typename FieldT >
linear_combination<FieldT> libsnark::operator+ ( const integer_coeff_t  int_coeff,
const linear_combination< FieldT > &  lc 
)

◆ operator+() [5/6]

template<typename FieldT >
linear_combination<FieldT> libsnark::operator+ ( const integer_coeff_t  int_coeff,
const linear_term< FieldT > &  lt 
)

◆ operator+() [6/6]

template<typename FieldT >
linear_combination<FieldT> libsnark::operator+ ( const integer_coeff_t  int_coeff,
const variable< FieldT > &  var 
)

◆ operator-() [1/6]

template<typename FieldT >
linear_combination<FieldT> libsnark::operator- ( const FieldT &  field_coeff,
const linear_combination< FieldT > &  lc 
)

◆ operator-() [2/6]

template<typename FieldT >
linear_combination<FieldT> libsnark::operator- ( const FieldT &  field_coeff,
const linear_term< FieldT > &  lt 
)

◆ operator-() [3/6]

template<typename FieldT >
linear_combination<FieldT> libsnark::operator- ( const FieldT &  field_coeff,
const variable< FieldT > &  var 
)

◆ operator-() [4/6]

template<typename FieldT >
linear_combination<FieldT> libsnark::operator- ( const integer_coeff_t  int_coeff,
const linear_combination< FieldT > &  lc 
)

◆ operator-() [5/6]

template<typename FieldT >
linear_combination<FieldT> libsnark::operator- ( const integer_coeff_t  int_coeff,
const linear_term< FieldT > &  lt 
)

◆ operator-() [6/6]

template<typename FieldT >
linear_combination<FieldT> libsnark::operator- ( const integer_coeff_t  int_coeff,
const variable< FieldT > &  var 
)

◆ operator<<() [1/53]

template<typename T >
std::ostream & libsnark::operator<< ( std::ostream &  out,
const accumulation_vector< T > &  v 
)

◆ operator<<() [2/53]

template<typename FieldT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const bacs_circuit< FieldT > &  circuit 
)

◆ operator<<() [3/53]

template<typename FieldT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const bacs_gate< FieldT > &  g 
)

◆ operator<<() [4/53]

template<typename ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const bacs_ppzksnark_proving_key< ppT > &  pk 
)

◆ operator<<() [5/53]

std::ostream& libsnark::operator<< ( std::ostream &  out,
const fooram_architecture_params ap 
)

Definition at line 56 of file fooram_aux.cpp.

58 {
59  out << ap.w << "\n";
60  return out;
61 }

◆ operator<<() [6/53]

template<typename T1 , typename T2 >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const knowledge_commitment< T1, T2 > &  kc 
)

◆ operator<<() [7/53]

template<typename FieldT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const linear_combination< FieldT > &  lc 
)

◆ operator<<() [8/53]

template<typename FieldT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const r1cs_constraint< FieldT > &  c 
)

◆ operator<<() [9/53]

template<typename FieldT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const r1cs_constraint_system< FieldT > &  cs 
)

◆ operator<<() [10/53]

template<typename ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const r1cs_gg_ppzksnark_processed_verification_key< ppT > &  pvk 
)

◆ operator<<() [11/53]

template<typename ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const r1cs_gg_ppzksnark_proof< ppT > &  proof 
)

◆ operator<<() [12/53]

template<typename ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const r1cs_gg_ppzksnark_proving_key< ppT > &  pk 
)

◆ operator<<() [13/53]

template<typename ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const r1cs_gg_ppzksnark_verification_key< ppT > &  vk 
)

◆ operator<<() [14/53]

template<typename PCD_ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const r1cs_mp_ppzkpcd_processed_verification_key< PCD_ppT > &  pvk 
)

◆ operator<<() [15/53]

template<typename ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const r1cs_mp_ppzkpcd_proof< ppT > &  proof 
)

◆ operator<<() [16/53]

template<typename PCD_ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const r1cs_mp_ppzkpcd_proving_key< PCD_ppT > &  pk 
)

◆ operator<<() [17/53]

template<typename PCD_ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const r1cs_mp_ppzkpcd_verification_key< PCD_ppT > &  vk 
)

◆ operator<<() [18/53]

template<typename FieldT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const r1cs_pcd_compliance_predicate< FieldT > &  cp 
)

◆ operator<<() [19/53]

template<typename ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const r1cs_ppzkadsnark_auth_data< ppT > &  data 
)

◆ operator<<() [20/53]

template<typename ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const r1cs_ppzkadsnark_processed_verification_key< ppT > &  pvk 
)

◆ operator<<() [21/53]

template<typename ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const r1cs_ppzkadsnark_proof< ppT > &  proof 
)

◆ operator<<() [22/53]

template<typename ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const r1cs_ppzkadsnark_proving_key< ppT > &  pk 
)

◆ operator<<() [23/53]

template<typename ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const r1cs_ppzkadsnark_pub_auth_key< ppT > &  key 
)

◆ operator<<() [24/53]

template<typename ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const r1cs_ppzkadsnark_pub_auth_prms< ppT > &  pap 
)

◆ operator<<() [25/53]

template<typename ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const r1cs_ppzkadsnark_sec_auth_key< ppT > &  key 
)

◆ operator<<() [26/53]

template<typename ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const r1cs_ppzkadsnark_verification_key< ppT > &  vk 
)

◆ operator<<() [27/53]

template<typename ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const r1cs_ppzksnark_processed_verification_key< ppT > &  pvk 
)

◆ operator<<() [28/53]

template<typename ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const r1cs_ppzksnark_proof< ppT > &  proof 
)

◆ operator<<() [29/53]

template<typename ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const r1cs_ppzksnark_proving_key< ppT > &  pk 
)

◆ operator<<() [30/53]

template<typename ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const r1cs_ppzksnark_verification_key< ppT > &  vk 
)

◆ operator<<() [31/53]

template<typename ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const r1cs_se_ppzksnark_processed_verification_key< ppT > &  pvk 
)

◆ operator<<() [32/53]

template<typename ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const r1cs_se_ppzksnark_proof< ppT > &  proof 
)

◆ operator<<() [33/53]

template<typename ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const r1cs_se_ppzksnark_proving_key< ppT > &  pk 
)

◆ operator<<() [34/53]

template<typename ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const r1cs_se_ppzksnark_verification_key< ppT > &  vk 
)

◆ operator<<() [35/53]

template<typename PCD_ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const r1cs_sp_ppzkpcd_processed_verification_key< PCD_ppT > &  pvk 
)

◆ operator<<() [36/53]

template<typename PCD_ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const r1cs_sp_ppzkpcd_proving_key< PCD_ppT > &  pk 
)

◆ operator<<() [37/53]

template<typename PCD_ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const r1cs_sp_ppzkpcd_verification_key< PCD_ppT > &  vk 
)

◆ operator<<() [38/53]

template<typename ram_ppzksnark_ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const ram_ppzksnark_proving_key< ram_ppzksnark_ppT > &  pk 
)

◆ operator<<() [39/53]

template<typename ram_ppzksnark_ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const ram_ppzksnark_verification_key< ram_ppzksnark_ppT > &  vk 
)

◆ operator<<() [40/53]

template<typename ram_zksnark_ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const ram_zksnark_proof< ram_zksnark_ppT > &  proof 
)

◆ operator<<() [41/53]

template<typename ram_zksnark_ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const ram_zksnark_proving_key< ram_zksnark_ppT > &  pk 
)

◆ operator<<() [42/53]

template<typename ram_zksnark_ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const ram_zksnark_verification_key< ram_zksnark_ppT > &  vk 
)

◆ operator<<() [43/53]

std::ostream& libsnark::operator<< ( std::ostream &  out,
const set_membership_proof proof 
)

Definition at line 31 of file set_commitment.cpp.

32 {
33  out << proof.address << "\n";
34  out << proof.merkle_path.size() << "\n";
35  for (size_t i = 0; i < proof.merkle_path.size(); ++i) {
36  libff::output_bool_vector(out, proof.merkle_path[i]);
37  }
38 
39  return out;
40 }

◆ operator<<() [44/53]

template<typename T >
std::ostream & libsnark::operator<< ( std::ostream &  out,
const sparse_vector< T > &  v 
)

◆ operator<<() [45/53]

std::ostream& libsnark::operator<< ( std::ostream &  out,
const tbcs_circuit circuit 
)

Definition at line 289 of file tbcs.cpp.

290 {
291  out << circuit.primary_input_size << "\n";
292  out << circuit.auxiliary_input_size << "\n";
293  libff::operator<<(out, circuit.gates);
294  out << OUTPUT_NEWLINE;
295 
296  return out;
297 }

◆ operator<<() [46/53]

std::ostream& libsnark::operator<< ( std::ostream &  out,
const tbcs_gate g 
)

Definition at line 134 of file tbcs.cpp.

135 {
136  out << g.left_wire << "\n";
137  out << g.right_wire << "\n";
138  out << (int)g.type << "\n";
139  out << g.output << "\n";
140  libff::output_bool(out, g.is_circuit_output);
141 
142  return out;
143 }

◆ operator<<() [47/53]

template<typename ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const tbcs_ppzksnark_proving_key< ppT > &  pk 
)

◆ operator<<() [48/53]

std::ostream& libsnark::operator<< ( std::ostream &  out,
const tinyram_architecture_params ap 
)

Definition at line 242 of file tinyram_aux.cpp.

244 {
245  out << ap.w << "\n";
246  out << ap.k << "\n";
247  return out;
248 }

◆ operator<<() [49/53]

template<typename FieldT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const uscs_constraint_system< FieldT > &  cs 
)

◆ operator<<() [50/53]

template<typename ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const uscs_ppzksnark_processed_verification_key< ppT > &  pvk 
)

◆ operator<<() [51/53]

template<typename ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const uscs_ppzksnark_proof< ppT > &  proof 
)

◆ operator<<() [52/53]

template<typename ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const uscs_ppzksnark_proving_key< ppT > &  pk 
)

◆ operator<<() [53/53]

template<typename ppT >
std::ostream& libsnark::operator<< ( std::ostream &  out,
const uscs_ppzksnark_verification_key< ppT > &  vk 
)

◆ operator>>() [1/53]

template<typename T >
std::istream & libsnark::operator>> ( std::istream &  in,
accumulation_vector< T > &  v 
)

◆ operator>>() [2/53]

template<typename FieldT >
std::istream& libsnark::operator>> ( std::istream &  in,
bacs_circuit< FieldT > &  circuit 
)

◆ operator>>() [3/53]

template<typename FieldT >
std::istream& libsnark::operator>> ( std::istream &  in,
bacs_gate< FieldT > &  g 
)

◆ operator>>() [4/53]

template<typename ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
bacs_ppzksnark_proving_key< ppT > &  pk 
)

◆ operator>>() [5/53]

std::istream& libsnark::operator>> ( std::istream &  in,
fooram_architecture_params ap 
)

Definition at line 63 of file fooram_aux.cpp.

64 {
65  in >> ap.w;
66  libff::consume_newline(in);
67  return in;
68 }

◆ operator>>() [6/53]

template<typename T1 , typename T2 >
std::istream& libsnark::operator>> ( std::istream &  in,
knowledge_commitment< T1, T2 > &  kc 
)

◆ operator>>() [7/53]

template<typename FieldT >
std::istream& libsnark::operator>> ( std::istream &  in,
linear_combination< FieldT > &  lc 
)

◆ operator>>() [8/53]

template<typename FieldT >
std::istream& libsnark::operator>> ( std::istream &  in,
r1cs_constraint< FieldT > &  c 
)

◆ operator>>() [9/53]

template<typename FieldT >
std::istream& libsnark::operator>> ( std::istream &  in,
r1cs_constraint_system< FieldT > &  cs 
)

◆ operator>>() [10/53]

template<typename ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
r1cs_gg_ppzksnark_processed_verification_key< ppT > &  pvk 
)

◆ operator>>() [11/53]

template<typename ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
r1cs_gg_ppzksnark_proof< ppT > &  proof 
)

◆ operator>>() [12/53]

template<typename ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
r1cs_gg_ppzksnark_proving_key< ppT > &  pk 
)

◆ operator>>() [13/53]

template<typename ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
r1cs_gg_ppzksnark_verification_key< ppT > &  vk 
)

◆ operator>>() [14/53]

template<typename PCD_ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
r1cs_mp_ppzkpcd_processed_verification_key< PCD_ppT > &  pvk 
)

◆ operator>>() [15/53]

template<typename ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
r1cs_mp_ppzkpcd_proof< ppT > &  proof 
)

◆ operator>>() [16/53]

template<typename PCD_ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
r1cs_mp_ppzkpcd_proving_key< PCD_ppT > &  pk 
)

◆ operator>>() [17/53]

template<typename PCD_ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
r1cs_mp_ppzkpcd_verification_key< PCD_ppT > &  vk 
)

◆ operator>>() [18/53]

template<typename FieldT >
std::istream& libsnark::operator>> ( std::istream &  in,
r1cs_pcd_compliance_predicate< FieldT > &  cp 
)

◆ operator>>() [19/53]

template<typename ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
r1cs_ppzkadsnark_auth_data< ppT > &  data 
)

◆ operator>>() [20/53]

template<typename ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
r1cs_ppzkadsnark_processed_verification_key< ppT > &  pvk 
)

◆ operator>>() [21/53]

template<typename ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
r1cs_ppzkadsnark_proof< ppT > &  proof 
)

◆ operator>>() [22/53]

template<typename ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
r1cs_ppzkadsnark_proving_key< ppT > &  pk 
)

◆ operator>>() [23/53]

template<typename ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
r1cs_ppzkadsnark_pub_auth_key< ppT > &  key 
)

◆ operator>>() [24/53]

template<typename ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
r1cs_ppzkadsnark_pub_auth_prms< ppT > &  pap 
)

◆ operator>>() [25/53]

template<typename ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
r1cs_ppzkadsnark_sec_auth_key< ppT > &  key 
)

◆ operator>>() [26/53]

template<typename ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
r1cs_ppzkadsnark_verification_key< ppT > &  vk 
)

◆ operator>>() [27/53]

template<typename ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
r1cs_ppzksnark_processed_verification_key< ppT > &  pvk 
)

◆ operator>>() [28/53]

template<typename ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
r1cs_ppzksnark_proof< ppT > &  proof 
)

◆ operator>>() [29/53]

template<typename ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
r1cs_ppzksnark_proving_key< ppT > &  pk 
)

◆ operator>>() [30/53]

template<typename ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
r1cs_ppzksnark_verification_key< ppT > &  vk 
)

◆ operator>>() [31/53]

template<typename ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
r1cs_se_ppzksnark_processed_verification_key< ppT > &  pvk 
)

◆ operator>>() [32/53]

template<typename ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
r1cs_se_ppzksnark_proof< ppT > &  proof 
)

◆ operator>>() [33/53]

template<typename ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
r1cs_se_ppzksnark_proving_key< ppT > &  pk 
)

◆ operator>>() [34/53]

template<typename ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
r1cs_se_ppzksnark_verification_key< ppT > &  vk 
)

◆ operator>>() [35/53]

template<typename PCD_ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
r1cs_sp_ppzkpcd_processed_verification_key< PCD_ppT > &  pvk 
)

◆ operator>>() [36/53]

template<typename PCD_ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
r1cs_sp_ppzkpcd_proving_key< PCD_ppT > &  pk 
)

◆ operator>>() [37/53]

template<typename PCD_ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
r1cs_sp_ppzkpcd_verification_key< PCD_ppT > &  vk 
)

◆ operator>>() [38/53]

template<typename ram_ppzksnark_ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
ram_ppzksnark_proving_key< ram_ppzksnark_ppT > &  pk 
)

◆ operator>>() [39/53]

template<typename ram_ppzksnark_ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
ram_ppzksnark_verification_key< ram_ppzksnark_ppT > &  vk 
)

◆ operator>>() [40/53]

template<typename ram_zksnark_ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
ram_zksnark_proof< ram_zksnark_ppT > &  proof 
)

◆ operator>>() [41/53]

template<typename ram_zksnark_ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
ram_zksnark_proving_key< ram_zksnark_ppT > &  pk 
)

◆ operator>>() [42/53]

template<typename ram_zksnark_ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
ram_zksnark_verification_key< ram_zksnark_ppT > &  vk 
)

◆ operator>>() [43/53]

std::istream& libsnark::operator>> ( std::istream &  in,
set_membership_proof proof 
)

Definition at line 42 of file set_commitment.cpp.

43 {
44  in >> proof.address;
45  libff::consume_newline(in);
46  size_t tree_depth;
47  in >> tree_depth;
48  libff::consume_newline(in);
49  proof.merkle_path.resize(tree_depth);
50 
51  for (size_t i = 0; i < tree_depth; ++i) {
52  libff::input_bool_vector(in, proof.merkle_path[i]);
53  }
54 
55  return in;
56 }

◆ operator>>() [44/53]

template<typename T >
std::istream & libsnark::operator>> ( std::istream &  in,
sparse_vector< T > &  v 
)

◆ operator>>() [45/53]

std::istream& libsnark::operator>> ( std::istream &  in,
tbcs_circuit circuit 
)

Definition at line 299 of file tbcs.cpp.

300 {
301  in >> circuit.primary_input_size;
302  libff::consume_newline(in);
303  in >> circuit.auxiliary_input_size;
304  libff::consume_newline(in);
305  libff::operator>>(in, circuit.gates);
306  libff::consume_OUTPUT_NEWLINE(in);
307 
308  return in;
309 }

◆ operator>>() [46/53]

std::istream& libsnark::operator>> ( std::istream &  in,
tbcs_gate g 
)

Definition at line 145 of file tbcs.cpp.

146 {
147  in >> g.left_wire;
148  libff::consume_newline(in);
149  in >> g.right_wire;
150  libff::consume_newline(in);
151  int tmp;
152  in >> tmp;
153  g.type = (tbcs_gate_type)tmp;
154  libff::consume_newline(in);
155  in >> g.output;
156  libff::input_bool(in, g.is_circuit_output);
157 
158  return in;
159 }

◆ operator>>() [47/53]

template<typename ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
tbcs_ppzksnark_proving_key< ppT > &  pk 
)

◆ operator>>() [48/53]

std::istream& libsnark::operator>> ( std::istream &  in,
tinyram_architecture_params ap 
)

Definition at line 250 of file tinyram_aux.cpp.

251 {
252  in >> ap.w;
253  libff::consume_newline(in);
254  in >> ap.k;
255  libff::consume_newline(in);
256  return in;
257 }

◆ operator>>() [49/53]

template<typename FieldT >
std::istream& libsnark::operator>> ( std::istream &  in,
uscs_constraint_system< FieldT > &  cs 
)

◆ operator>>() [50/53]

template<typename ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
uscs_ppzksnark_processed_verification_key< ppT > &  pvk 
)

◆ operator>>() [51/53]

template<typename ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
uscs_ppzksnark_proof< ppT > &  proof 
)

◆ operator>>() [52/53]

template<typename ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
uscs_ppzksnark_proving_key< ppT > &  pk 
)

◆ operator>>() [53/53]

template<typename ppT >
std::istream& libsnark::operator>> ( std::istream &  in,
uscs_ppzksnark_verification_key< ppT > &  vk 
)

◆ opt_window_wnaf_exp()

template<typename T1 , typename T2 , mp_size_t n>
knowledge_commitment<T1, T2> libsnark::opt_window_wnaf_exp ( const knowledge_commitment< T1, T2 > &  base,
const libff::bigint< n > &  scalar,
const size_t  scalar_bits 
)

◆ pb_coeff_sum()

template<typename FieldT >
linear_combination<FieldT> libsnark::pb_coeff_sum ( const pb_linear_combination_array< FieldT > &  v,
const std::vector< FieldT > &  coeffs 
)

◆ pb_packing_sum()

template<typename FieldT >
linear_combination<FieldT> libsnark::pb_packing_sum ( const pb_linear_combination_array< FieldT > &  v)

◆ pb_sum()

template<typename FieldT >
linear_combination<FieldT> libsnark::pb_sum ( const pb_linear_combination_array< FieldT > &  v)

◆ pb_variable_allocate()

template<typename FieldT >
pb_variable<FieldT> libsnark::pb_variable_allocate ( protoboard< FieldT > &  pb,
const std::string &  annotation 
)

A utility function which creates and allocates a variable in a single step (and can therefore be used in initalizer lists, which greatly simplifies many constructors).

TODO: Why does pb_variable not have an allocating constructor of this form, even further simplifying a lot of code. Move this to an appropriate constructor if there are no issues.

◆ prfCompute()

template<typename ppT >
libff::Fr<snark_pp<ppT> > libsnark::prfCompute ( const r1cs_ppzkadsnark_prfKeyT< ppT > &  key,
const labelT label 
)

◆ prfGen()

template<typename ppT >
r1cs_ppzkadsnark_prfKeyT<ppT> libsnark::prfGen ( )

◆ PRINT_CONSTRAINT_PROFILING()

size_t libsnark::PRINT_CONSTRAINT_PROFILING ( )

Definition at line 23 of file constraint_profiling.cpp.

24 {
25  size_t accounted = 0;
26  libff::print_indent();
27  printf("Constraint profiling:\n");
28  for (constraint_profiling_entry &ent : constraint_profiling_table) {
29  if (ent.indent == 0) {
30  accounted += ent.count;
31  }
32 
33  libff::print_indent();
34  for (size_t i = 0; i < ent.indent; ++i) {
35  printf(" ");
36  }
37  printf(
38  "* Number of constraints in [%s]: %zu\n",
39  ent.annotation.c_str(),
40  ent.count);
41  }
42 
45 
46  return accounted;
47 }

◆ print_tbcs_wire()

void libsnark::print_tbcs_wire ( const tbcs_wire_t  wire,
const std::map< size_t, std::string > &  variable_annotations 
)

The type tbcs_wire_t does not deserve promotion to a class, but still benefits from a dedicated printing mechanism.

Definition at line 40 of file tbcs.cpp.

43 {
48  if (wire == 0) {
49  printf(" 1");
50  } else {
51  auto it = variable_annotations.find(wire);
52  printf(
53  " x_%zu (%s)",
54  wire,
55  (it == variable_annotations.end() ? "no annotation"
56  : it->second.c_str()));
57  }
58 }
Here is the caller graph for this function:

◆ r1cs_gg_ppzksnark_affine_verifier_weak_IC()

template<typename ppT >
bool libsnark::r1cs_gg_ppzksnark_affine_verifier_weak_IC ( const r1cs_gg_ppzksnark_verification_key< ppT > &  vk,
const r1cs_gg_ppzksnark_primary_input< ppT > &  primary_input,
const r1cs_gg_ppzksnark_proof< ppT > &  proof 
)

For debugging purposes (of r1cs_gg_ppzksnark_r1cs_gg_ppzksnark_verifier_gadget):

A verifier algorithm for the R1CS GG-ppzkSNARK that: (1) accepts a non-processed verification key, (2) has weak input consistency, and (3) uses affine coordinates for elliptic-curve computations.

◆ r1cs_gg_ppzksnark_generator()

template<typename ppT , libff::multi_exp_base_form BaseForm = libff::multi_exp_base_form_special>
r1cs_gg_ppzksnark_keypair<ppT> libsnark::r1cs_gg_ppzksnark_generator ( const r1cs_gg_ppzksnark_constraint_system< ppT > &  cs,
bool  force_pow_2_domain = false 
)

A generator algorithm for the R1CS GG-ppzkSNARK.

Given a R1CS constraint system CS, this algorithm produces proving and verification keys for CS.

◆ r1cs_gg_ppzksnark_generator_from_secrets()

template<typename ppT , libff::multi_exp_base_form BaseForm = libff::multi_exp_base_form_special>
r1cs_gg_ppzksnark_keypair<ppT> libsnark::r1cs_gg_ppzksnark_generator_from_secrets ( const r1cs_gg_ppzksnark_constraint_system< ppT > &  cs,
const libff::Fr< ppT > &  t,
const libff::Fr< ppT > &  alpha,
const libff::Fr< ppT > &  beta,
const libff::Fr< ppT > &  delta,
const libff::G1< ppT > &  g1_generator,
const libff::G2< ppT > &  g2_generator,
bool  force_pow_2_domain = false 
)

A generator algorithm for the R1CS GG-ppzkSNARK.

Given a R1CS constraint system CS and vaules for all secrets, produce the proving and verification keys for CS. Optionally force the domain size

◆ r1cs_gg_ppzksnark_online_verifier_strong_IC()

template<typename ppT >
bool libsnark::r1cs_gg_ppzksnark_online_verifier_strong_IC ( const r1cs_gg_ppzksnark_processed_verification_key< ppT > &  pvk,
const r1cs_gg_ppzksnark_primary_input< ppT > &  primary_input,
const r1cs_gg_ppzksnark_proof< ppT > &  proof 
)

A verifier algorithm for the R1CS GG-ppzkSNARK that: (1) accepts a processed verification key, and (2) has strong input consistency.

◆ r1cs_gg_ppzksnark_online_verifier_weak_IC()

template<typename ppT >
bool libsnark::r1cs_gg_ppzksnark_online_verifier_weak_IC ( const r1cs_gg_ppzksnark_processed_verification_key< ppT > &  pvk,
const r1cs_gg_ppzksnark_primary_input< ppT > &  input,
const r1cs_gg_ppzksnark_proof< ppT > &  proof 
)

A verifier algorithm for the R1CS GG-ppzkSNARK that: (1) accepts a processed verification key, and (2) has weak input consistency.

◆ r1cs_gg_ppzksnark_prover()

template<typename ppT , libff::multi_exp_method Method = libff::multi_exp_method_BDLO12_signed, libff::multi_exp_base_form BaseForm = libff::multi_exp_base_form_special>
r1cs_gg_ppzksnark_proof<ppT> libsnark::r1cs_gg_ppzksnark_prover ( const r1cs_gg_ppzksnark_proving_key< ppT > &  pk,
const r1cs_gg_ppzksnark_primary_input< ppT > &  primary_input,
const r1cs_gg_ppzksnark_auxiliary_input< ppT > &  auxiliary_input,
bool  force_pow_2_domain = false 
)

A prover algorithm for the R1CS GG-ppzkSNARK.

Given a R1CS primary input X and a R1CS auxiliary input Y, this algorithm produces a proof (of knowledge) that attests to the following statement: ''there exists Y such that CS(X,Y)=0'' Above, CS is the R1CS constraint system that was given as input to the generator algorithm.

◆ r1cs_gg_ppzksnark_verifier_process_vk()

template<typename ppT >
r1cs_gg_ppzksnark_processed_verification_key<ppT> libsnark::r1cs_gg_ppzksnark_verifier_process_vk ( const r1cs_gg_ppzksnark_verification_key< ppT > &  vk)

Convert a (non-processed) verification key into a processed verification key.

◆ r1cs_gg_ppzksnark_verifier_strong_IC()

template<typename ppT >
bool libsnark::r1cs_gg_ppzksnark_verifier_strong_IC ( const r1cs_gg_ppzksnark_verification_key< ppT > &  vk,
const r1cs_gg_ppzksnark_primary_input< ppT > &  primary_input,
const r1cs_gg_ppzksnark_proof< ppT > &  proof 
)

A verifier algorithm for the R1CS GG-ppzkSNARK that: (1) accepts a non-processed verification key, and (2) has strong input consistency.

◆ r1cs_gg_ppzksnark_verifier_weak_IC()

template<typename ppT >
bool libsnark::r1cs_gg_ppzksnark_verifier_weak_IC ( const r1cs_gg_ppzksnark_verification_key< ppT > &  vk,
const r1cs_gg_ppzksnark_primary_input< ppT > &  primary_input,
const r1cs_gg_ppzksnark_proof< ppT > &  proof 
)

A verifier algorithm for the R1CS GG-ppzkSNARK that: (1) accepts a non-processed verification key, and (2) has weak input consistency.

◆ r1cs_mp_ppzkpcd_generator()

template<typename PCD_ppT >
r1cs_mp_ppzkpcd_keypair<PCD_ppT> libsnark::r1cs_mp_ppzkpcd_generator ( const std::vector< r1cs_mp_ppzkpcd_compliance_predicate< PCD_ppT >> &  compliance_predicates)

A generator algorithm for the R1CS (multi-predicate) ppzkPCD.

Given a vector of compliance predicates, this algorithm produces proving and verification keys for the vector.

◆ r1cs_mp_ppzkpcd_online_verifier()

template<typename PCD_ppT >
bool libsnark::r1cs_mp_ppzkpcd_online_verifier ( const r1cs_mp_ppzkpcd_processed_verification_key< PCD_ppT > &  pvk,
const r1cs_mp_ppzkpcd_primary_input< PCD_ppT > &  primary_input,
const r1cs_mp_ppzkpcd_proof< PCD_ppT > &  proof 
)

A verifier algorithm for the R1CS (multi-predicate) ppzkPCD that accepts a processed verification key.

◆ r1cs_mp_ppzkpcd_process_vk()

template<typename PCD_ppT >
r1cs_mp_ppzkpcd_processed_verification_key<PCD_ppT> libsnark::r1cs_mp_ppzkpcd_process_vk ( const r1cs_mp_ppzkpcd_verification_key< PCD_ppT > &  vk)

Convert a (non-processed) verification key into a processed verification key.

◆ r1cs_mp_ppzkpcd_prover()

template<typename PCD_ppT >
r1cs_mp_ppzkpcd_proof<PCD_ppT> libsnark::r1cs_mp_ppzkpcd_prover ( const r1cs_mp_ppzkpcd_proving_key< PCD_ppT > &  pk,
const size_t  compliance_predicate_name,
const r1cs_mp_ppzkpcd_primary_input< PCD_ppT > &  primary_input,
const r1cs_mp_ppzkpcd_auxiliary_input< PCD_ppT > &  auxiliary_input,
const std::vector< r1cs_mp_ppzkpcd_proof< PCD_ppT >> &  incoming_proofs 
)

A prover algorithm for the R1CS (multi-predicate) ppzkPCD.

Given a proving key, name of chosen compliance predicate, inputs for the compliance predicate, and proofs for the predicate's input messages, this algorithm produces a proof (of knowledge) that attests to the compliance of the output message.

◆ r1cs_mp_ppzkpcd_verifier()

template<typename PCD_ppT >
bool libsnark::r1cs_mp_ppzkpcd_verifier ( const r1cs_mp_ppzkpcd_verification_key< PCD_ppT > &  vk,
const r1cs_mp_ppzkpcd_primary_input< PCD_ppT > &  primary_input,
const r1cs_mp_ppzkpcd_proof< PCD_ppT > &  proof 
)

A verifier algorithm for the R1CS (multi-predicate) ppzkPCD that accepts a non-processed verification key.

◆ r1cs_ppzkadsnark_auth_generator()

template<typename ppT , libff::multi_exp_base_form BaseForm = libff::multi_exp_base_form_normal>
r1cs_ppzkadsnark_auth_keys<ppT> libsnark::r1cs_ppzkadsnark_auth_generator ( void  )

R1CS ppZKADSNARK authentication parameters generator algorithm.

◆ r1cs_ppzkadsnark_auth_sign()

template<typename ppT >
std::vector<r1cs_ppzkadsnark_auth_data<ppT> > libsnark::r1cs_ppzkadsnark_auth_sign ( const std::vector< libff::Fr< snark_pp< ppT >>> &  ins,
const r1cs_ppzkadsnark_sec_auth_key< ppT > &  sk,
const std::vector< labelT labels 
)

R1CS ppZKADSNARK authentication algorithm.

◆ r1cs_ppzkadsnark_auth_verify() [1/2]

template<typename ppT >
bool libsnark::r1cs_ppzkadsnark_auth_verify ( const std::vector< libff::Fr< snark_pp< ppT >>> &  data,
const std::vector< r1cs_ppzkadsnark_auth_data< ppT >> &  auth_data,
const r1cs_ppzkadsnark_pub_auth_key< ppT > &  pak,
const std::vector< labelT > &  labels 
)

◆ r1cs_ppzkadsnark_auth_verify() [2/2]

template<typename ppT >
bool libsnark::r1cs_ppzkadsnark_auth_verify ( const std::vector< libff::Fr< snark_pp< ppT >>> &  data,
const std::vector< r1cs_ppzkadsnark_auth_data< ppT >> &  auth_data,
const r1cs_ppzkadsnark_sec_auth_key< ppT > &  sak,
const std::vector< labelT > &  labels 
)

R1CS ppZKADSNARK authentication verification algorithms.

◆ r1cs_ppzkadsnark_generator()

template<typename ppT >
r1cs_ppzkadsnark_keypair<ppT> libsnark::r1cs_ppzkadsnark_generator ( const r1cs_ppzkadsnark_constraint_system< ppT > &  cs,
const r1cs_ppzkadsnark_pub_auth_prms< ppT > &  prms 
)

A generator algorithm for the R1CS ppzkADSNARK.

Given a R1CS constraint system CS, this algorithm produces proving and verification keys for CS.

◆ r1cs_ppzkadsnark_online_verifier() [1/2]

template<typename ppT >
bool libsnark::r1cs_ppzkadsnark_online_verifier ( const r1cs_ppzkadsnark_processed_verification_key< ppT > &  pvk,
const r1cs_ppzkadsnark_proof< ppT > &  proof,
const r1cs_ppzkadsnark_sec_auth_key< ppT > &  sak,
const std::vector< labelT > &  labels 
)

A symmetric verifier algorithm for the R1CS ppzkADSNARK that accepts a processed verification key.

◆ r1cs_ppzkadsnark_online_verifier() [2/2]

template<typename ppT >
bool libsnark::r1cs_ppzkadsnark_online_verifier ( const r1cs_ppzkadsnark_processed_verification_key< ppT > &  pvk,
const std::vector< r1cs_ppzkadsnark_auth_data< ppT >> &  auth_data,
const r1cs_ppzkadsnark_proof< ppT > &  proof,
const r1cs_ppzkadsnark_pub_auth_key< ppT > &  pak,
const std::vector< labelT > &  labels 
)

A verifier algorithm for the R1CS ppzkADSNARK that accepts a processed verification key.

◆ r1cs_ppzkadsnark_prover()

template<typename ppT >
r1cs_ppzkadsnark_proof<ppT> libsnark::r1cs_ppzkadsnark_prover ( const r1cs_ppzkadsnark_proving_key< ppT > &  pk,
const r1cs_ppzkadsnark_primary_input< ppT > &  primary_input,
const r1cs_ppzkadsnark_auxiliary_input< ppT > &  auxiliary_input,
const std::vector< r1cs_ppzkadsnark_auth_data< ppT >> &  auth_data 
)

A prover algorithm for the R1CS ppzkADSNARK.

Given a R1CS primary input X and a R1CS auxiliary input Y, this algorithm produces a proof (of knowledge) that attests to the following statement: `‘there exists Y such that CS(X,Y)=0’'. Above, CS is the R1CS constraint system that was given as input to the generator algorithm.

◆ r1cs_ppzkadsnark_verifier() [1/2]

template<typename ppT >
bool libsnark::r1cs_ppzkadsnark_verifier ( const r1cs_ppzkadsnark_verification_key< ppT > &  vk,
const r1cs_ppzkadsnark_proof< ppT > &  proof,
const r1cs_ppzkadsnark_sec_auth_key< ppT > &  sak,
const std::vector< labelT > &  labels 
)

A symmetric verifier algorithm for the R1CS ppzkADSNARK that accepts a non-processed verification key

◆ r1cs_ppzkadsnark_verifier() [2/2]

template<typename ppT >
bool libsnark::r1cs_ppzkadsnark_verifier ( const r1cs_ppzkadsnark_verification_key< ppT > &  vk,
const std::vector< r1cs_ppzkadsnark_auth_data< ppT >> &  auth_data,
const r1cs_ppzkadsnark_proof< ppT > &  proof,
const r1cs_ppzkadsnark_pub_auth_key< ppT > &  pak,
const std::vector< labelT > &  labels 
)

A verifier algorithm for the R1CS ppzkADSNARK that accepts a non-processed verification key

◆ r1cs_ppzkadsnark_verifier_process_vk()

template<typename ppT >
r1cs_ppzkadsnark_processed_verification_key<ppT> libsnark::r1cs_ppzkadsnark_verifier_process_vk ( const r1cs_ppzkadsnark_verification_key< ppT > &  vk)

Convert a (non-processed) verification key into a processed verification key.

◆ r1cs_ppzksnark_affine_verifier_weak_IC()

template<typename ppT >
bool libsnark::r1cs_ppzksnark_affine_verifier_weak_IC ( const r1cs_ppzksnark_verification_key< ppT > &  vk,
const r1cs_ppzksnark_primary_input< ppT > &  primary_input,
const r1cs_ppzksnark_proof< ppT > &  proof 
)

For debugging purposes (of r1cs_ppzksnark_r1cs_ppzksnark_verifier_gadget):

A verifier algorithm for the R1CS ppzkSNARK that: (1) accepts a non-processed verification key, (2) has weak input consistency, and (3) uses affine coordinates for elliptic-curve computations.

◆ r1cs_ppzksnark_generator()

template<typename ppT , libff::multi_exp_base_form BaseForm = libff::multi_exp_base_form_normal>
r1cs_ppzksnark_keypair<ppT> libsnark::r1cs_ppzksnark_generator ( const r1cs_ppzksnark_constraint_system< ppT > &  cs)

A generator algorithm for the R1CS ppzkSNARK.

Given a R1CS constraint system CS, this algorithm produces proving and verification keys for CS.

◆ r1cs_ppzksnark_online_verifier_strong_IC()

template<typename ppT >
bool libsnark::r1cs_ppzksnark_online_verifier_strong_IC ( const r1cs_ppzksnark_processed_verification_key< ppT > &  pvk,
const r1cs_ppzksnark_primary_input< ppT > &  primary_input,
const r1cs_ppzksnark_proof< ppT > &  proof 
)

A verifier algorithm for the R1CS ppzkSNARK that: (1) accepts a processed verification key, and (2) has strong input consistency.

◆ r1cs_ppzksnark_online_verifier_weak_IC()

template<typename ppT >
bool libsnark::r1cs_ppzksnark_online_verifier_weak_IC ( const r1cs_ppzksnark_processed_verification_key< ppT > &  pvk,
const r1cs_ppzksnark_primary_input< ppT > &  input,
const r1cs_ppzksnark_proof< ppT > &  proof 
)

A verifier algorithm for the R1CS ppzkSNARK that: (1) accepts a processed verification key, and (2) has weak input consistency.

◆ r1cs_ppzksnark_prover()

template<typename ppT , libff::multi_exp_method Method = libff::multi_exp_method_bos_coster, libff::multi_exp_base_form BaseForm = libff::multi_exp_base_form_normal>
r1cs_ppzksnark_proof<ppT> libsnark::r1cs_ppzksnark_prover ( const r1cs_ppzksnark_proving_key< ppT > &  pk,
const r1cs_ppzksnark_primary_input< ppT > &  primary_input,
const r1cs_ppzksnark_auxiliary_input< ppT > &  auxiliary_input 
)

A prover algorithm for the R1CS ppzkSNARK.

Given a R1CS primary input X and a R1CS auxiliary input Y, this algorithm produces a proof (of knowledge) that attests to the following statement: `‘there exists Y such that CS(X,Y)=0’'. Above, CS is the R1CS constraint system that was given as input to the generator algorithm.

◆ r1cs_ppzksnark_verifier_process_vk()

template<typename ppT >
r1cs_ppzksnark_processed_verification_key<ppT> libsnark::r1cs_ppzksnark_verifier_process_vk ( const r1cs_ppzksnark_verification_key< ppT > &  vk)

Convert a (non-processed) verification key into a processed verification key.

◆ r1cs_ppzksnark_verifier_strong_IC()

template<typename ppT >
bool libsnark::r1cs_ppzksnark_verifier_strong_IC ( const r1cs_ppzksnark_verification_key< ppT > &  vk,
const r1cs_ppzksnark_primary_input< ppT > &  primary_input,
const r1cs_ppzksnark_proof< ppT > &  proof 
)

A verifier algorithm for the R1CS ppzkSNARK that: (1) accepts a non-processed verification key, and (2) has strong input consistency.

◆ r1cs_ppzksnark_verifier_weak_IC()

template<typename ppT >
bool libsnark::r1cs_ppzksnark_verifier_weak_IC ( const r1cs_ppzksnark_verification_key< ppT > &  vk,
const r1cs_ppzksnark_primary_input< ppT > &  primary_input,
const r1cs_ppzksnark_proof< ppT > &  proof 
)

A verifier algorithm for the R1CS ppzkSNARK that: (1) accepts a non-processed verification key, and (2) has weak input consistency.

◆ r1cs_se_ppzksnark_generator()

template<typename ppT , libff::multi_exp_base_form BaseForm = libff::multi_exp_base_form_normal>
r1cs_se_ppzksnark_keypair<ppT> libsnark::r1cs_se_ppzksnark_generator ( const r1cs_se_ppzksnark_constraint_system< ppT > &  cs)

A generator algorithm for the R1CS SEppzkSNARK.

Given a R1CS constraint system CS, this algorithm produces proving and verification keys for CS.

◆ r1cs_se_ppzksnark_online_verifier_strong_IC()

template<typename ppT >
bool libsnark::r1cs_se_ppzksnark_online_verifier_strong_IC ( const r1cs_se_ppzksnark_processed_verification_key< ppT > &  pvk,
const r1cs_se_ppzksnark_primary_input< ppT > &  primary_input,
const r1cs_se_ppzksnark_proof< ppT > &  proof 
)

A verifier algorithm for the R1CS ppzkSNARK that: (1) accepts a processed verification key, and (2) has strong input consistency.

◆ r1cs_se_ppzksnark_online_verifier_weak_IC()

template<typename ppT >
bool libsnark::r1cs_se_ppzksnark_online_verifier_weak_IC ( const r1cs_se_ppzksnark_processed_verification_key< ppT > &  pvk,
const r1cs_se_ppzksnark_primary_input< ppT > &  input,
const r1cs_se_ppzksnark_proof< ppT > &  proof 
)

A verifier algorithm for the R1CS ppzkSNARK that: (1) accepts a processed verification key, and (2) has weak input consistency.

◆ r1cs_se_ppzksnark_prover()

template<typename ppT , libff::multi_exp_method Method = libff::multi_exp_method_BDLO12, libff::multi_exp_base_form BaseForm = libff::multi_exp_base_form_normal>
r1cs_se_ppzksnark_proof<ppT> libsnark::r1cs_se_ppzksnark_prover ( const r1cs_se_ppzksnark_proving_key< ppT > &  pk,
const r1cs_se_ppzksnark_primary_input< ppT > &  primary_input,
const r1cs_se_ppzksnark_auxiliary_input< ppT > &  auxiliary_input 
)

A prover algorithm for the R1CS SEppzkSNARK.

Given a R1CS primary input X and a R1CS auxiliary input Y, this algorithm produces a proof (of knowledge) that attests to the following statement: `‘there exists Y such that CS(X,Y)=0’'. Above, CS is the R1CS constraint system that was given as input to the generator algorithm.

◆ r1cs_se_ppzksnark_verifier_process_vk()

template<typename ppT >
r1cs_se_ppzksnark_processed_verification_key<ppT> libsnark::r1cs_se_ppzksnark_verifier_process_vk ( const r1cs_se_ppzksnark_verification_key< ppT > &  vk)

Convert a (non-processed) verification key into a processed verification key.

◆ r1cs_se_ppzksnark_verifier_strong_IC()

template<typename ppT >
bool libsnark::r1cs_se_ppzksnark_verifier_strong_IC ( const r1cs_se_ppzksnark_verification_key< ppT > &  vk,
const r1cs_se_ppzksnark_primary_input< ppT > &  primary_input,
const r1cs_se_ppzksnark_proof< ppT > &  proof 
)

A verifier algorithm for the R1CS SEppzkSNARK that: (1) accepts a non-processed verification key, and (2) has strong input consistency.

◆ r1cs_se_ppzksnark_verifier_weak_IC()

template<typename ppT >
bool libsnark::r1cs_se_ppzksnark_verifier_weak_IC ( const r1cs_se_ppzksnark_verification_key< ppT > &  vk,
const r1cs_se_ppzksnark_primary_input< ppT > &  primary_input,
const r1cs_se_ppzksnark_proof< ppT > &  proof 
)

A verifier algorithm for the R1CS SEppzkSNARK that: (1) accepts a non-processed verification key, and (2) has weak input consistency.

◆ r1cs_sp_ppzkpcd_generator()

template<typename PCD_ppT >
r1cs_sp_ppzkpcd_keypair<PCD_ppT> libsnark::r1cs_sp_ppzkpcd_generator ( const r1cs_sp_ppzkpcd_compliance_predicate< PCD_ppT > &  compliance_predicate)

A generator algorithm for the R1CS (single-predicate) ppzkPCD.

Given a compliance predicate, this algorithm produces proving and verification keys for the predicate.

◆ r1cs_sp_ppzkpcd_online_verifier()

template<typename PCD_ppT >
bool libsnark::r1cs_sp_ppzkpcd_online_verifier ( const r1cs_sp_ppzkpcd_processed_verification_key< PCD_ppT > &  pvk,
const r1cs_sp_ppzkpcd_primary_input< PCD_ppT > &  primary_input,
const r1cs_sp_ppzkpcd_proof< PCD_ppT > &  proof 
)

A verifier algorithm for the R1CS (single-predicate) ppzkPCD that accepts a processed verification key.

◆ r1cs_sp_ppzkpcd_process_vk()

template<typename PCD_ppT >
r1cs_sp_ppzkpcd_processed_verification_key<PCD_ppT> libsnark::r1cs_sp_ppzkpcd_process_vk ( const r1cs_sp_ppzkpcd_verification_key< PCD_ppT > &  vk)

Convert a (non-processed) verification key into a processed verification key.

◆ r1cs_sp_ppzkpcd_prover()

template<typename PCD_ppT >
r1cs_sp_ppzkpcd_proof<PCD_ppT> libsnark::r1cs_sp_ppzkpcd_prover ( const r1cs_sp_ppzkpcd_proving_key< PCD_ppT > &  pk,
const r1cs_sp_ppzkpcd_primary_input< PCD_ppT > &  primary_input,
const r1cs_sp_ppzkpcd_auxiliary_input< PCD_ppT > &  auxiliary_input,
const std::vector< r1cs_sp_ppzkpcd_proof< PCD_ppT >> &  incoming_proofs 
)

A prover algorithm for the R1CS (single-predicate) ppzkPCD.

Given a proving key, inputs for the compliance predicate, and proofs for the predicate's input messages, this algorithm produces a proof (of knowledge) that attests to the compliance of the output message.

◆ r1cs_sp_ppzkpcd_verifier()

template<typename PCD_ppT >
bool libsnark::r1cs_sp_ppzkpcd_verifier ( const r1cs_sp_ppzkpcd_verification_key< PCD_ppT > &  vk,
const r1cs_sp_ppzkpcd_primary_input< PCD_ppT > &  primary_input,
const r1cs_sp_ppzkpcd_proof< PCD_ppT > &  proof 
)

A verifier algorithm for the R1CS (single-predicate) ppzkPCD that accepts a non-processed verification key.

◆ r1cs_to_qap_instance_map()

template<typename FieldT >
qap_instance<FieldT> libsnark::r1cs_to_qap_instance_map ( const r1cs_constraint_system< FieldT > &  cs,
bool  force_pow_2_domain = false 
)

Instance map for the R1CS-to-QAP reduction.

◆ r1cs_to_qap_instance_map_with_evaluation()

template<typename FieldT >
qap_instance_evaluation<FieldT> libsnark::r1cs_to_qap_instance_map_with_evaluation ( const r1cs_constraint_system< FieldT > &  cs,
const FieldT &  t,
bool  force_pow_2_domain = false 
)

Instance map for the R1CS-to-QAP reduction followed by evaluation of the resulting QAP instance.

◆ r1cs_to_qap_witness_map()

template<typename FieldT >
qap_witness<FieldT> libsnark::r1cs_to_qap_witness_map ( const r1cs_constraint_system< FieldT > &  cs,
const r1cs_primary_input< FieldT > &  primary_input,
const r1cs_auxiliary_input< FieldT > &  auxiliary_input,
const FieldT &  d1,
const FieldT &  d2,
const FieldT &  d3,
bool  force_pow_2_domain = false 
)

Witness map for the R1CS-to-QAP reduction.

The witness map takes zero knowledge into account when d1,d2,d3 are random.

◆ r1cs_to_sap_get_domain()

template<typename FieldT >
std::shared_ptr<libfqfft::evaluation_domain<FieldT> > libsnark::r1cs_to_sap_get_domain ( const r1cs_constraint_system< FieldT > &  cs)

Helper function to find evaluation domain that will be used by the reduction for a given R1CS instance.

◆ r1cs_to_sap_instance_map()

template<typename FieldT >
sap_instance<FieldT> libsnark::r1cs_to_sap_instance_map ( const r1cs_constraint_system< FieldT > &  cs)

Instance map for the R1CS-to-QAP reduction.

◆ r1cs_to_sap_instance_map_with_evaluation()

template<typename FieldT >
sap_instance_evaluation<FieldT> libsnark::r1cs_to_sap_instance_map_with_evaluation ( const r1cs_constraint_system< FieldT > &  cs,
const FieldT &  t 
)

Instance map for the R1CS-to-QAP reduction followed by evaluation of the resulting QAP instance.

◆ r1cs_to_sap_witness_map()

template<typename FieldT >
sap_witness<FieldT> libsnark::r1cs_to_sap_witness_map ( const r1cs_constraint_system< FieldT > &  cs,
const r1cs_primary_input< FieldT > &  primary_input,
const r1cs_auxiliary_input< FieldT > &  auxiliary_input,
const FieldT &  d1,
const FieldT &  d2 
)

Witness map for the R1CS-to-QAP reduction.

The witness map takes zero knowledge into account when d1,d2 are random.

◆ ram_ppzksnark_generator()

template<typename ram_ppzksnark_ppT >
ram_ppzksnark_keypair<ram_ppzksnark_ppT> libsnark::ram_ppzksnark_generator ( const ram_ppzksnark_architecture_params< ram_ppzksnark_ppT > &  ap,
const size_t  primary_input_size_bound,
const size_t  time_bound 
)

A generator algorithm for the RAM ppzkSNARK.

Given a choice of architecture parameters and computation bounds, this algorithm produces proving and verification keys for all computations that respect these choices.

◆ ram_ppzksnark_prover()

template<typename ram_ppzksnark_ppT >
ram_ppzksnark_proof<ram_ppzksnark_ppT> libsnark::ram_ppzksnark_prover ( const ram_ppzksnark_proving_key< ram_ppzksnark_ppT > &  pk,
const ram_ppzksnark_primary_input< ram_ppzksnark_ppT > &  primary_input,
const ram_ppzksnark_auxiliary_input< ram_ppzksnark_ppT > &  auxiliary_input 
)

A prover algorithm for the RAM ppzkSNARK.

Given a proving key, primary input X, and auxiliary input Y, this algorithm produces a proof (of knowledge) that attests to the following statement: `‘there exists Y such that X(Y) accepts’'.

Above, it has to be the case that the computation respects the bounds:

  • the size of X is at most primary_input_size_bound, and
  • the time to compute X(Y) is at most time_bound.

◆ ram_ppzksnark_verifier()

template<typename ram_ppzksnark_ppT >
bool libsnark::ram_ppzksnark_verifier ( const ram_ppzksnark_verification_key< ram_ppzksnark_ppT > &  vk,
const ram_ppzksnark_primary_input< ram_ppzksnark_ppT > &  primary_input,
const ram_ppzksnark_proof< ram_ppzksnark_ppT > &  proof 
)

A verifier algorithm for the RAM ppzkSNARK.

This algorithm is universal in the sense that the verification key supports proof verification for any choice of primary input provided that the computation respects the bounds.

◆ ram_zksnark_generator()

template<typename ram_zksnark_ppT >
ram_zksnark_keypair<ram_zksnark_ppT> libsnark::ram_zksnark_generator ( const ram_zksnark_architecture_params< ram_zksnark_ppT > &  ap)

A generator algorithm for the RAM zkSNARK.

Given a choice of architecture parameters, this algorithm produces proving and verification keys for all computations that respect this choice.

◆ ram_zksnark_prover()

template<typename ram_zksnark_ppT >
ram_zksnark_proof<ram_zksnark_ppT> libsnark::ram_zksnark_prover ( const ram_zksnark_proving_key< ram_zksnark_ppT > &  pk,
const ram_zksnark_primary_input< ram_zksnark_ppT > &  primary_input,
const size_t  time_bound,
const ram_zksnark_auxiliary_input< ram_zksnark_ppT > &  auxiliary_input 
)

A prover algorithm for the RAM zkSNARK.

Given a proving key, primary input X, time bound T, and auxiliary input Y, this algorithm produces a proof (of knowledge) that attests to the following statement: `‘there exists Y such that X(Y) accepts within T steps’'.

◆ ram_zksnark_verifier()

template<typename ram_zksnark_ppT >
bool libsnark::ram_zksnark_verifier ( const ram_zksnark_verification_key< ram_zksnark_ppT > &  vk,
const ram_zksnark_primary_input< ram_zksnark_ppT > &  primary_input,
const size_t  time_bound,
const ram_zksnark_proof< ram_zksnark_ppT > &  proof 
)

A verifier algorithm for the RAM zkSNARK.

This algorithm is universal in the sense that the verification key supports proof verification for any choice of primary input and time bound.

◆ random_memory_contents()

memory_contents libsnark::random_memory_contents ( const size_t  num_addresses,
const size_t  value_size,
const size_t  num_filled 
)

Sample memory contents having a given number of non-zero entries; each non-zero entry is a random value at a random address (approximately).

Definition at line 43 of file memory_contents_examples.cpp.

47 {
48  const size_t max_unit = 1ul << value_size;
49 
50  std::set<size_t> unfilled;
51  for (size_t i = 0; i < num_addresses; ++i) {
52  unfilled.insert(i);
53  }
54 
55  memory_contents result;
56  for (size_t i = 0; i < num_filled; ++i) {
57  auto it = unfilled.begin();
58  std::advance(it, std::rand() % unfilled.size());
59  result[*it] = std::rand() % max_unit;
60  unfilled.erase(it);
61  }
62 
63  return result;
64 }
Here is the caller graph for this function:

◆ random_tinyram_instruction()

tinyram_instruction libsnark::random_tinyram_instruction ( const tinyram_architecture_params ap)

Definition at line 293 of file tinyram_aux.cpp.

295 {
296  const tinyram_opcode opcode =
297  (tinyram_opcode)(std::rand() % (1ul << ap.opcode_width()));
298  const bool arg2_is_imm = std::rand() & 1;
299  const size_t desidx = std::rand() % (1ul << ap.reg_arg_width());
300  const size_t arg1idx = std::rand() % (1ul << ap.reg_arg_width());
301  const size_t arg2idx_or_imm =
302  std::rand() % (1ul << ap.reg_arg_or_imm_width());
303  return tinyram_instruction(
304  opcode, arg2_is_imm, desidx, arg1idx, arg2idx_or_imm);
305 }
Here is the call graph for this function:

◆ route_benes_inner()

void libsnark::route_benes_inner ( const size_t  dimension,
const integer_permutation permutation,
const integer_permutation permutation_inv,
const size_t  column_idx_start,
const size_t  column_idx_end,
const size_t  subnetwork_offset,
const size_t  subnetwork_size,
benes_routing routing 
)

Auxiliary function used in get_benes_routing (see below).

The network from t_start to t_end is the part of the Benes network that needs to be routed according to the permutation pi.

The permutation

  • pi maps [subnetwork_offset..subnetwork_offset+subnetwork_size-1] to itself, offset by subnetwork_offset, and
  • piinv is the inverse of pi.

INVARIANT: node w from left hand side can always be routed to the right-hand side using the upper network.

Definition at line 176 of file benes_routing_algorithm.cpp.

185 {
186 #ifdef DEBUG
187  assert(permutation.size() == subnetwork_size);
188  assert(permutation.is_valid());
189  assert(permutation.inverse() == permutation_inv);
190 #endif
191 
192  if (column_idx_start == column_idx_end) {
193  /* nothing to route */
194  return;
195  }
196  // adjusted by subnetwork_offset
197  libff::bit_vector lhs_routed(subnetwork_size, false);
198 
199  // left-hand-side vertex to be routed.
200  size_t w = subnetwork_offset;
201  size_t last_unrouted = subnetwork_offset;
202 
203  integer_permutation new_permutation(
204  subnetwork_offset, subnetwork_offset + subnetwork_size - 1);
205  integer_permutation new_permutation_inv(
206  subnetwork_offset, subnetwork_offset + subnetwork_size - 1);
207 
208  while (true) {
215  /* route w to its target on RHS, wprime = pi[w], using upper network */
216  size_t wprime = permutation.get(w);
217 
218  /* route (column_idx_start, w) forward via top subnetwork */
219  routing[column_idx_start][w] = benes_get_switch_setting_from_subnetwork(
220  dimension, column_idx_start, w, true);
221  new_permutation.set(
222  benes_lhs_packet_destination(dimension, column_idx_start, w, true),
223  benes_rhs_packet_source(dimension, column_idx_end, wprime, true));
224  lhs_routed[w - subnetwork_offset] = true;
225 
226  /* route (column_idx_end, wprime) backward via top subnetwork */
227  routing[column_idx_end - 1][benes_rhs_packet_source(
228  dimension, column_idx_end, wprime, true)] =
230  dimension, column_idx_end - 1, wprime, true);
231  new_permutation_inv.set(
232  benes_rhs_packet_source(dimension, column_idx_end, wprime, true),
233  benes_lhs_packet_destination(dimension, column_idx_start, w, true));
234 
235  /* now the other neighbor of wprime must be back-routed via the lower
236  * network, so get vprime, the neighbor on RHS and v, its target on LHS
237  */
238  const size_t vprime =
239  benes_packet_cross_source(dimension, column_idx_end, wprime);
240  const size_t v = permutation_inv.get(vprime);
241  assert(!lhs_routed[v - subnetwork_offset]);
242 
243  /* back-route (column_idx_end, vprime) using the lower subnetwork */
244  routing[column_idx_end - 1][benes_rhs_packet_source(
245  dimension, column_idx_end, vprime, false)] =
247  dimension, column_idx_end - 1, vprime, false);
248  new_permutation_inv.set(
249  benes_rhs_packet_source(dimension, column_idx_end, vprime, false),
251  dimension, column_idx_start, v, false));
252 
253  /* forward-route (column_idx_start, v) using the lower subnetwork */
254  routing[column_idx_start][v] = benes_get_switch_setting_from_subnetwork(
255  dimension, column_idx_start, v, false);
256  new_permutation.set(
257  benes_lhs_packet_destination(dimension, column_idx_start, v, false),
258  benes_rhs_packet_source(dimension, column_idx_end, vprime, false));
259  lhs_routed[v - subnetwork_offset] = true;
260 
261  /* if the other neighbor of v is not routed, route it; otherwise, find
262  * the next unrouted node */
263  if (!lhs_routed
265  dimension, column_idx_start, v) -
266  subnetwork_offset]) {
267  w = benes_packet_cross_destination(dimension, column_idx_start, v);
268  } else {
269  while ((last_unrouted < subnetwork_offset + subnetwork_size) &&
270  lhs_routed[last_unrouted - subnetwork_offset]) {
271  ++last_unrouted;
272  }
273 
274  if (last_unrouted == subnetwork_offset + subnetwork_size) {
275  // all routed!
276  break;
277  } else {
278  w = last_unrouted;
279  }
280  }
281  }
282 
283  const integer_permutation new_permutation_upper = new_permutation.slice(
284  subnetwork_offset, subnetwork_offset + subnetwork_size / 2 - 1);
285  const integer_permutation new_permutation_lower = new_permutation.slice(
286  subnetwork_offset + subnetwork_size / 2,
287  subnetwork_offset + subnetwork_size - 1);
288 
289  const integer_permutation new_permutation_inv_upper =
290  new_permutation_inv.slice(
291  subnetwork_offset, subnetwork_offset + subnetwork_size / 2 - 1);
292  const integer_permutation new_permutation_inv_lower =
293  new_permutation_inv.slice(
294  subnetwork_offset + subnetwork_size / 2,
295  subnetwork_offset + subnetwork_size - 1);
296 
297  /* route upper part */
299  dimension,
300  new_permutation_upper,
301  new_permutation_inv_upper,
302  column_idx_start + 1,
303  column_idx_end - 1,
304  subnetwork_offset,
305  subnetwork_size / 2,
306  routing);
307 
308  /* route lower part */
310  dimension,
311  new_permutation_lower,
312  new_permutation_inv_lower,
313  column_idx_start + 1,
314  column_idx_end - 1,
315  subnetwork_offset + subnetwork_size / 2,
316  subnetwork_size / 2,
317  routing);
318 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ route_by_benes()

template<typename T >
std::vector<std::vector<T> > libsnark::route_by_benes ( const benes_routing routing,
const std::vector< T > &  start 
)

Definition at line 343 of file benes_routing_algorithm.cpp.

345 {
346  const size_t num_packets = start.size();
347  const size_t num_columns = benes_num_columns(num_packets);
348  const size_t dimension = libff::log2(num_packets);
349 
350  std::vector<std::vector<T>> res(
351  num_columns + 1, std::vector<T>(num_packets));
352  res[0] = start;
353 
354  for (size_t column_idx = 0; column_idx < num_columns; ++column_idx) {
355  const size_t mask = benes_cross_edge_mask(dimension, column_idx);
356 
357  for (size_t packet_idx = 0; packet_idx < num_packets; ++packet_idx) {
358  size_t next_packet_idx = (routing[column_idx][packet_idx] == false)
359  ? packet_idx
360  : packet_idx ^ mask;
361  res[column_idx + 1][next_packet_idx] = res[column_idx][packet_idx];
362  }
363  }
364 
365  return res;
366 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_bacs_ppzksnark()

template<typename ppT >
bool libsnark::run_bacs_ppzksnark ( const bacs_example< libff::Fr< ppT >> &  example,
const bool  test_serialization 
)

Runs the ppzkSNARK (generator, prover, and verifier) for a given BACS example (specified by a circuit, primary input, and auxiliary input).

Optionally, also test the serialization routines for keys and proofs. (This takes additional time.)

◆ run_r1cs_gg_ppzksnark()

template<typename ppT >
bool libsnark::run_r1cs_gg_ppzksnark ( const r1cs_example< libff::Fr< ppT >> &  example,
const bool  test_serialization 
)

Runs the ppzkSNARK (generator, prover, and verifier) for a given R1CS example (specified by a constraint system, input, and witness).

Optionally, also test the serialization routines for keys and proofs. (This takes additional time.)

◆ run_r1cs_mp_ppzkpcd_tally_example()

template<typename PCD_ppT >
bool libsnark::run_r1cs_mp_ppzkpcd_tally_example ( const size_t  wordsize,
const size_t  max_arity,
const size_t  depth,
const bool  test_serialization,
const bool  test_multi_type,
const bool  test_same_type_optimization 
)

Runs the multi-predicate ppzkPCD (generator, prover, and verifier) for the "tally compliance predicate", of a given wordsize, arity, and depth.

Optionally, also test the serialization routines for keys and proofs. (This takes additional time.)

Optionally, also test the case of compliance predicates with different types.

◆ run_r1cs_ppzkadsnark()

template<typename ppT >
bool libsnark::run_r1cs_ppzkadsnark ( const r1cs_example< libff::Fr< snark_pp< ppT >>> &  example,
const bool  test_serialization 
)

Runs the ppzkADSNARK (generator, prover, and verifier) for a given R1CS example (specified by a constraint system, input, and witness).

Optionally, also test the serialization routines for keys and proofs. (This takes additional time.)

◆ run_r1cs_ppzksnark()

template<typename ppT >
bool libsnark::run_r1cs_ppzksnark ( const r1cs_example< libff::Fr< ppT >> &  example,
const bool  test_serialization 
)

Runs the ppzkSNARK (generator, prover, and verifier) for a given R1CS example (specified by a constraint system, input, and witness).

Optionally, also test the serialization routines for keys and proofs. (This takes additional time.)

◆ run_r1cs_se_ppzksnark()

template<typename ppT >
bool libsnark::run_r1cs_se_ppzksnark ( const r1cs_example< libff::Fr< ppT >> &  example,
const bool  test_serialization 
)

Runs the SEppzkSNARK (generator, prover, and verifier) for a given R1CS example (specified by a constraint system, input, and witness).

Optionally, also test the serialization routines for keys and proofs. (This takes additional time.)

◆ run_r1cs_sp_ppzkpcd_tally_example()

template<typename PCD_ppT >
bool libsnark::run_r1cs_sp_ppzkpcd_tally_example ( const size_t  wordsize,
const size_t  arity,
const size_t  depth,
const bool  test_serialization 
)

Runs the single-predicate ppzkPCD (generator, prover, and verifier) for the "tally compliance predicate", of a given wordsize, arity, and depth.

Optionally, also test the serialization routines for keys and proofs. (This takes additional time.)

◆ run_ram_ppzksnark()

template<typename ram_ppzksnark_ppT >
bool libsnark::run_ram_ppzksnark ( const ram_example< ram_ppzksnark_machine_pp< ram_ppzksnark_ppT >> &  example,
const bool  test_serialization 
)

Runs the ppzkSNARK (generator, prover, and verifier) for a given RAM example (specified by an architecture, boot trace, auxiliary input, and time bound).

Optionally, also test the serialization routines for keys and proofs. (This takes additional time.)

◆ run_ram_zksnark()

template<typename ram_zksnark_ppT >
bool libsnark::run_ram_zksnark ( const ram_example< ram_zksnark_machine_pp< ram_zksnark_ppT >> &  example,
const bool  test_serialization 
)

Runs the zkSNARK (generator, prover, and verifier) for a given RAM example (specified by an architecture, boot trace, auxiliary input, and time bound).

Optionally, also test the serialization routines for keys and proofs. (This takes additional time.)

◆ run_tbcs_ppzksnark()

template<typename ppT >
bool libsnark::run_tbcs_ppzksnark ( const tbcs_example example,
const bool  test_serialization 
)

Runs the ppzkSNARK (generator, prover, and verifier) for a given TBCS example (specified by a circuit, primary input, and auxiliary input).

Optionally, also test the serialization routines for keys and proofs. (This takes additional time.)

◆ run_uscs_ppzksnark()

template<typename ppT >
bool libsnark::run_uscs_ppzksnark ( const uscs_example< libff::Fr< ppT >> &  example,
const bool  test_serialization 
)

Runs the ppzkSNARK (generator, prover, and verifier) for a given USCS example (specified by a constraint system, input, and witness).

Optionally, also test the serialization routines for keys and proofs. (This takes additional time.)

◆ SHA256_default_IV()

template<typename FieldT >
pb_linear_combination_array<FieldT> libsnark::SHA256_default_IV ( protoboard< FieldT > &  pb)

◆ sigBatchVerif()

template<typename ppT >
bool libsnark::sigBatchVerif ( const r1cs_ppzkadsnark_vkT< ppT > &  vk,
const std::vector< labelT > &  labels,
const std::vector< libff::G2< snark_pp< ppT >>> &  Lambdas,
const std::vector< r1cs_ppzkadsnark_sigT< ppT >> &  sigs 
)

◆ sigGen()

template<typename ppT >
kpT<ppT> libsnark::sigGen ( void  )

◆ sigSign()

template<typename ppT >
r1cs_ppzkadsnark_sigT<ppT> libsnark::sigSign ( const r1cs_ppzkadsnark_skT< ppT > &  sk,
const labelT label,
const libff::G2< snark_pp< ppT >> &  Lambda 
)

◆ sigVerif()

template<typename ppT >
bool libsnark::sigVerif ( const r1cs_ppzkadsnark_vkT< ppT > &  vk,
const labelT label,
const libff::G2< snark_pp< ppT >> &  Lambda,
const r1cs_ppzkadsnark_sigT< ppT > &  sig 
)

◆ tbcs_ppzksnark_generator()

template<typename ppT >
tbcs_ppzksnark_keypair<ppT> libsnark::tbcs_ppzksnark_generator ( const tbcs_ppzksnark_circuit circuit)

A generator algorithm for the TBCS ppzkSNARK.

Given a TBCS circuit C, this algorithm produces proving and verification keys for C.

◆ tbcs_ppzksnark_online_verifier_strong_IC()

template<typename ppT >
bool libsnark::tbcs_ppzksnark_online_verifier_strong_IC ( const tbcs_ppzksnark_processed_verification_key< ppT > &  pvk,
const tbcs_ppzksnark_primary_input primary_input,
const tbcs_ppzksnark_proof< ppT > &  proof 
)

A verifier algorithm for the TBCS ppzkSNARK that: (1) accepts a processed verification key, and (2) has strong input consistency.

◆ tbcs_ppzksnark_online_verifier_weak_IC()

template<typename ppT >
bool libsnark::tbcs_ppzksnark_online_verifier_weak_IC ( const tbcs_ppzksnark_processed_verification_key< ppT > &  pvk,
const tbcs_ppzksnark_primary_input primary_input,
const tbcs_ppzksnark_proof< ppT > &  proof 
)

A verifier algorithm for the TBCS ppzkSNARK that: (1) accepts a processed verification key, and (2) has weak input consistency.

◆ tbcs_ppzksnark_prover()

template<typename ppT >
tbcs_ppzksnark_proof<ppT> libsnark::tbcs_ppzksnark_prover ( const tbcs_ppzksnark_proving_key< ppT > &  pk,
const tbcs_ppzksnark_primary_input primary_input,
const tbcs_ppzksnark_auxiliary_input auxiliary_input 
)

A prover algorithm for the TBCS ppzkSNARK.

Given a TBCS primary input X and a TBCS auxiliary input Y, this algorithm produces a proof (of knowledge) that attests to the following statement: `‘there exists Y such that C(X,Y)=0’'. Above, C is the TBCS circuit that was given as input to the generator algorithm.

◆ tbcs_ppzksnark_verifier_process_vk()

template<typename ppT >
tbcs_ppzksnark_processed_verification_key<ppT> libsnark::tbcs_ppzksnark_verifier_process_vk ( const tbcs_ppzksnark_verification_key< ppT > &  vk)

Convert a (non-processed) verification key into a processed verification key.

◆ tbcs_ppzksnark_verifier_strong_IC()

template<typename ppT >
bool libsnark::tbcs_ppzksnark_verifier_strong_IC ( const tbcs_ppzksnark_verification_key< ppT > &  vk,
const tbcs_ppzksnark_primary_input primary_input,
const tbcs_ppzksnark_proof< ppT > &  proof 
)

A verifier algorithm for the TBCS ppzkSNARK that: (1) accepts a non-processed verification key, and (2) has strong input consistency.

◆ tbcs_ppzksnark_verifier_weak_IC()

template<typename ppT >
bool libsnark::tbcs_ppzksnark_verifier_weak_IC ( const tbcs_ppzksnark_verification_key< ppT > &  vk,
const tbcs_ppzksnark_primary_input primary_input,
const tbcs_ppzksnark_proof< ppT > &  proof 
)

A verifier algorithm for the TBCS ppzkSNARK that: (1) accepts a non-processed verification key, and (2) has weak input consistency.

◆ tbcs_to_uscs_instance_map()

template<typename FieldT >
uscs_constraint_system<FieldT> libsnark::tbcs_to_uscs_instance_map ( const tbcs_circuit circuit)

Instance map for the TBCS-to-USCS reduction.

◆ tbcs_to_uscs_witness_map()

template<typename FieldT >
uscs_variable_assignment<FieldT> libsnark::tbcs_to_uscs_witness_map ( const tbcs_circuit circuit,
const tbcs_primary_input primary_input,
const tbcs_auxiliary_input auxiliary_input 
)

Witness map for the TBCS-to-USCS reduction.

◆ test_ALU_add_gadget()

void libsnark::test_ALU_add_gadget ( const size_t  w)

◆ test_ALU_and_gadget()

template<typename FieldT >
void libsnark::test_ALU_and_gadget ( const size_t  w)

◆ test_ALU_cjmp_gadget()

template<typename FieldT >
void libsnark::test_ALU_cjmp_gadget ( )

◆ test_ALU_cmov_gadget()

template<typename FieldT >
void libsnark::test_ALU_cmov_gadget ( const size_t  w)

◆ test_ALU_cmpa_gadget()

template<typename FieldT >
void libsnark::test_ALU_cmpa_gadget ( const size_t  w)

◆ test_ALU_cmpae_gadget()

template<typename FieldT >
void libsnark::test_ALU_cmpae_gadget ( const size_t  w)

◆ test_ALU_cmpe_gadget()

template<typename FieldT >
void libsnark::test_ALU_cmpe_gadget ( const size_t  w)

◆ test_ALU_cmpg_gadget()

template<typename FieldT >
void libsnark::test_ALU_cmpg_gadget ( const size_t  w)

◆ test_ALU_cmpge_gadget()

template<typename FieldT >
void libsnark::test_ALU_cmpge_gadget ( const size_t  w)

◆ test_ALU_cnjmp_gadget()

template<typename FieldT >
void libsnark::test_ALU_cnjmp_gadget ( )

◆ test_ALU_jmp_gadget()

template<typename FieldT >
void libsnark::test_ALU_jmp_gadget ( )

◆ test_ALU_mov_gadget()

template<typename FieldT >
void libsnark::test_ALU_mov_gadget ( const size_t  w)

◆ test_ALU_mull_gadget()

template<typename FieldT >
void libsnark::test_ALU_mull_gadget ( const size_t  w)

◆ test_ALU_not_gadget()

template<typename FieldT >
void libsnark::test_ALU_not_gadget ( const size_t  w)

◆ test_ALU_or_gadget()

template<typename FieldT >
void libsnark::test_ALU_or_gadget ( const size_t  w)

◆ test_ALU_shl_gadget()

template<typename FieldT >
void libsnark::test_ALU_shl_gadget ( const size_t  w)

◆ test_ALU_shr_gadget()

template<typename FieldT >
void libsnark::test_ALU_shr_gadget ( const size_t  w)

◆ test_ALU_smulh_gadget()

template<typename FieldT >
void libsnark::test_ALU_smulh_gadget ( const size_t  w)

◆ test_ALU_sub_gadget()

void libsnark::test_ALU_sub_gadget ( const size_t  w)

◆ test_ALU_udiv_gadget()

template<typename FieldT >
void libsnark::test_ALU_udiv_gadget ( const size_t  w)

◆ test_ALU_umod_gadget()

template<typename FieldT >
void libsnark::test_ALU_umod_gadget ( const size_t  w)

◆ test_ALU_umulh_gadget()

template<typename FieldT >
void libsnark::test_ALU_umulh_gadget ( const size_t  w)

◆ test_ALU_xor_gadget()

template<typename FieldT >
void libsnark::test_ALU_xor_gadget ( const size_t  w)

◆ test_argument_decoder_gadget()

template<typename FieldT >
void libsnark::test_argument_decoder_gadget ( )

◆ test_as_waksman_routing_gadget()

template<typename FieldT >
void libsnark::test_as_waksman_routing_gadget ( const size_t  num_packets,
const size_t  packet_size 
)

◆ test_benes_routing_gadget()

template<typename FieldT >
void libsnark::test_benes_routing_gadget ( const size_t  num_packets,
const size_t  packet_size 
)

◆ test_exponentiation_gadget()

template<typename FpkT , template< class > class Fpk_variableT, template< class > class Fpk_mul_gadgetT, template< class > class Fpk_sqr_gadgetT, mp_size_t m>
void libsnark::test_exponentiation_gadget ( const libff::bigint< m > &  power,
const std::string &  annotation 
)

◆ test_knapsack_CRH_with_bit_out_gadget()

template<typename FieldT >
void libsnark::test_knapsack_CRH_with_bit_out_gadget ( )

◆ test_merkle_tree_check_read_gadget()

template<typename FieldT , typename HashT >
void libsnark::test_merkle_tree_check_read_gadget ( )

◆ test_merkle_tree_check_update_gadget()

template<typename FieldT , typename HashT >
void libsnark::test_merkle_tree_check_update_gadget ( )

◆ test_set_commitment_gadget()

template<typename FieldT , typename HashT >
void libsnark::test_set_commitment_gadget ( )

◆ tinyram_boot_trace_from_program_and_input()

memory_store_trace libsnark::tinyram_boot_trace_from_program_and_input ( const tinyram_architecture_params ap,
const size_t  boot_trace_size_bound,
const tinyram_program program,
const tinyram_input_tape primary_input 
)

Definition at line 338 of file tinyram_aux.cpp.

343 {
344  // TODO: document the reverse order here
345 
346  memory_store_trace result;
347 
348  size_t boot_pos = boot_trace_size_bound - 1;
349  for (size_t i = 0; i < program.instructions.size(); ++i) {
350  result.set_trace_entry(
351  boot_pos--,
352  std::make_pair(i, program.instructions[i].as_dword(ap)));
353  }
354 
355  const size_t primary_input_base_addr = (1ul << (ap.dwaddr_len() - 1));
356 
357  for (size_t j = 0; j < primary_input.size(); j += 2) {
358  const size_t memory_dword =
359  primary_input[j] +
360  ((j + 1 < primary_input.size() ? primary_input[j + 1] : 0) << ap.w);
361  result.set_trace_entry(
362  boot_pos--,
363  std::make_pair(primary_input_base_addr + j, memory_dword));
364  }
365 
366  return result;
367 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ uscs_ppzksnark_generator()

template<typename ppT , libff::multi_exp_base_form BaseForm = libff::multi_exp_base_form_normal>
uscs_ppzksnark_keypair<ppT> libsnark::uscs_ppzksnark_generator ( const uscs_ppzksnark_constraint_system< ppT > &  cs)

A generator algorithm for the USCS ppzkSNARK.

Given a USCS constraint system CS, this algorithm produces proving and verification keys for CS.

◆ uscs_ppzksnark_online_verifier_strong_IC()

template<typename ppT >
bool libsnark::uscs_ppzksnark_online_verifier_strong_IC ( const uscs_ppzksnark_processed_verification_key< ppT > &  pvk,
const uscs_ppzksnark_primary_input< ppT > &  primary_input,
const uscs_ppzksnark_proof< ppT > &  proof 
)

A verifier algorithm for the USCS ppzkSNARK that: (1) accepts a processed verification key, and (2) has strong input consistency.

◆ uscs_ppzksnark_online_verifier_weak_IC()

template<typename ppT >
bool libsnark::uscs_ppzksnark_online_verifier_weak_IC ( const uscs_ppzksnark_processed_verification_key< ppT > &  pvk,
const uscs_ppzksnark_primary_input< ppT > &  primary_input,
const uscs_ppzksnark_proof< ppT > &  proof 
)

A verifier algorithm for the USCS ppzkSNARK that: (1) accepts a processed verification key, and (2) has weak input consistency.

◆ uscs_ppzksnark_prover()

template<typename ppT , libff::multi_exp_method Method = libff::multi_exp_method_BDLO12, libff::multi_exp_base_form BaseForm = libff::multi_exp_base_form_normal>
uscs_ppzksnark_proof<ppT> libsnark::uscs_ppzksnark_prover ( const uscs_ppzksnark_proving_key< ppT > &  pk,
const uscs_ppzksnark_primary_input< ppT > &  primary_input,
const uscs_ppzksnark_auxiliary_input< ppT > &  auxiliary_input 
)

A prover algorithm for the USCS ppzkSNARK.

Given a USCS primary input X and a USCS auxiliary input Y, this algorithm produces a proof (of knowledge) that attests to the following statement: `‘there exists Y such that CS(X,Y)=0’'. Above, CS is the USCS constraint system that was given as input to the generator algorithm.

◆ uscs_ppzksnark_verifier_process_vk()

template<typename ppT >
uscs_ppzksnark_processed_verification_key<ppT> libsnark::uscs_ppzksnark_verifier_process_vk ( const uscs_ppzksnark_verification_key< ppT > &  vk)

Convert a (non-processed) verification key into a processed verification key.

◆ uscs_ppzksnark_verifier_strong_IC()

template<typename ppT >
bool libsnark::uscs_ppzksnark_verifier_strong_IC ( const uscs_ppzksnark_verification_key< ppT > &  vk,
const uscs_ppzksnark_primary_input< ppT > &  primary_input,
const uscs_ppzksnark_proof< ppT > &  proof 
)

A verifier algorithm for the USCS ppzkSNARK that: (1) accepts a non-processed verification key, and (2) has strong input consistency.

◆ uscs_ppzksnark_verifier_weak_IC()

template<typename ppT >
bool libsnark::uscs_ppzksnark_verifier_weak_IC ( const uscs_ppzksnark_verification_key< ppT > &  vk,
const uscs_ppzksnark_primary_input< ppT > &  primary_input,
const uscs_ppzksnark_proof< ppT > &  proof 
)

A verifier algorithm for the USCS ppzkSNARK that: (1) accepts a non-processed verification key, and (2) has weak input consistency.

◆ uscs_to_ssp_instance_map()

template<typename FieldT >
ssp_instance<FieldT> libsnark::uscs_to_ssp_instance_map ( const uscs_constraint_system< FieldT > &  cs)

Instance map for the USCS-to-SSP reduction.

◆ uscs_to_ssp_instance_map_with_evaluation()

template<typename FieldT >
ssp_instance_evaluation<FieldT> libsnark::uscs_to_ssp_instance_map_with_evaluation ( const uscs_constraint_system< FieldT > &  cs,
const FieldT &  t 
)

Instance map for the USCS-to-SSP reduction followed by evaluation of the resulting SSP instance.

◆ uscs_to_ssp_witness_map()

template<typename FieldT >
ssp_witness<FieldT> libsnark::uscs_to_ssp_witness_map ( const uscs_constraint_system< FieldT > &  cs,
const uscs_primary_input< FieldT > &  primary_input,
const uscs_auxiliary_input< FieldT > &  auxiliary_input,
const FieldT &  d 
)

Witness map for the USCS-to-SSP reduction.

The witness map takes zero knowledge into account when d is random.

◆ valid_as_waksman_routing()

bool libsnark::valid_as_waksman_routing ( const integer_permutation permutation,
const as_waksman_routing routing 
)

Check if a routing "implements" the given permutation.

Definition at line 586 of file as_waksman_routing_algorithm.cpp.

588 {
589  const size_t num_packets = permutation.size();
590  const size_t width = as_waksman_num_columns(num_packets);
591  as_waksman_topology neighbors = generate_as_waksman_topology(num_packets);
592 
593  integer_permutation curperm(num_packets);
594 
595  for (size_t column_idx = 0; column_idx < width; ++column_idx) {
596  integer_permutation nextperm(num_packets);
597  for (size_t packet_idx = 0; packet_idx < num_packets; ++packet_idx) {
598  size_t routed_packet_idx;
599  if (neighbors[column_idx][packet_idx].first ==
600  neighbors[column_idx][packet_idx].second) {
601  routed_packet_idx = neighbors[column_idx][packet_idx].first;
602  } else {
603  auto it = routing[column_idx].find(packet_idx);
604  auto it2 = routing[column_idx].find(packet_idx - 1);
605  assert(
606  (it != routing[column_idx].end()) ^
607  (it2 != routing[column_idx].end()));
608  const bool switch_setting =
609  (it != routing[column_idx].end() ? it->second
610  : it2->second);
611 
612  routed_packet_idx =
613  (switch_setting ? neighbors[column_idx][packet_idx].second
614  : neighbors[column_idx][packet_idx].first);
615  }
616 
617  nextperm.set(routed_packet_idx, curperm.get(packet_idx));
618  }
619 
620  curperm = nextperm;
621  }
622 
623  return (curperm == permutation.inverse());
624 }
Here is the call graph for this function:

◆ valid_benes_routing()

bool libsnark::valid_benes_routing ( const integer_permutation permutation,
const benes_routing routing 
)

Check if a routing "implements" the given permutation.

Definition at line 368 of file benes_routing_algorithm.cpp.

370 {
371  const size_t num_packets = permutation.size();
372  const size_t num_columns = benes_num_columns(num_packets);
373 
374  std::vector<size_t> input_packets(num_packets);
375  for (size_t packet_idx = 0; packet_idx < num_packets; ++packet_idx) {
376  input_packets[packet_idx] = packet_idx;
377  }
378 
379  const std::vector<std::vector<size_t>> routed_packets =
380  route_by_benes(routing, input_packets);
381 
382  for (size_t packet_idx = 0; packet_idx < num_packets; ++packet_idx) {
383  if (routed_packets[num_columns][permutation.get(packet_idx)] !=
384  input_packets[packet_idx]) {
385  return false;
386  }
387  }
388 
389  return true;
390 }
Here is the call graph for this function:

Variable Documentation

◆ constraint_profiling_indent

size_t libsnark::constraint_profiling_indent = 0

Definition at line 20 of file constraint_profiling.cpp.

◆ constraint_profiling_table

std::vector< constraint_profiling_entry > libsnark::constraint_profiling_table

Definition at line 21 of file constraint_profiling.cpp.

◆ opcode_args

std::map< tinyram_opcode, tinyram_opcode_args > libsnark::opcode_args

Definition at line 66 of file tinyram_aux.cpp.

◆ opcode_values

std::map< std::string, tinyram_opcode > libsnark::opcode_values

Definition at line 100 of file tinyram_aux.cpp.

◆ SHA256_block_size

const size_t libsnark::SHA256_block_size = 512

Definition at line 24 of file sha256_components.hpp.

◆ SHA256_digest_size

const size_t libsnark::SHA256_digest_size = 256

Definition at line 23 of file sha256_components.hpp.

◆ tinyram_default_instruction

tinyram_instruction libsnark::tinyram_default_instruction
Initial value:
=
tinyram_instruction(tinyram_opcode_ANSWER, true, 0, 0, 1)

Definition at line 24 of file tinyram_aux.cpp.

◆ tinyram_opcode_names

std::map< tinyram_opcode, std::string > libsnark::tinyram_opcode_names

Definition at line 27 of file tinyram_aux.cpp.

libsnark::generate_as_waksman_topology
as_waksman_topology generate_as_waksman_topology(const size_t num_packets)
Definition: as_waksman_routing_algorithm.cpp:199
gadgetlib2::Protoboard::numInputs
size_t numInputs() const
Definition: protoboard.hpp:67
libsnark::tinyram_opcode_SHL
@ tinyram_opcode_SHL
Definition: tinyram_aux.hpp:38
libsnark::as_waksman_switch_input
size_t as_waksman_switch_input(const size_t num_packets, const size_t row_offset, const size_t row_idx, const bool use_top)
Definition: as_waksman_routing_algorithm.cpp:59
libsnark::TBCS_GATE_X
@ TBCS_GATE_X
Definition: tbcs.hpp:59
libsnark::tinyram_opcode_ANSWER
@ tinyram_opcode_ANSWER
Definition: tinyram_aux.hpp:63
libsnark::tinyram_opcode_args_des_arg2
@ tinyram_opcode_args_des_arg2
Definition: tinyram_aux.hpp:68
gadgetlib2::GadgetLibAdapter
Definition: adapters.hpp:37
libsnark::benes_packet_cross_source
size_t benes_packet_cross_source(const size_t dimension, const size_t column_idx, const size_t packet_idx)
Definition: benes_routing_algorithm.cpp:129
libsnark::as_waksman_topology
std::vector< std::vector< std::pair< size_t, size_t > > > as_waksman_topology
Definition: as_waksman_routing_algorithm.hpp:83
libsnark::tinyram_opcode_JMP
@ tinyram_opcode_JMP
Definition: tinyram_aux.hpp:50
libsnark::tinyram_opcode_names
std::map< tinyram_opcode, std::string > tinyram_opcode_names
Definition: tinyram_aux.cpp:27
libsnark::TBCS_GATE_NOT_X
@ TBCS_GATE_NOT_X
Definition: tbcs.hpp:68
libsnark::as_waksman_get_top_bottom_decision_from_switch_setting
bool as_waksman_get_top_bottom_decision_from_switch_setting(const size_t row_offset, const size_t packet_idx, const bool switch_setting)
Definition: as_waksman_routing_algorithm.cpp:263
gadgetlib2::GadgetLibAdapter::resetVariableIndex
static void resetVariableIndex()
Definition: adapters.cpp:69
libsnark::tinyram_opcode_CMPA
@ tinyram_opcode_CMPA
Definition: tinyram_aux.hpp:42
libsnark::tinyram_opcode_args_arg2_des
@ tinyram_opcode_args_arg2_des
Definition: tinyram_aux.hpp:72
libsnark::as_waksman_other_output_position
size_t as_waksman_other_output_position(const size_t row_offset, const size_t packet_idx)
Definition: as_waksman_routing_algorithm.cpp:275
libsnark::benes_topology
std::vector< std::vector< std::pair< size_t, size_t > > > benes_topology
Definition: benes_routing_algorithm.hpp:51
libsnark::tinyram_opcode_UMOD
@ tinyram_opcode_UMOD
Definition: tinyram_aux.hpp:37
libsnark::TBCS_GATE_IF_X_THEN_Y
@ TBCS_GATE_IF_X_THEN_Y
Definition: tbcs.hpp:69
libsnark::tinyram_opcode_CMPE
@ tinyram_opcode_CMPE
Definition: tinyram_aux.hpp:41
libsnark::TBCS_GATE_NOT_X_AND_Y
@ TBCS_GATE_NOT_X_AND_Y
Definition: tbcs.hpp:60
libsnark::TBCS_GATE_X_AND_NOT_Y
@ TBCS_GATE_X_AND_NOT_Y
Definition: tbcs.hpp:58
libsnark::tinyram_opcode_11000
@ tinyram_opcode_11000
Definition: tinyram_aux.hpp:55
libsnark::tinyram_opcode_CMPGE
@ tinyram_opcode_CMPGE
Definition: tinyram_aux.hpp:45
libsnark::tinyram_opcode_MOV
@ tinyram_opcode_MOV
Definition: tinyram_aux.hpp:47
libsnark::tinyram_opcode_STOREW
@ tinyram_opcode_STOREW
Definition: tinyram_aux.hpp:60
libsnark::tinyram_opcode_CMOV
@ tinyram_opcode_CMOV
Definition: tinyram_aux.hpp:48
libsnark::as_waksman_get_switch_setting_from_top_bottom_decision
bool as_waksman_get_switch_setting_from_top_bottom_decision(const size_t row_offset, const size_t packet_idx, const bool use_top)
Definition: as_waksman_routing_algorithm.cpp:245
libsnark::memory_contents
std::map< size_t, size_t > memory_contents
Definition: memory_interface.hpp:25
gadgetlib2::GadgetLibAdapter::convert
linear_term_t convert(const LinearTerm &lt) const
Definition: adapters.cpp:20
libsnark::tinyram_opcode_SUB
@ tinyram_opcode_SUB
Definition: tinyram_aux.hpp:32
libsnark::as_waksman_top_height
size_t as_waksman_top_height(const size_t num_packets)
Definition: as_waksman_routing_algorithm.cpp:25
libsnark::tinyram_opcode_UMULH
@ tinyram_opcode_UMULH
Definition: tinyram_aux.hpp:34
libsnark::tinyram_opcode_SMULH
@ tinyram_opcode_SMULH
Definition: tinyram_aux.hpp:35
libsnark::tinyram_opcode_AND
@ tinyram_opcode_AND
Definition: tinyram_aux.hpp:27
libsnark::as_waksman_switch_output
size_t as_waksman_switch_output(const size_t num_packets, const size_t row_offset, const size_t row_idx, const bool use_top)
Definition: as_waksman_routing_algorithm.cpp:41
libsnark::operator<<
std::ostream & operator<<(std::ostream &out, const tbcs_circuit &circuit)
Definition: tbcs.cpp:289
libsnark::tinyram_opcode_MULL
@ tinyram_opcode_MULL
Definition: tinyram_aux.hpp:33
libsnark::tinyram_input_tape
std::vector< size_t > tinyram_input_tape
Definition: tinyram_aux.hpp:122
libsnark::tinyram_opcode_args_none
@ tinyram_opcode_args_none
Definition: tinyram_aux.hpp:71
libsnark::TBCS_GATE_Y
@ TBCS_GATE_Y
Definition: tbcs.hpp:61
libsnark::ensure_tinyram_opcode_value_map
void ensure_tinyram_opcode_value_map()
Definition: tinyram_aux.cpp:102
libsnark::tinyram_opcode_SHR
@ tinyram_opcode_SHR
Definition: tinyram_aux.hpp:39
libsnark::get_constraint_system_from_gadgetlib2
r1cs_constraint_system< libff::Fr< libff::default_ec_pp > > get_constraint_system_from_gadgetlib2(const gadgetlib2::Protoboard &pb)
Definition: integration.cpp:30
libsnark::tinyram_opcode_args_des_arg1_arg2
@ tinyram_opcode_args_des_arg1_arg2
Definition: tinyram_aux.hpp:67
gadgetlib2::VariableAssignment
::std::map< Variable, FElem, Variable::VariableStrictOrder > VariableAssignment
Definition: variable.hpp:348
libsnark::benes_rhs_packet_source
size_t benes_rhs_packet_source(const size_t dimension, const size_t column_idx, const size_t row_idx, const bool use_top)
Definition: benes_routing_algorithm.cpp:84
libsnark::benes_cross_edge_mask
size_t benes_cross_edge_mask(const size_t dimension, const size_t column_idx)
Definition: benes_routing_algorithm.cpp:37
libsnark::as_waksman_get_canonical_row_idx
size_t as_waksman_get_canonical_row_idx(const size_t row_offset, const size_t row_idx)
Definition: as_waksman_routing_algorithm.cpp:227
libsnark::tinyram_opcode_args_arg2
@ tinyram_opcode_args_arg2
Definition: tinyram_aux.hpp:70
gadgetlib2::GLA
GadgetLibAdapter GLA
Definition: adapters.cpp:18
gadgetlib2::VariableArray
VariableArray.
Definition: variable.hpp:353
libsnark::TBCS_GATE_NOT_Y
@ TBCS_GATE_NOT_Y
Definition: tbcs.hpp:66
libsnark::tbcs_gate_type
tbcs_gate_type
Definition: tbcs.hpp:55
libsnark::tinyram_opcode_READ
@ tinyram_opcode_READ
Definition: tinyram_aux.hpp:62
libsnark::tinyram_opcode
tinyram_opcode
Definition: tinyram_aux.hpp:26
libsnark::tinyram_opcode_11001
@ tinyram_opcode_11001
Definition: tinyram_aux.hpp:56
libsnark::tinyram_opcode_XOR
@ tinyram_opcode_XOR
Definition: tinyram_aux.hpp:29
libsnark::tinyram_opcode_CMPAE
@ tinyram_opcode_CMPAE
Definition: tinyram_aux.hpp:43
libsnark::tinyram_opcode_CNJMP
@ tinyram_opcode_CNJMP
Definition: tinyram_aux.hpp:52
libsnark::TBCS_GATE_NOR
@ TBCS_GATE_NOR
Definition: tbcs.hpp:64
libsnark::benes_routing
std::vector< libff::bit_vector > benes_routing
Definition: benes_routing_algorithm.hpp:61
libsnark::tinyram_opcode_NOT
@ tinyram_opcode_NOT
Definition: tinyram_aux.hpp:30
libsnark::TBCS_GATE_XOR
@ TBCS_GATE_XOR
Definition: tbcs.hpp:62
libsnark::TBCS_GATE_AND
@ TBCS_GATE_AND
Definition: tbcs.hpp:57
libsnark::benes_num_columns
size_t benes_num_columns(const size_t num_packets)
Definition: benes_routing_algorithm.cpp:136
libsnark::tinyram_opcode_CMPG
@ tinyram_opcode_CMPG
Definition: tinyram_aux.hpp:44
libsnark::TBCS_GATE_IF_Y_THEN_X
@ TBCS_GATE_IF_Y_THEN_X
Definition: tbcs.hpp:67
libsnark::constraint_profiling_table
std::vector< constraint_profiling_entry > constraint_profiling_table
Definition: constraint_profiling.cpp:21
libsnark::TBCS_GATE_OR
@ TBCS_GATE_OR
Definition: tbcs.hpp:63
libsnark::get_variable_assignment_from_gadgetlib2
r1cs_variable_assignment< libff::Fr< libff::default_ec_pp > > get_variable_assignment_from_gadgetlib2(const gadgetlib2::Protoboard &pb)
Definition: integration.cpp:56
libsnark::as_waksman_other_input_position
size_t as_waksman_other_input_position(const size_t row_offset, const size_t packet_idx)
Definition: as_waksman_routing_algorithm.cpp:287
libsnark::convert_gadgetlib2_linear_combination
linear_combination< libff::Fr< libff::default_ec_pp > > convert_gadgetlib2_linear_combination(const gadgetlib2::GadgetLibAdapter::linear_combination_t &lc)
Definition: integration.cpp:15
libsnark::TBCS_GATE_EQUIVALENCE
@ TBCS_GATE_EQUIVALENCE
Definition: tbcs.hpp:65
libsnark::benes_lhs_packet_destination
size_t benes_lhs_packet_destination(const size_t dimension, const size_t column_idx, const size_t row_idx, const bool use_top)
Definition: benes_routing_algorithm.cpp:59
gadgetlib2::initPublicParamsFromDefaultPp
PublicParams initPublicParamsFromDefaultPp()
Definition: pp.cpp:23
libsnark::TBCS_GATE_CONSTANT_0
@ TBCS_GATE_CONSTANT_0
Definition: tbcs.hpp:56
gadgetlib2::Protoboard::create
static ProtoboardPtr create(const FieldType &fieldType, ParamsCPtr pParams=NULL)
Definition: protoboard.hpp:54
libsnark::as_waksman_route_inner
void as_waksman_route_inner(const size_t left, const size_t right, const size_t lo, const size_t hi, const integer_permutation &permutation, const integer_permutation &permutation_inv, as_waksman_routing &routing)
Definition: as_waksman_routing_algorithm.cpp:308
libsnark::construct_as_waksman_inner
void construct_as_waksman_inner(const size_t left, const size_t right, const size_t lo, const size_t hi, const std::vector< size_t > rhs_dests, as_waksman_topology &neighbors)
Definition: as_waksman_routing_algorithm.cpp:87
libsnark::tinyram_opcode_CJMP
@ tinyram_opcode_CJMP
Definition: tinyram_aux.hpp:51
libsnark::tinyram_opcode_LOADW
@ tinyram_opcode_LOADW
Definition: tinyram_aux.hpp:61
libsnark::as_waksman_routing
std::vector< std::map< size_t, bool > > as_waksman_routing
Definition: as_waksman_routing_algorithm.hpp:102
gadgetlib2::Variable
A formal variable, field agnostic.
Definition: variable.hpp:306
libsnark::benes_packet_cross_destination
size_t benes_packet_cross_destination(const size_t dimension, const size_t column_idx, const size_t row_idx)
Definition: benes_routing_algorithm.cpp:116
gadgetlib2::Protoboard::assignment
VariableAssignment assignment() const
Definition: protoboard.hpp:102
libsnark::tbcs_variable_assignment
std::vector< bool > tbcs_variable_assignment
Definition: tbcs.hpp:31
libsnark::opcode_values
std::map< std::string, tinyram_opcode > opcode_values
Definition: tinyram_aux.cpp:100
libsnark::route_by_benes
std::vector< std::vector< T > > route_by_benes(const benes_routing &routing, const std::vector< T > &start)
Definition: benes_routing_algorithm.cpp:343
libsnark::constraint_profiling_indent
size_t constraint_profiling_indent
Definition: constraint_profiling.cpp:20
libsnark::as_waksman_num_columns
size_t as_waksman_num_columns(const size_t num_packets)
Definition: as_waksman_routing_algorithm.cpp:69
libsnark::TBCS_GATE_NAND
@ TBCS_GATE_NAND
Definition: tbcs.hpp:70
libsnark::TBCS_GATE_CONSTANT_1
@ TBCS_GATE_CONSTANT_1
Definition: tbcs.hpp:71
libsnark::tinyram_opcode_args_arg1_arg2
@ tinyram_opcode_args_arg1_arg2
Definition: tinyram_aux.hpp:69
libsnark::tinyram_opcode_STOREB
@ tinyram_opcode_STOREB
Definition: tinyram_aux.hpp:58
libsnark::operator>>
std::istream & operator>>(std::istream &in, tbcs_circuit &circuit)
Definition: tbcs.cpp:299
libsnark::tinyram_opcode_10111
@ tinyram_opcode_10111
Definition: tinyram_aux.hpp:54
libsnark::tinyram_opcode_UDIV
@ tinyram_opcode_UDIV
Definition: tinyram_aux.hpp:36
libsnark::tinyram_opcode_ADD
@ tinyram_opcode_ADD
Definition: tinyram_aux.hpp:31
libsnark::tinyram_opcode_LOADB
@ tinyram_opcode_LOADB
Definition: tinyram_aux.hpp:59
gadgetlib2::R1P
@ R1P
Definition: variable.hpp:37
libsnark::route_benes_inner
void route_benes_inner(const size_t dimension, const integer_permutation &permutation, const integer_permutation &permutation_inv, const size_t column_idx_start, const size_t column_idx_end, const size_t subnetwork_offset, const size_t subnetwork_size, benes_routing &routing)
Definition: benes_routing_algorithm.cpp:176
libsnark::benes_get_switch_setting_from_subnetwork
bool benes_get_switch_setting_from_subnetwork(const size_t dimension, const size_t column_idx, const size_t row_idx, const bool use_top)
Definition: benes_routing_algorithm.cpp:99
libsnark::tinyram_opcode_OR
@ tinyram_opcode_OR
Definition: tinyram_aux.hpp:28