Garbling labels from a length-preserving pseudorandom function #
The point-and-permute garbling of CslibFrontier.Crypto.Primitives.Garbling.Basic masks its
tables with a keyed function F : K → T → K × Bool that sends a wire key and a tweak to a
label, a key together with a colour bit. A length-preserving PRF has one bit too few for this.
PRF.label F builds such a function from a keyed function F on (n + 1)-bit strings with two
calls: the label of an n-bit tweak t under key k is F k (0 ‖ t) together with the first
bit of F k (1 ‖ t).
It is exactly as secure as F (PRF.advantage_label): an adversary against PRF.label F has the
same finite PRF advantage as the adversary against F that answers each of its label queries with
the two calls. On the ideal side, reading a uniform function on (n + 1)-bit strings at 0 ‖ t
and the first bit at 1 ‖ t gives a uniform function from tweaks to labels, because this reading
is a surjective additive map.
On words, a label distinguisher is an OracleDistinguisher that sends n-bit tweaks and reads
(n + 2)-bit replies, a key's bits followed by the colour bit (labelCodec n). The reduction
labelReduction W runs W at parameter n against a PRF oracle at parameter n + 1 and answers
each tweak with the two calls. It is oracle PPT whenever W is (isOraclePPT_labelReduction), and
its word PRF advantage at n + 1 is W's label advantage at n (advantage_label_atLevel). So
the label function of a PseudorandomFunction is pseudorandom against every oracle-PPT label
distinguisher (PseudorandomFunction.indistinguishable_label).
The two-call construction is the standard way to lengthen the output of a PRF; the statements and proofs are this library's.
Main definitions #
Cslib.Crypto.PRF.label,Cslib.Crypto.PRF.labelQuery: the label function of a keyed function on(n + 1)-bit strings, and the two calls that answer one label query.Cslib.Crypto.labelCodec: labels on the word channel.Cslib.Crypto.labelReduction: the PRF distinguisher built from a label distinguisher.
Main results #
Cslib.Crypto.PRF.advantage_label: the label function is exactly as secure as the keyed function.Cslib.Crypto.isOraclePPT_labelReduction: the reduction is uniform strict oracle PPT.Cslib.Crypto.advantage_label_atLevel: the reduction's word PRF advantage is the label advantage of the label distinguisher.Cslib.Crypto.PseudorandomFunction.indistinguishable_label: the label function of a PRF is pseudorandom.
The label function is exactly as secure as the keyed function. The finite PRF advantage of
A against PRF.label F is the advantage against F of A with each label query answered by
the two calls labelQuery.
Labels on words #
The PRF distinguisher built from a label distinguisher W: at parameter m it runs W at
parameter m - 1 and answers each (m - 1)-bit tweak t with two calls to its own oracle, the
first m bits of the reply to 0 ‖ t followed by the first bit of the reply to 1 ‖ t. Any other
request of W is answered by the empty word, without a query.
Efficiency #
Efficiency of the reduction. For every uniform strict oracle-PPT label distinguisher W,
labelReduction W is uniform strict oracle PPT.
Security #
The reduction's advantage is the label advantage. For a length-preserving family, the word
PRF advantage of labelReduction W at parameter n + 1 is the finite PRF advantage of the label
distinguisher W, read through labelCodec n, against the label function of family at
parameter n + 1.
The label function of a pseudorandom function is pseudorandom. For every uniform strict
oracle-PPT label distinguisher W, its finite PRF advantage at parameter n, read through
labelCodec n, against the label function of family at parameter n + 1 is negligible.