diff --git a/README.md b/README.md index 7852dbe55..31965ee84 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ For general discussions on Jellyfish PLONK, please join our [Discord channel](ht - ['jf-utils'](utilities): utilities and helper functions. ### Primitives -- ['jf-prf'](prf): trait definitions for pesudorandom function (PRF). +- ['jf-prf'](prf): trait definitions for pseudorandom function (PRF). - ['jf-crhf'](crhf): trait definitions for collision-resistant hash function (CRHF). - ['jf-commitment'](commitment): trait definitions for cryptographic commitment scheme. - ['jf-rescue'](rescue): Rescue hash function, and its subsequent PRF, CRHF, commitment scheme implementations. diff --git a/aead/src/lib.rs b/aead/src/lib.rs index 41d72c053..bf4332672 100644 --- a/aead/src/lib.rs +++ b/aead/src/lib.rs @@ -95,7 +95,7 @@ impl EncKey { // generate an ephemeral key pair as the virtual sender to derive the crypto box let ephemeral_keypair = crypto_kx::Keypair::generate(&mut rng); // `crypto_kx` generates a pair of shared secrets, see - // we use the transimission key of the ephemeral sender (equals to the receiving + // we use the transmission key of the ephemeral sender (equals to the receiving // key of the server) as the shared secret. let shared_secret = ephemeral_keypair.session_keys_to(&self.0).tx; let cipher = XChaCha20Poly1305::new(shared_secret.as_ref().into()); diff --git a/crhf/Cargo.toml b/crhf/Cargo.toml index b686cbb5e..0b938c687 100644 --- a/crhf/Cargo.toml +++ b/crhf/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jf-crhf" -version = "0.1.0" +version = "0.1.1" description = "Collision-resistant hash function (CRHF)" authors = { workspace = true } edition = { workspace = true } diff --git a/elgamal/src/gadgets.rs b/elgamal/src/gadgets.rs index 6b3d4255a..bf6a84296 100644 --- a/elgamal/src/gadgets.rs +++ b/elgamal/src/gadgets.rs @@ -58,7 +58,7 @@ where /// in each call, and the nonce is initialized to zero. /// * `key_var` - variables corresponding to the symmetric key /// * `data_vars` - the variables for the data to be encrypted. The format - /// of this input is a list of variable of arbitrary length + /// of this input is a list of variables of arbitrary length /// * `returns` - the variables that map to the ciphertext contents. The /// output size is the same as the length of data_vars fn apply_counter_mode_stream( @@ -166,7 +166,7 @@ where F: PrimeField, P: TECurveConfig, { - /// Compute the gadget that check a correct Elgamal encryption + /// Compute the gadget that checks a correct Elgamal encryption /// * `pk_vars` - variables corresponding to the encryption public key /// * `data_vars` - variables corresponding to the plaintext. Can be of /// arbitrary length. diff --git a/merkle_tree/src/append_only.rs b/merkle_tree/src/append_only.rs index f3b1f8bc0..2dd707386 100644 --- a/merkle_tree/src/append_only.rs +++ b/merkle_tree/src/append_only.rs @@ -310,7 +310,7 @@ mod mt_tests { assert!(mt.forget(1).expect_ok().is_ok()); // Number of leaves shall not change assert_eq!(mt.num_leaves(), 3); - // Leaves that are forgotten doesn't appear here + // Leaves that are forgotten don't appear here let leaves = mt.into_iter().collect::>(); assert_eq!(leaves, [(0, F::from(0u64)), (2, F::from(2u64))]); diff --git a/merkle_tree/src/lib.rs b/merkle_tree/src/lib.rs index 36e650779..436c6f6c9 100644 --- a/merkle_tree/src/lib.rs +++ b/merkle_tree/src/lib.rs @@ -130,7 +130,7 @@ where fn digest_leaf(pos: &I, elem: &E) -> Result; } -/// An trait for Merkle tree index type. +/// A trait for Merkle tree index type. pub trait ToTraversalPath { /// Convert the given index to a vector of branch indices given tree height /// and ARITY. @@ -170,8 +170,8 @@ pub trait MerkleProof: } /// Basic functionalities for a merkle tree implementation. Abstracted as an -/// accumulator for fixed-length array. Supports generate membership proof at a -/// given position and verify a membership proof. +/// accumulator for fixed-length array. Supports generating membership proof at +/// a given position and verify a membership proof. pub trait MerkleTreeScheme: Sized { /// Merkle tree element type type Element: Element; @@ -231,7 +231,7 @@ pub trait MerkleTreeScheme: Sized { // ) -> Result<(), MerkleTreeError>; /// Return an iterator that iterates through all element that are not - /// forgetton + /// forgotten fn iter(&self) -> MerkleTreeIter; } diff --git a/pcs/src/multilinear_kzg/mod.rs b/pcs/src/multilinear_kzg/mod.rs index ea46544f1..b4aca4821 100644 --- a/pcs/src/multilinear_kzg/mod.rs +++ b/pcs/src/multilinear_kzg/mod.rs @@ -181,7 +181,7 @@ impl PolynomialCommitmentScheme for MultilinearKzgPCS { /// /// This function takes 2^{num_var +1} number of scalar multiplications over /// G1: - /// - it prodceeds with `num_var` number of rounds, + /// - it proceeds with `num_var` number of rounds, /// - at round i, we compute an MSM for `2^{num_var - i + 1}` number of G2 /// elements. fn open( @@ -197,11 +197,11 @@ impl PolynomialCommitmentScheme for MultilinearKzgPCS { /// - the prover parameters for multilinear KZG, /// - a list of polynomials, /// - a (batch) commitment to all polynomials, - /// - and a same number of points, + /// - and the same number of points, /// compute a batch opening for all the polynomials. /// /// For simplicity, this API requires each MLE to have only one point. If - /// the caller wish to use more than one points per MLE, it should be + /// the caller wish to use more than one point per MLE, it should be /// handled at the caller layer. /// /// Returns an error if the lengths do not match. diff --git a/pcs/src/univariate_kzg/mod.rs b/pcs/src/univariate_kzg/mod.rs index 2be4cca98..232c91a7d 100644 --- a/pcs/src/univariate_kzg/mod.rs +++ b/pcs/src/univariate_kzg/mod.rs @@ -178,7 +178,7 @@ impl PolynomialCommitmentScheme for UnivariateKzgPCS { Ok((Self::Proof { proof }, eval)) } - /// Input a list of polynomials, and a same number of points, + /// Input a list of polynomials, and the same number of points, /// compute a multi-opening for all the polynomials. // This is a naive approach // TODO: to implement the more efficient batch opening algorithm diff --git a/poseidon2/src/sponge.rs b/poseidon2/src/sponge.rs index 182961432..e5654d0b9 100644 --- a/poseidon2/src/sponge.rs +++ b/poseidon2/src/sponge.rs @@ -10,7 +10,7 @@ use zeroize::Zeroize; /// /// # Generic parameters: /// - N: state size = rate (R) + capacity (C) -/// - R: rate (number of field abosrbed/squeezed) +/// - R: rate (number of field absorbed/squeezed) /// /// For security, for b=128-bit security, field size |F|, C*|F|>=2b: /// i.e. 128-bit for 256-bit fields, C>=1. diff --git a/relation/src/constraint_system.rs b/relation/src/constraint_system.rs index 6d8d24fba..70c3d31d7 100644 --- a/relation/src/constraint_system.rs +++ b/relation/src/constraint_system.rs @@ -251,7 +251,7 @@ pub trait Arithmetization: Circuit { } /// Compute and return the polynomial that interpolates the table domain - /// sepration ids. Return an error if the circuit does not support + /// separation ids. Return an error if the circuit does not support /// lookup or has not been finalized. fn compute_table_dom_sep_polynomial(&self) -> Result, CircuitError> { Err(CircuitError::LookupUnsupported) diff --git a/vrf/src/lib.rs b/vrf/src/lib.rs index 830bbe9cf..fd9b6fea5 100644 --- a/vrf/src/lib.rs +++ b/vrf/src/lib.rs @@ -59,7 +59,7 @@ pub trait Vrf { // FIXME: the API looks a bit strange when the default generator is used. // For example: // `S::param_gen::(None)` - // wheere `StdRng` is redundant. + // where `StdRng` is redundant. fn param_gen( &self, prng: Option<&mut R>,