# must fail: head_proof_ok_O3 # the left subtree is half the length, rounded down to a chunk (head_proof::left_len) diff --git a/wai/wai-rs/src/http_binding/head_proof.rs b/wai/wai-rs/src/http_binding/head_proof.rs index 40b6f1fa..ea665c22 100644 --- a/wai/wai-rs/src/http_binding/head_proof.rs +++ b/wai/wai-rs/src/http_binding/head_proof.rs @@ -35,7 +35,7 @@ pub struct HeadProof { /// leaves at least one byte to the right. fn left_len(n: u64) -> u64 { let q = (n - 1) / CHUNK; - CHUNK << (63 - q.leading_zeros()) + ((n / 2) / CHUNK).max(1) * CHUNK } /// The root of a tree from its two children: BLAKE3's parent node with the ROOT flag.