Helpers shared by NIKE-Sphinx and KEM-Sphinx #
Instances For
Equations
- Cryptlib.Protocols.Sphinx.Common.toVec32 a = Vector.ofFn fun (i : Fin 32) => a.get! ↑i
Instances For
As toVec32, at width n.
Equations
- Cryptlib.Protocols.Sphinx.Common.toVecN n a = Vector.ofFn fun (i : Fin n) => a.get! ↑i
Instances For
toVecN undoes ofVector.
As ofVector_toVecN, at width 32.
Equations
Instances For
Cascading padding (§3.2), at the byte level: XOR-ing the sender's
Rk := xorBytes (riFragment ++ Rk1) riKeyStream against the full keystream ks recovers
riFragment ++ Rk1 in its first ksLen bytes and the next padding in its trailing bytes.
A forIn whose every step leaves φ unchanged leaves it unchanged overall.
A forIn that never exits early and grows φ by k per step grows it by l.length * k.
A forIn over a nonempty list that never exits early and sets ψ to v at every step ends
with ψ = v.
A forIn that never exits early has a trace of intermediate accumulator values.
l.foldl g init has a trace of intermediate accumulator values.
In a sequence of arrays each obtained from the last by one push, index i never changes after
it is written.
Equations
Instances For
Serialize cmds, failing if the result exceeds budget bytes.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A successful commandsToBytes fits within budget.
Appending one command to a successful commandsToBytes call still succeeds, under a large
enough budget.
parseAll undoes commandsToBytes followed by zeroPadTo, given no .null commands.
If every step of a forIn only pushes a ByteArray of size n, and the initial array's
entries all have size n, so do the final array's.