[
[
['8','add','hl'],
['188','add','hl'],
['181','add','hl'],
['178','add','hl'],
['190','add','hl'],
['175','add','hl'],
['189','add','hl'],
['28','remove','slide-up'],
['2','add','slide-down']
],
[
['33','add','hl'],
['33','remove','hidden'],
['9','remove','indent-1'],
['10','remove','indent-1'],
['36','add','hl'],
['36','remove','hidden'],
['182','add','hl'],
['182','remove','slide-left'],
['179','add','hl'],
['179','remove','slide-left'],
['176','add','hl'],
['176','remove','slide-left'],
['4','add','hidden'],
['8','remove','hl'],
['8','add','hidden'],
['9','add','indent-2'],
['10','add','indent-2'],
['188','remove','hl'],
['188','add','slide-left'],
['181','remove','hl'],
['181','add','slide-right'],
['178','remove','hl'],
['178','add','slide-right'],
['190','remove','hl'],
['190','add','slide-right'],
['175','remove','hl'],
['175','add','slide-right'],
['189','remove','hl'],
['189','add','slide-right']
],
[
['33','remove','hl'],
['36','remove','hl'],
['182','remove','hl'],
['179','remove','hl'],
['176','remove','hl'],
['184','add','hl'],
['54','remove','slide-up'],
['28','add','slide-down']
],
[
['185','add','hl'],
['185','remove','slide-left'],
['63','add','hl'],
['63','remove','hidden'],
['64','add','hl'],
['64','remove','hidden'],
['80','add','hl'],
['80','remove','hidden'],
['81','add','hl'],
['81','remove','hidden'],
['82','add','hl'],
['82','remove','hidden'],
['184','remove','hl'],
['184','add','slide-right']
],
[
['185','remove','hl'],
['63','remove','hl'],
['64','remove','hl'],
['80','remove','hl'],
['81','remove','hl'],
['82','remove','hl'],
['10','add','hl'],
['187','add','hl'],
['85','remove','slide-up'],
['54','add','slide-down']
],
[
['184','add','hl'],
['184','remove','slide-right'],
['188','add','hl'],
['188','remove','slide-left'],
['10','remove','hl'],
['10','add','hidden'],
['187','remove','hl'],
['187','add','slide-right']
],
[
['184','remove','hl'],
['188','remove','hl'],
['179','add','hl'],
['176','add','hl'],
['115','remove','slide-up'],
['85','add','slide-down']
],
[
['178','add','hl'],
['178','remove','slide-right'],
['190','add','hl'],
['190','remove','slide-right'],
['175','add','hl'],
['175','remove','slide-right'],
['189','add','hl'],
['189','remove','slide-right'],
['179','remove','hl'],
['179','add','slide-right'],
['176','remove','hl'],
['176','add','slide-right']
],
[
['178','remove','hl'],
['190','remove','hl'],
['175','remove','hl'],
['189','remove','hl'],
['5','add','hl'],
['6','add','hl'],
['9','add','hl'],
['64','add','hl'],
['145','remove','slide-up'],
['115','add','slide-down']
],
[
['147','remove','hidden'],
['152','add','hl'],
['152','remove','hidden'],
['170','add','hl'],
['170','remove','hidden'],
['171','add','hl'],
['171','remove','hidden'],
['5','remove','hl'],
['5','add','hidden'],
['6','remove','hl'],
['6','add','hidden'],
['9','remove','hl'],
['9','add','hidden'],
['64','remove','hl'],
['64','add','hidden']
],
[
['152','remove','hl'],
['170','remove','hl'],
['171','remove','hl']
]
]
The starting point is $\lib{prf-real+ro}$.
We can introduce a cache in $\prfquery$ to avoid recomputing the same thing twice. We can also change $\Pi^\pm$ to sample their outputs with replacement; the change has negligible effect. Because of this change, the sets $\mathcal{A}$ and $\mathcal{B}$ are no longer used anywhere, but we retain them for a later hybrid.\FORMATTINGHACK{\pagebreak}
We can change $\prfquery$ to sample $V$ uniformly instead of calling $\Pi^+(U)$. This changes the library's behavior \emph{only if} at the end of the execution $U \in \mathcal{A}$, meaning that $U$ was the input to some direct call to $\Pi^+$ or output of some direct call to $\Pi^-$. We trigger a bad event in this case, and will later show that its probability is negligible.\FORMATTINGHACK{\pagebreak}
$\prftable[X]$ now plays the role of a OTP ciphertext, interpreting $V$ as the uniformly sampled key. Thus, it is distributed uniformly.
We can change $\Pi^+$ and $\Pi^-$ back to their original implementation, sampling their outputs without replacement.
Every $U$ value has the form $U = X \oplus \key$. So instead of keeping track of $U$-values, we can keep track of just $X$-values and recompute the $U$-values later when determining the bad event. That way, $\key$ is not needed until the end of time. The result is $\lib{prf-rand+ro}$, with extra bad-event logic at the end of time.\FORMATTINGHACK{\pagebreak}
$\lib{prf-real+ro}$
$\key \gets \bits^\secpar$
$\lib{prf-rand+ro}$
if $\prftable[X]$ undefined:
$U := \key \oplus X$
$V $
${}:= \Pi^+(U)$
${}\gets \bits^\secpar$
$\prftable[X] $
${}:= V \oplus \key$
${}\gets \bits^\secpar$
$\mathcal{U} := \mathcal{U} \cup \{U\}$
$\mathcal{X} := \mathcal{X} \cup \{X\}$
return
$V \oplus \key$
$\prftable[X]$
if $\iptable^+[A]$ undefined:
$B \gets \bits^\secpar$
${} \setminus \mathcal{B}$
$$
${} \setminus \mathcal{B}$
$\iptable^+[A] := B; \mathcal{A} := \mathcal{A} \cup \{ A \}$
$\iptable^-[B] := A; \mathcal{B} := \mathcal{B} \cup \{ B \}$
return $\iptable^+[A]$
if $\iptable^-[B]$ undefined:
$A \gets \bits^\secpar$
${} \setminus \mathcal{A}$
$$
${} \setminus \mathcal{A}$
$\iptable^+[A] := B; \mathcal{A} := \mathcal{A} \cup \{ A \}$
$\iptable^-[B] := A; \mathcal{B} := \mathcal{B} \cup \{ B \}$
return $\iptable^-[B]$
$\key \gets \bits^\secpar$
$\mathcal{U} := \{ X \oplus \key \mid X \in \mathcal{X} \}$
if $\mathcal{U} \cap \mathcal{A} \ne \emptyset$: $\badvar := \mytrue$