Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix a typo #195

Merged
merged 1 commit into from
Aug 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions taiga_halo2/src/merkle_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@ impl Distribution<LR> for Standard {
}

#[derive(Clone)]
pub struct MerkleTreeLeafs {
leafs: Vec<Node>,
pub struct MerkleTreeLeaves {
leaves: Vec<Node>,
}

impl MerkleTreeLeafs {
impl MerkleTreeLeaves {
pub fn new(values: Vec<pallas::Base>) -> Self {
let nodes_vec = values.iter().map(|x| Node::new(*x)).collect::<Vec<_>>();
Self { leafs: nodes_vec }
Self { leaves: nodes_vec }
}

pub fn root(&mut self) -> Node {
// the list of leafs is extended with copies of elements so that its length is a power of 2.
let list = &mut self.leafs;
// the list of leaves is extended with copies of elements so that its length is a power of 2.
let list = &mut self.leaves;
let n = list.len();
let m = n.next_power_of_two();
let mut ext = list.clone();
Expand All @@ -76,10 +76,10 @@ impl MerkleTreeLeafs {
}

pub fn insert(&mut self, value: pallas::Base) -> Self {
let leafs = &mut self.leafs;
leafs.push(Node::new(value));
let leaves = &mut self.leaves;
leaves.push(Node::new(value));
Self {
leafs: leafs.to_vec(),
leaves: leaves.to_vec(),
}
}
}
Expand Down
Loading