Skip to content

Commit

Permalink
correct several minor typos found during review
Browse files Browse the repository at this point in the history
  • Loading branch information
ledwards2225 committed Oct 11, 2023
1 parent 3704048 commit 3c9ad14
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ GoblinTranslatorCircuitBuilder::AccumulationInput generate_witness_values(Fr op_
Fq batching_challenge_v,
Fq evaluation_input_x)
{
// All parameters are well-described in the header, this is just fo convenience
// All parameters are well-described in the header, this is just for convenience
constexpr size_t NUM_LIMB_BITS = GoblinTranslatorCircuitBuilder::NUM_LIMB_BITS;
constexpr size_t NUM_BINARY_LIMBS = GoblinTranslatorCircuitBuilder::NUM_BINARY_LIMBS;
constexpr size_t NUM_MICRO_LIMBS = GoblinTranslatorCircuitBuilder::NUM_MICRO_LIMBS;
Expand All @@ -63,7 +63,7 @@ GoblinTranslatorCircuitBuilder::AccumulationInput generate_witness_values(Fr op_
constexpr auto shift_2_inverse = GoblinTranslatorCircuitBuilder::SHIFT_2_INVERSE;

/**
* @brief A small function to transform a native element Fq into its bigfield representation in Fr scalars
* @brief A small function to transform a native element Fq into its bigfield representation in Fr scalars
*
*/
auto base_element_to_bigfield = [](Fq& original) {
Expand All @@ -76,7 +76,7 @@ GoblinTranslatorCircuitBuilder::AccumulationInput generate_witness_values(Fr op_
});
};
/**
* @brief A small function to transform a uint512_t element into its bigfield representation in Fr scalars
* @brief A small function to transform a uint512_t element into its bigfield representation in Fr scalars
*
*/
auto uint512_t_to_bigfield = [&shift_2](uint512_t& original) {
Expand Down Expand Up @@ -232,7 +232,7 @@ GoblinTranslatorCircuitBuilder::AccumulationInput generate_witness_values(Fr op_
std::array<Fr, NUM_BINARY_LIMBS> quotient_witnesses = { quotient_0, quotient_1, quotient_2, quotient_3 };

// We will divide by shift_2 instantly in the relation itself, but first we need to compute the low part (0*0) and
// the high part (0*1, 1*0) multiplied by a signle limb shift
// the high part (0*1, 1*0) multiplied by a single limb shift
Fr low_wide_relation_limb_part_1 =
previous_accumulator_witnesses[0] * x_witnesses[0] + op_code + v_witnesses[0] * p_x_witnesses[0] +
v_squared_witnesses[0] * p_y_witnesses[0] + v_cubed_witnesses[0] * z_1_lo + v_quarted_witnesses[0] * z_2_lo +
Expand All @@ -248,7 +248,7 @@ GoblinTranslatorCircuitBuilder::AccumulationInput generate_witness_values(Fr op_
quotient_witnesses[1] * neg_modulus_limbs[0] - remainder_witnesses[1]) *
shift_1;

// Low bits have to be zero
// Low bits have to be zero
ASSERT(uint256_t(low_wide_relation_limb).slice(0, 2 * NUM_LIMB_BITS) == 0);

Fr low_wide_relation_limb_divided = low_wide_relation_limb * shift_2_inverse;
Expand Down Expand Up @@ -479,6 +479,7 @@ void GoblinTranslatorCircuitBuilder::create_accumulation_gate(const Accumulation
wires[starting_wire + i].push_back(add_variable(input[i]));
}
};

// We are using some leftover crevices for relation_wide_microlimbs
auto low_relation_microlimbs = acc_step.relation_wide_microlimbs[0];
auto high_relation_microlimbs = acc_step.relation_wide_microlimbs[1];
Expand Down Expand Up @@ -545,7 +546,8 @@ void GoblinTranslatorCircuitBuilder::create_accumulation_gate(const Accumulation
}

/**
* @brief Given an ECCVM operation, previous accumultor and necessary challenges, compute witnesses for one accumulation
* @brief Given an ECCVM operation, previous accumulator and necessary challenges, compute witnesses for one
* accumulation
*
* @tparam Fq
* @return GoblinTranslatorCircuitBuilder::AccumulationInput
Expand Down Expand Up @@ -629,7 +631,6 @@ void GoblinTranslatorCircuitBuilder::feed_ecc_op_queue_into_circuit(ECCOpQueue&
}
bool GoblinTranslatorCircuitBuilder::check_circuit()
{

// Compute the limbs of evaluation_input_x and powers of batching_challenge_v (these go into the relation)
RelationInputs relation_inputs = compute_relation_inputs_limbs(batching_challenge_v, evaluation_input_x);
// Get the main wires (we will operate with range constraint wires mainly through indices, since this is easier)
Expand Down Expand Up @@ -765,7 +766,6 @@ bool GoblinTranslatorCircuitBuilder::check_circuit()
};
auto z_1_micro_chunks = {
get_sequential_micro_chunks(i, Z_LOW_LIMBS_RANGE_CONSTRAINT_0, NUM_MICRO_LIMBS),

get_sequential_micro_chunks(i, Z_HIGH_LIMBS_RANGE_CONSTRAINT_0, NUM_MICRO_LIMBS),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ namespace proof_system {
* This ensures that the logic is sound modulo 2²⁷²⋅r, which means it's correct in integers, if all the values are
* sufficiently constrained (there is no way to undeflow or overflow)
*
* Concretely, Goblin Translator computes one accumulation ever two gates:
* previous_accumulator⋅x + op + P.x⋅v +P.y⋅v² + z1v³ + z2⋅v⁴ = current_accumulator mod p. Because of the nature of
* Concretely, Goblin Translator computes one accumulation every two gates:
* previous_accumulator⋅x + op + P.x⋅v +P.y⋅v² + z1v³ + z2⋅v⁴ = current_accumulator mod p. Because of the nature of
* polynomial commitment, previous_accumulator is located at higher index than the current_accumulator. Values of x
* (evaluation_input_x) and v (batching_challenge_v) are precomputed and considered inputs to the relations.
*
Expand Down Expand Up @@ -221,8 +221,8 @@ class GoblinTranslatorCircuitBuilder : public CircuitBuilderBase<arithmetization

// Range constraint of relation limbs
static constexpr size_t RELATION_WIDE_LIMB_BITS = 84;
// Maximum size of each relation limb (in accordance with range constraints)

// Maximum size of each relation limb (in accordance with range constraints)
static constexpr uint256_t MAX_RELATION_WIDE_LIMB_SIZE = uint256_t(1) << RELATION_WIDE_LIMB_BITS;

// Shift of a single micro (range constraint) limb
Expand Down Expand Up @@ -252,7 +252,7 @@ class GoblinTranslatorCircuitBuilder : public CircuitBuilderBase<arithmetization
// The binary modulus used in the CRT computation
static constexpr uint512_t BINARY_BASIS_MODULUS = uint512_t(1) << (NUM_LIMB_BITS << 2);

// Negated modulus of the target emualted field in the binary modulus
// Negated modulus of the target emulated field in the binary modulus
static constexpr uint512_t NEGATIVE_PRIME_MODULUS = BINARY_BASIS_MODULUS - MODULUS_U512;

// Negated modulus of the target emulated field in the binary modulus split into 4 binary limbs + the final limb is
Expand Down Expand Up @@ -345,7 +345,7 @@ class GoblinTranslatorCircuitBuilder : public CircuitBuilderBase<arithmetization
/**
* @brief Construct a new Goblin Translator Circuit Builder object and feed op_queue inside
*
* @details Goblin Translator Circuit builder has to be initializaed with evaluation input and batching challenge
* @details Goblin Translator Circuit builder has to be initialized with evaluation input and batching challenge
* (they are used to compute witness and to store the value for the prover)
*
* @param batching_challenge_v_
Expand Down Expand Up @@ -434,7 +434,7 @@ class GoblinTranslatorCircuitBuilder : public CircuitBuilderBase<arithmetization
uint256_t(get_variable(wires[WireIds::ACCUMULATORS_BINARY_LIMBS_3][RESULT_ROW])) * SHIFT_3);
}
/**
* @brief Generate all the gates required to proof the correctness of batched evalution of polynomials representing
* @brief Generate all the gates required to prove the correctness of batched evalution of polynomials representing
* commitments to ECCOpQueue
*
* @param ecc_op_queue The queue
Expand Down

0 comments on commit 3c9ad14

Please sign in to comment.