Skip to content

Commit

Permalink
chore: fix comments & typos (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaolou86 authored Nov 3, 2023
1 parent 980b39b commit c40a496
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions halo2-base/src/safe_types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ type RawAssignedValues<F> = Vec<AssignedValue<F>>;
const BITS_PER_BYTE: usize = 8;

/// SafeType's goal is to avoid out-of-range undefined behavior.
/// When building circuits, it's common to use mulitple AssignedValue<F> to represent
/// a logical varaible. For example, we might want to represent a hash with 32 AssignedValue<F>
/// When building circuits, it's common to use multiple AssignedValue<F> to represent
/// a logical variable. For example, we might want to represent a hash with 32 AssignedValue<F>
/// where each AssignedValue represents 1 byte. However, the range of AssignedValue<F> is much
/// larger than 1 byte(0~255). If a circuit takes 32 AssignedValue<F> as inputs and some of them
/// are actually greater than 255, there could be some undefined behaviors.
/// SafeType gurantees the value range of its owned AssignedValue<F>. So circuits don't need to
/// SafeType guarantees the value range of its owned AssignedValue<F>. So circuits don't need to
/// do any extra value checking if they take SafeType as inputs.
/// TOTAL_BITS is the number of total bits of this type.
/// BYTES_PER_ELE is the number of bytes of each element.
Expand Down Expand Up @@ -274,7 +274,7 @@ impl<'a, F: ScalarField> SafeTypeChip<'a, F> {
/// * ctx: Circuit [Context]<F> to assign witnesses to.
/// * inputs: Vector representing the byte array, right padded to `max_len`. See [VarLenBytesVec] for details about padding.
/// * len: [AssignedValue]<F> witness representing the variable length of the byte array. Constrained to be `<= max_len`.
/// * max_len: [usize] representing the maximum length of the byte array and the number of elements it must contain. We enforce this to be provided explictly to make sure length of `inputs` is determinstic.
/// * max_len: [usize] representing the maximum length of the byte array and the number of elements it must contain. We enforce this to be provided explicitly to make sure length of `inputs` is determinstic.
pub fn raw_to_var_len_bytes_vec(
&self,
ctx: &mut Context<F>,
Expand Down Expand Up @@ -307,7 +307,7 @@ impl<'a, F: ScalarField> SafeTypeChip<'a, F> {
///
/// * ctx: Circuit [Context]<F> to assign witnesses to.
/// * inputs: Slice representing the byte array.
/// * len: length of the byte array. We enforce this to be provided explictly to make sure length of `inputs` is determinstic.
/// * len: length of the byte array. We enforce this to be provided explicitly to make sure length of `inputs` is determinstic.
pub fn raw_to_fix_len_bytes_vec(
&self,
ctx: &mut Context<F>,
Expand Down
2 changes: 1 addition & 1 deletion hashes/zkevm/src/keccak/component/circuit/shard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ impl<F: Field> KeccakComponentShardCircuit<F> {
let mut base_circuit_builder_mut = self.base_circuit_builder.borrow_mut();
let ctx = base_circuit_builder_mut.main(0);

// TODO: wrap this into a function which should be shared wiht App circuits.
// TODO: wrap this into a function which should be shared with App circuits.
let output_commitment = self.hasher.borrow().hash_fix_len_array(
ctx,
gate,
Expand Down
2 changes: 1 addition & 1 deletion hashes/zkevm/src/keccak/vanilla/keccak_packed_multi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ pub(crate) mod transform {
}
}

// Transfroms values to cells
// Transforms values to cells
pub(crate) mod transform_to {
use crate::{
halo2_proofs::plonk::{ConstraintSystem, TableColumn},
Expand Down
2 changes: 1 addition & 1 deletion hashes/zkevm/src/keccak/vanilla/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ impl<F: Field> KeccakCircuitConfig<F> {
// multiple rows with lookups in a way that doesn't require any
// extra additional cells or selectors we have to put all `s[i]`'s on the same
// row. This isn't that strong of a requirement actually because we the
// words are split into multipe parts, and so only the parts at the same
// words are split into multiple parts, and so only the parts at the same
// position of those words need to be on the same row.
let target_word_sizes = target_part_sizes(part_size);
let num_word_parts = target_word_sizes.len();
Expand Down

0 comments on commit c40a496

Please sign in to comment.