From 5948a4977a9acb93f338685c623fc8a44b9275d8 Mon Sep 17 00:00:00 2001 From: str4d Date: Wed, 15 Dec 2021 13:04:54 +0000 Subject: [PATCH] poseidon: Update code comments Also fixes some clippy lints (public docs linking to private items). Co-authored-by: Daira Hopwood --- src/primitives/poseidon.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/primitives/poseidon.rs b/src/primitives/poseidon.rs index ecbc07ef..7743fa56 100644 --- a/src/primitives/poseidon.rs +++ b/src/primitives/poseidon.rs @@ -147,15 +147,15 @@ fn poseidon_sponge, const T: usize, const RATE: Squeezing(output) } -/// The state of the [`Sponge`]. +/// The state of the `Sponge`. // TODO: Seal this trait? pub trait SpongeMode {} -/// The absorbing state of the [`Sponge`]. +/// The absorbing state of the `Sponge`. #[derive(Debug)] pub struct Absorbing(pub(crate) SpongeRate); -/// The squeezing state of the [`Sponge`]. +/// The squeezing state of the `Sponge`. #[derive(Debug)] pub struct Squeezing(pub(crate) SpongeRate); @@ -307,8 +307,8 @@ impl Domain for Constan fn padding(input_len: usize) -> Self::Padding { assert_eq!(input_len, L); // For constant-input-length hashing, we pad the input with zeroes to a multiple - // of RATE. On its own this is not sponge-compliant padding, but the Poseidon - // authors instead encode the constant length into the capacity element, ensuring + // of RATE. On its own this would not be sponge-compliant padding, but the + // Poseidon authors encode the constant length into the capacity element, ensuring // that inputs of different lengths do not share the same permutation. let k = (L + RATE - 1) / RATE; iter::repeat(F::zero()).take(k * RATE - L)