Skip to content

Commit

Permalink
updated merkle example
Browse files Browse the repository at this point in the history
  • Loading branch information
yshekel committed Oct 14, 2024
1 parent c22ae60 commit cc35bc3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion examples/rust/hash-and-merkle/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ fn merkle_tree_example() {
let input_string = String::from(
"Hello, this is an ICICLE example to commit to a string and open specific parts +Add optional Pad",
);
println!("Commiting to the input string (leaf-size=6 bytes): `{}`", &input_string);

Check failure on line 109 in examples/rust/hash-and-merkle/src/main.rs

View workflow job for this annotation

GitHub Actions / Check Spelling

Commiting ==> Committing

let leaf_size = 6; // Leaf is the value that is opened. We will open 6 chars (bytes) of the string in this example.
let nof_leafs = input_string
.chars()
Expand Down Expand Up @@ -157,6 +159,7 @@ fn merkle_tree_example() {
// - Proofs can be pruned to include only necessary hashes or contain all sibling nodes.

// Generate a Merkle proof for the leaf at index 3.

let merkle_proof = merkle_tree
.get_proof(HostSlice::from_slice(&input), 3, true /*=pruned*/, &config)
.unwrap();
Expand Down Expand Up @@ -202,7 +205,7 @@ fn main() {
try_load_and_set_backend_device(&args);

// Execute the Keccak hashing example
keccak_hash_example();
// keccak_hash_example();

// Execute the Merkle-tree example
// TODO remove this when merkle-tree works on CUDA backend
Expand Down

0 comments on commit cc35bc3

Please sign in to comment.