Public-key encryption with explicit coins #
This module formalizes public-key encryption PKE = (Gen, Enc, Dec) with an explicit encryption
coin type R, following [HHK17], IACR ePrint 2017/604 (full version dated
2 November 2021), §2.1. Exposing deterministic encryption encDet : PK → M → R → CT lets
transforms such as Fujisaki--Okamoto derive coins from a message and repeat encryption exactly.
ExplicitCoinPKE uses a fixed type R and an arbitrary sampler sampleCoins : ProbComp R, while
HHK17 permits a public-key-dependent randomness space and draws coins uniformly. Its
DeltaCorrect definition preserves the source's expectation over key generation of the
worst-message decryption-failure probability, and GammaSpread likewise generalizes the source's
uniform coin draw to sampleCoins.
IND-CPA security is the two-stage game of HHK17 §2.1, Definition 2.2 / Figure 4: a first stage
receives the public key and chooses two messages and a state, and a second stage receives the state
and an encryption of one of them. toPKE is the randomized scheme (Gen, Enc, Dec) of an
explicit-coin scheme, and cpaAdvantage is its advantage in the shared chosen-plaintext experiment
Cslib.Crypto.PKE.cpaExperiment, with every pair of messages admissible. The advantage is the
two-world difference |Pr[1 | b = 0] - Pr[1 | b = 1]|, which is twice HHK17's hidden-bit
advantage |Pr[b' = b] - 1/2|. The Fujisaki--Okamoto theorems are stated against cpaAdvantage.
indCpaGame and indCpaAdvantage are a narrower, fixed-message experiment: the messages
m₀, m₁ are given before key generation and the adversary is single-stage. Security for every
fixed pair does not give two-stage security, since a two-stage adversary may choose its messages
after seeing the public key. The fixed-message experiment is kept for the spread-necessity example
Cslib.Crypto.Protocols.FujisakiOkamoto.unspreadPointPKE_indCpaAdvantage, a scheme that is secure
for every fixed pair of messages away from one point but not two-stage secure.
Unlike the standard-model bit-string KEM interfaces in Cslib.Crypto.Encryption.KEMINDCPA and
Cslib.Crypto.Encryption.encryptKeyEncaps, this interface retains encryption coins and
deterministic encryption. KEM transforms and their security reductions live in separate modules.
Main definitions #
Cslib.Crypto.Protocols.ExplicitCoinPKE: public-key encryption with explicit deterministic encryption coins.Cslib.Crypto.Protocols.ExplicitCoinPKE.DeltaCorrect: expected worst-messageδ-correctness.Cslib.Crypto.Protocols.ExplicitCoinPKE.GammaSpread:γ-spreadness over sampled coins.Cslib.Crypto.Protocols.ExplicitCoinPKE.toPKE: the randomized public-key encryption scheme.Cslib.Crypto.Protocols.ExplicitCoinPKE.cpaAdvantage: the two-stage IND-CPA advantage.Cslib.Crypto.Protocols.ExplicitCoinPKE.indCpaGame,Cslib.Crypto.Protocols.ExplicitCoinPKE.indCpaAdvantage: the single-stage fixed-message distinguishing experiment and probability-difference advantage.
Main results #
Cslib.Crypto.Protocols.ExplicitCoinPKE.eval_encrypt_eq_toOuterMeasure: the probability of a ciphertext is the probability of the coins that produce it.Cslib.Crypto.Protocols.ExplicitCoinPKE.deltaCorrect_zero_of_perfect: perfect supported decryption implies zero-error correctness.Cslib.Crypto.Protocols.ExplicitCoinPKE.DeltaCorrect.mono: correctness is monotone inδ.
References #
- D. Hofheinz, K. Hövelmanns, E. Kiltz, A Modular Analysis of the Fujisaki--Okamoto Transformation (IACR ePrint 2017/604, full version dated 2 November 2021), §2.1.
A public-key encryption scheme PKE = (Gen, Enc, Dec) with explicit encryption coins r : R
([HHK17], ePrint 2017/604 (2 Nov 2021), §2.1): randomized encryption draws
r ← sampleCoins and evaluates deterministic encryption encDet pk m r, allowing
Fujisaki--Okamoto transforms to derandomize encryption with G(m) : R and perform exact
re-encryption checks. Unlike §2.1's uniform draw from a potentially pk-dependent coin space,
R is a fixed type and sampleCoins : ProbComp R is an arbitrary sampler.
Key generation
(pk, sk) ← keyGen.- sampleCoins : ProbComp R
Encryption coin sampler
r ← sampleCoins. - encDet : PK → M → R → CT
Deterministic encryption
Enc(pk, m; r)with explicit coinsr : R. - dec : SK → CT → Option M
Deterministic decryption
Dec(sk, c) ∈ M ∪ {⊥}.
Randomized encryption Enc(pk, m) drawing fresh coins r ← sampleCoins.
The probability that P.encrypt pk m outputs c is the probability that fresh coins r
satisfy P.encDet pk m r = c.
The randomized public-key encryption scheme (Gen, Enc, Dec) of P: key generation
P.keyGen, encryption P.encrypt with fresh coins, and decryption P.dec.
Two-stage IND-CPA advantage of A against P ([HHK17], ePrint
2017/604 (2 Nov 2021), §2.1, Def. 2.2 / Fig. 4), in the shared chosen-plaintext experiment
PKE.cpaExperiment of P.toPKE with every pair of messages admissible. The first stage of A
receives pk and chooses (m₀, m₁) and a state; the second stage receives the state and an
encryption of m_b, and keeps pk only if the first stage saved it. The advantage is the
two-world difference |Pr[A → 1 | b = 0] - Pr[A → 1 | b = 1]|, which is twice HHK17's hidden-bit
advantage |Pr[b' = b] - 1/2|.
Per-message decryption failure probability Pr_{r ← sampleCoins}[Dec(sk, Enc(pk, m; r)) ≠ m]
for a fixed key pair (pk, sk) and message m ([HHK17], ePrint 2017/604
(2 Nov 2021), §2.1, generalized from uniform coins to sampleCoins).
If Dec(sk, Enc(pk, m; r)) = some m holds for every supported coin r, the message failure
probability at (pk, sk, m) is 0.
Worst-case-over-messages decryption failure probability
max_{m ∈ M} Pr_{r ← sampleCoins}[Dec(sk, Enc(pk, m; r)) ≠ m] for a fixed key pair (pk, sk)
([HHK17], ePrint 2017/604 (2 Nov 2021), §2.1).
HHK17 δ-correctness ([HHK17], ePrint 2017/604 (2 Nov 2021), §2.1,
generalized from uniform coins to sampleCoins): the expectation over (pk, sk) ← keyGen of the
worst-case message decryption failure probability is at most δ:
E_{(pk, sk) ← keyGen}[max_{m ∈ M} Pr_{r ← sampleCoins}[Dec(sk, Enc(pk, m; r)) ≠ m]] ≤ δ.
Monotonicity of DeltaCorrect in the failure bound δ.
A public-key encryption scheme whose supported key pairs and coins never incur decryption
errors is 0-correct (DeltaCorrect P 0).
HHK17 γ-spreadness ([HHK17], ePrint 2017/604 (2 Nov 2021), §2.1,
generalized from uniform coins to sampleCoins): for every supported key pair
(pk, sk) ∈ support(keyGen), message m, and ciphertext c, encryption hits c with
probability at most 2 ^ (-γ) over fresh coins r ← sampleCoins.
Single-challenge fixed-message IND-CPA experiment for ExplicitCoinPKE: on bit false the
challenger encrypts m₀, and on bit true it encrypts m₁. Unlike [HHK17]
(ePrint 2017/604 (2 Nov 2021), §2.1, Def. 2.2 / Fig. 4), where a first-stage adversary receives
pk and chooses (m₀, m₁) with state, (m₀, m₁) are fixed caller-supplied messages independent
of pk. The two-stage notion is cpaAdvantage.
Single-challenge fixed-message IND-CPA probability-difference advantage
|Pr[indCpaGame m₀ m₁ false = true] - Pr[indCpaGame m₀ m₁ true = true]| via Game.advantage
(whereas [HHK17], ePrint 2017/604 (2 Nov 2021), §2.1, Def. 2.2 / Fig. 4
defines |Pr[b' = b] - 1/2| in a two-stage key-dependent-message guessing game).