Skip to content

Commit f200c20

Browse files
committed
Consistency proof verification tweaks
1 parent bc3b3b3 commit f200c20

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

draft-davidben-tls-merkle-tree-certs.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ Given a Merkle Tree over `n` elements, a subtree defined by `[start, end)`, a co
727727
1. If `sn` is `tn`, then:
728728
1. Until `fn` is `sn`, right-shift `fn`, `sn`, and `tn` equally.
729729
1. Otherwise:
730-
1. Until `LSB(sn)` is not set or `fn` is `sn`, right-shift `fn`, `sn`, and `tn` equally.
730+
1. Until `fn` is `sn` or `LSB(sn)` is not set, right-shift `fn`, `sn`, and `tn` equally.
731731
1. If `fn` is `sn`, set `fr` and `sr` to `node_hash`.
732732
1. Otherwise:
733733
1. If `proof` is an empty array, stop and fail verification.
@@ -1818,15 +1818,17 @@ Step 2 initializes `fn` (first number), `sn` (second number), and `tn` (third nu
18181818

18191819
Steps 3 and 4 then skip to the starting node, described in {{consistency-proof-structure}}. The starting node may be:
18201820

1821-
* The entire subtree `[start, end)` if `[start, end)` is directly contained in the tree. This will occur if `end` is `n`, or if `[start, end)` is full.
1821+
* The entire subtree `[start, end)` if `[start, end)` is directly contained in the tree. This will occur if `end` is `n` (step 3), or if `[start, end)` is full (exiting step 4 because `fn` is `sn`).
18221822

1823-
* Otherwise, the highest full subtree along the right edge of `[start, end)`.
1823+
* Otherwise, the highest full subtree along the right edge of `[start, end)`. This corresponds to the process exiting step 4 because `LSB(sn)` is not set.
18241824

1825-
In the first case, `fn` will equal `sn` after truncation. Step 5 will then initialize the hashes to `node_hash`. The consistency proof does not need to include a separate copy of `node_hash`.
1825+
Steps 5 and 6 initialize the hashes `fr` and `sr`:
18261826

1827-
In the second case, `fn` is less than `sn`. Step 6 will then initialize the hashes to the first value in the consistency proof.
1827+
* In the first case above, `fn` will equal `sn` after truncation. Step 5 will then initialize the hashes to `node_hash` because consistency proof does not need to include the starting node.
18281828

1829-
From there, step 7 incorporates the consistency proof into `fr` and `sr`:
1829+
* In the second case above, `fn` is less than `sn`. Step 6 will then initialize the hashes to the first value in the consistency proof.
1830+
1831+
Step 7 incorporates the remainder of the consistency proof into `fr` and `sr`:
18301832

18311833
* All hashes are incorporated into `sr`, with hashing on the left or right determined the same as in inclusion proof evaluation.
18321834

0 commit comments

Comments
 (0)