mirror of
https://github.com/arnaucube/miden-crypto.git
synced 2026-01-11 16:41:29 +01:00
fix: clippy warnings
This commit is contained in:
@@ -2,6 +2,7 @@ use crate::{ElementHasher, HashFn};
|
||||
|
||||
mod rpo;
|
||||
pub use rpo::Rpo256 as Hasher;
|
||||
pub use rpo::{INV_MDS, MDS};
|
||||
|
||||
// TYPE ALIASES
|
||||
// ================================================================================================
|
||||
|
||||
@@ -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
|
||||
// ================================================================================================
|
||||
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user