Documentation

CslibFrontier.Crypto.Protocols.MQOM.CorrelatedTree

MQOM correlated-tree indices and validation transcripts #

The correlated-tree variant of MQOM v3 uses a perfect binary tree with N = 2 ^ height leaves and the one-based heap convention of Algorithms 21--23 in [MQOM2026, Section 2.5.4, pp. 32--33]. Leaf i is node N + i. Its opening lists one sibling per level, starting at the leaf: replace the current node by node ^^^ 1, then move the hidden node to node / 2. The revealed sibling nodes are disjoint from the entire hidden path, including the challenged leaf and the root. The generic Merkle API instead uses zero-based positions local to each level; these declarations keep the source's global heap indices rather than identify the representations.

The PGOW-MQ validation oracle in [MQOM2026, Definition 2, pp. 69--70] returns true exactly when a candidate is the designated secret prefix. validationTranscript records chronological calls using the library's existing reverse-chronological Cslib.OracleComp.Transcript convention. ValidationRun.accepted checks the final output separately: the final challenger check is not an extra adversary query and the output need not have appeared in the transcript.

This module contains no node labels, seed expansion, MQ arithmetic or sampled game. In particular, it states no runtime, success-probability, hardness or unforgeability result.

Main definitions #

Main results #

References #

Correlated-tree indices #

@[reducible, inline]

The N = 2 ^ height leaf positions of an MQOM correlated tree.

def Cslib.Crypto.MQOM.leafNode {height : ℕ} (leaf : LeafIndex height) :

One-based heap index N + i of leaf i, as in Algorithms 22--23.

Move a one-based heap node towards the root by repeated parent steps.

def Cslib.Crypto.MQOM.hiddenNode {height : ℕ} (leaf : LeafIndex height) (level : Fin (height + 1)) :

The hidden node after level parent steps. The root is available at level height.

def Cslib.Crypto.MQOM.siblingNode {height : ℕ} (leaf : LeafIndex height) (level : Fin height) :

The sibling revealed at a bottom-up opening level.

def Cslib.Crypto.MQOM.siblingPathNodes {height : ℕ} (leaf : LeafIndex height) :

Algorithms 22--23's sibling indices, ordered from the leaf level towards the root.

@[simp]
@[simp]
theorem Cslib.Crypto.MQOM.ancestorNode_succ (node level : ℕ) :
ancestorNode node (level + 1) = ancestorNode node level / 2
theorem Cslib.Crypto.MQOM.ancestorNode_le (node level : ℕ) :
ancestorNode node level ≤ node
theorem Cslib.Crypto.MQOM.ancestorNode_eq_div_pow (node level : ℕ) :
ancestorNode node level = node / 2 ^ level
theorem Cslib.Crypto.MQOM.leafNode_lt {height : ℕ} (leaf : LeafIndex height) :
leafNode leaf < 2 * 2 ^ height
@[simp]
theorem Cslib.Crypto.MQOM.hiddenNode_zero {height : ℕ} (leaf : LeafIndex height) :
hiddenNode leaf 0 = leafNode leaf
theorem Cslib.Crypto.MQOM.hiddenNode_succ {height : ℕ} (leaf : LeafIndex height) (level : Fin height) :
hiddenNode leaf level.succ = hiddenNode leaf level.castSucc / 2

One more source loop iteration moves the hidden node to its parent.

theorem Cslib.Crypto.MQOM.hiddenNode_lt {height : ℕ} (leaf : LeafIndex height) (level : Fin (height + 1)) :
hiddenNode leaf level < 2 * 2 ^ height
theorem Cslib.Crypto.MQOM.siblingNode_pos {height : ℕ} (leaf : LeafIndex height) (level : Fin height) :
0 < siblingNode leaf level

A sibling-path index is nonzero, as required by the source tree array.

theorem Cslib.Crypto.MQOM.siblingNode_lt {height : ℕ} (leaf : LeafIndex height) (level : Fin height) :
siblingNode leaf level < 2 * 2 ^ height

A sibling-path index is at most the final source tree-array index 2N - 1.

theorem Cslib.Crypto.MQOM.siblingNode_parent {height : ℕ} (leaf : LeafIndex height) (level : Fin height) :
siblingNode leaf level / 2 = hiddenNode leaf level.castSucc / 2

The revealed node and the hidden node are the two children of the same parent.

theorem Cslib.Crypto.MQOM.siblingNode_parent_eq_hiddenNode_succ {height : ℕ} (leaf : LeafIndex height) (level : Fin height) :
siblingNode leaf level / 2 = hiddenNode leaf level.succ

After revealing the sibling, the source loop moves the hidden node to their common parent.

theorem Cslib.Crypto.MQOM.siblingNode_ne_hiddenNode {height : ℕ} (leaf : LeafIndex height) (level : Fin height) (hiddenLevel : Fin (height + 1)) :
siblingNode leaf level ≠ hiddenNode leaf hiddenLevel

No sibling-path entry is the challenged leaf or any node on its hidden path.

Validation-oracle transcripts #

@[reducible, inline]
abbrev Cslib.Crypto.MQOM.ValidationPrefix (Coordinate : Type) (width : ℕ) :

A candidate for the k field coordinates in the PGOW-MQ validation oracle.

@[reducible, inline]
abbrev Cslib.Crypto.MQOM.ValidationResponse (Coordinate : Type) (width : ℕ) :
ValidationPrefix Coordinate width → Type

The validation interface returns one Boolean for every candidate prefix.

def Cslib.Crypto.MQOM.validationReply {Coordinate : Type} [DecidableEq Coordinate] {width : ℕ} (secret candidate : ValidationPrefix Coordinate width) :

Definition 2's validation oracle: accept exactly the designated secret prefix.

theorem Cslib.Crypto.MQOM.validationReply_eq_true_iff {Coordinate : Type} [DecidableEq Coordinate] {width : ℕ} {secret candidate : ValidationPrefix Coordinate width} :
validationReply secret candidate = true ↔ candidate = secret
theorem Cslib.Crypto.MQOM.validationReply_eq_false_iff {Coordinate : Type} [DecidableEq Coordinate] {width : ℕ} {secret candidate : ValidationPrefix Coordinate width} :
validationReply secret candidate = false ↔ candidate ≠ secret
def Cslib.Crypto.MQOM.validationTranscript {Coordinate : Type} [DecidableEq Coordinate] {width : ℕ} (secret : ValidationPrefix Coordinate width) (queries : List (ValidationPrefix Coordinate width)) :

The replies to chronological calls, stored newest first as OracleComp.withTranscript does. Wrong and repeated candidates remain present and therefore remain charged queries.

theorem Cslib.Crypto.MQOM.validationTranscript_append {Coordinate : Type} [DecidableEq Coordinate] {width : ℕ} (secret : ValidationPrefix Coordinate width) (earlier later : List (ValidationPrefix Coordinate width)) :
validationTranscript secret (earlier ++ later) = validationTranscript secret later ++ validationTranscript secret earlier

Earlier chronological calls form the suffix of the stored transcript.

theorem Cslib.Crypto.MQOM.validationTranscript_append_singleton {Coordinate : Type} [DecidableEq Coordinate] {width : ℕ} (secret : ValidationPrefix Coordinate width) (queries : List (ValidationPrefix Coordinate width)) (candidate : ValidationPrefix Coordinate width) :
validationTranscript secret (queries ++ [candidate]) = ⟨candidate, validationReply secret candidate⟩ :: validationTranscript secret queries

A newly appended chronological call becomes the head of the stored transcript.

theorem Cslib.Crypto.MQOM.queries_validationTranscript {Coordinate : Type} [DecidableEq Coordinate] {width : ℕ} (secret : ValidationPrefix Coordinate width) (queries : List (ValidationPrefix Coordinate width)) :
List.map (fun (entry : (q : ValidationPrefix Coordinate width) × ValidationResponse Coordinate width q) => entry.fst) (validationTranscript secret queries) = queries.reverse

Forgetting replies recovers the calls in the reverse-chronological storage order.

structure Cslib.Crypto.MQOM.ValidationRun (Coordinate : Type) (width : ℕ) :

The observable part of a PGOW validation run. queries are chronological adversary calls; output is checked by the challenger after those calls.

  • queries : List (ValidationPrefix Coordinate width)

    Chronological validation-oracle calls, including failed and repeated candidates.

  • output : ValidationPrefix Coordinate width

    The final candidate returned to the challenger.

def Cslib.Crypto.MQOM.ValidationRun.transcript {Coordinate : Type} [DecidableEq Coordinate] {width : ℕ} (run : ValidationRun Coordinate width) (secret : ValidationPrefix Coordinate width) :

The exact transcript observable from the run's adversary calls.

def Cslib.Crypto.MQOM.ValidationRun.queryCount {Coordinate : Type} {width : ℕ} (run : ValidationRun Coordinate width) :

The source resource Q: adversary oracle calls, excluding the final challenger check.

def Cslib.Crypto.MQOM.ValidationRun.accepted {Coordinate : Type} [DecidableEq Coordinate] {width : ℕ} (run : ValidationRun Coordinate width) (secret : ValidationPrefix Coordinate width) :

Whether the separately returned final candidate is accepted.

theorem Cslib.Crypto.MQOM.ValidationRun.accepted_eq_true_iff {Coordinate : Type} [DecidableEq Coordinate] {width : ℕ} (run : ValidationRun Coordinate width) (secret : ValidationPrefix Coordinate width) :
run.accepted secret = true ↔ run.output = secret