Browse Source

fix: clippy warnings

al-gkr-basic-workflow
Al-Kindi-0 2 years ago
parent
commit
09014a34d1
4 changed files with 7 additions and 30 deletions
  1. +1
    -0
      crypto/src/hash/mod.rs
  2. +0
    -27
      crypto/src/hash/rpo/digest.rs
  3. +2
    -2
      crypto/src/hash/rpo/mod.rs
  4. +4
    -1
      crypto/src/merkle/mod.rs

+ 1
- 0
crypto/src/hash/mod.rs

@ -2,6 +2,7 @@ use crate::{ElementHasher, HashFn};
mod rpo;
pub use rpo::Rpo256 as Hasher;
pub use rpo::{INV_MDS, MDS};
// TYPE ALIASES
// ================================================================================================

+ 0
- 27
crypto/src/hash/rpo/digest.rs

@ -94,33 +94,6 @@ impl Deref for RpoDigest256 {
}
}
impl RpoDigest256 {
fn iter(&self) -> RpoDigest256Iter<'_> {
RpoDigest256Iter {
values: &self.0,
index: 0,
}
}
}
pub struct RpoDigest256Iter<'a> {
values: &'a [Felt; DIGEST_SIZE],
index: usize,
}
impl<'a> Iterator for RpoDigest256Iter<'a> {
type Item = &'a Felt;
fn next(&mut self) -> Option<Self::Item> {
if self.index >= self.values.len() {
return None;
}
self.index += 1;
Some(&self.values[self.index - 1])
}
}
// TESTS
// ================================================================================================

+ 2
- 2
crypto/src/hash/rpo/mod.rs

@ -378,7 +378,7 @@ impl Rpo256 {
// MDS
// ================================================================================================
/// RPO MDS matrix
const MDS: [[Felt; STATE_WIDTH]; STATE_WIDTH] = [
pub const MDS: [[Felt; STATE_WIDTH]; STATE_WIDTH] = [
[
Felt::new(7),
Felt::new(23),
@ -550,7 +550,7 @@ const MDS: [[Felt; STATE_WIDTH]; STATE_WIDTH] = [
];
/// RPO Inverse MDS matrix
const INV_MDS: [[Felt; STATE_WIDTH]; STATE_WIDTH] = [
pub const INV_MDS: [[Felt; STATE_WIDTH]; STATE_WIDTH] = [
[
Felt::new(14868391535953158196),
Felt::new(13278298489594233127),

+ 4
- 1
crypto/src/merkle/mod.rs

@ -1,4 +1,7 @@
use crate::{Felt, Word, ZERO};
use crate::Word;
#[cfg(test)]
use crate::{Felt, ZERO};
pub mod merkle_path_set;
pub mod merkle_tree;

Loading…
Cancel
Save