fix: misc. nits

This commit is contained in:
Al-Kindi-0 2022-10-20 08:51:54 +02:00
parent 4d108fe5e5
commit 32af9aaed2
5 changed files with 16 additions and 25 deletions

View file

@ -13,8 +13,7 @@ edition = "2021"
[dependencies]
winterfell = { git = "https://github.com/novifinancial/winterfell"}
winter_utils = { version = "0.4", package = "winter-utils" }
rand_utils = { version = "0.4", package = "winter-rand-utils" }
[dev-dependencies]
proptest = "1.0.0"
rand_utils = { version = "0.4", package = "winter-rand-utils" }

View file

@ -1,10 +1,6 @@
use winterfell::crypto::hashers::Rp64_256 as Hasher;
use winterfell::crypto::ElementHasher;
use winterfell::crypto::Hasher as HashFn;
use winterfell::math::StarkField;
mod rpo;
pub use rpo::Rpo;
use crate::StarkField;
pub use winterfell::crypto::hashers::Rp64_256 as Hasher;
pub use winterfell::crypto::{ElementHasher, Hasher as HashFn};
// TYPE ALIASES
// ================================================================================================

View file

@ -1,7 +1,6 @@
use winter_utils::collections::BTreeMap;
use super::{Felt, FieldElement, MerkleError, Word};
use crate::hash::merge;
use winter_utils::collections::{BTreeMap, Vec};
// MERKLE PATH SET
// ================================================================================================
@ -255,9 +254,7 @@ fn compute_path_root(path: &[Word], depth: u32, index: u64) -> Word {
#[cfg(test)]
mod tests {
use super::calculate_parent_hash;
use super::{Felt, FieldElement, Word};
use super::{calculate_parent_hash, Felt, FieldElement, Word};
#[test]
fn get_root() {

View file

@ -1,12 +1,11 @@
use core::slice;
use winter_utils::uninit_vector;
use winterfell::math::log2;
use super::MerkleError;
use crate::{
hash::{merge, Digest},
Felt, FieldElement, Word,
};
use core::slice;
use winter_utils::uninit_vector;
use winterfell::math::log2;
// MERKLE TREE
// ================================================================================================
@ -147,7 +146,7 @@ impl MerkleTree {
#[cfg(test)]
mod tests {
use super::{Felt, FieldElement, Word};
use winterfell::crypto::{hashers::Rp64_256, ElementHasher, Hasher};
use crate::hash::{ElementHasher, HashFn, Hasher};
const LEAVES4: [Word; 4] = [
int_to_node(1),
@ -248,9 +247,9 @@ mod tests {
// --------------------------------------------------------------------------------------------
fn compute_internal_nodes() -> (Word, Word, Word) {
let node2 = Rp64_256::hash_elements(&[LEAVES4[0], LEAVES4[1]].concat());
let node3 = Rp64_256::hash_elements(&[LEAVES4[2], LEAVES4[3]].concat());
let root = Rp64_256::merge(&[node2, node3]);
let node2 = Hasher::hash_elements(&[LEAVES4[0], LEAVES4[1]].concat());
let node3 = Hasher::hash_elements(&[LEAVES4[2], LEAVES4[3]].concat());
let root = Hasher::merge(&[node2, node3]);
(root.into(), node2.into(), node3.into())
}

View file

@ -1,8 +1,8 @@
use crate::{Felt, FieldElement, Word};
pub mod merkle_path_set;
pub mod merkle_tree;
use crate::{Felt, FieldElement, Word};
// ERRORS
// ================================================================================================