Functional encryption schemes and their semantic-security experiment #
A functional encryption scheme FE MPK MSK Fn SK M C Y has typed master public keys, master secret
keys, function identifiers, secret keys for functions, messages, ciphertexts and outputs
([BS23], Section 15.7, Definition 15.13, pp. 658–659). Setup, key generation for a
function identifier, and encryption are probabilistic programs; decryption is deterministic and
returns Option Y. A functionality FE.Functionality Fn M Y pairs the evaluation map
eval : Fn → M → Option Y (where none represents the book's special symbol ⊥) with the
distinguished null identifier null : Fn (ε in [BS23], Section 15.7, p. 660) whose
secret key captures the intentional leakage of a ciphertext.
FE.Correct (Definition 15.13, p. 659) requires that whenever F.eval f m = some y, decryption of
any honest encryption of m under any key generated for f yields some y. FE.Robust
(Definition 15.15, p. 661) requires that for every supported master key pair and every ciphertext
c, there is a message m such that whenever E.decrypt sk c = some y for a key sk generated
for f and F.eval f m = some y', the two outputs y and y' agree.
FE.ssExperiment is experiment b of the single-challenge semantic-security game for one fixed
scheme ([BS23], Section 15.7, Attack Game 15.9, pp. 660–661): draw (mpk, msk), generate
a null key skNull ← E.keyGen msk F.null, run both stages of an FE.Adversary against the logging
key-generation oracle E.keyGen msk flanking a single challenge encryption of pair.select b, and
accept the adversary's guess only when F.admissible holds on the logged function identifiers and
F.null.
When the null function F.eval F.null is injective, the admissibility check forces msg₀ = msg₁
on every accepting run, so the two experiments of Attack Game 15.9 have identical output
distributions and advantage 0 for every scheme and every adversary ([BS23], Section
15.7, Remark 15.13, p. 661). In particular, the cleartext scheme FE.cleartext F (ciphertext equal
to the message and secret key equal to the function identifier) is both Correct and Robust for
every functionality F and has semantic-security advantage 0 whenever F.eval F.null is
injective.
For a public-key encryption scheme E : PKE PK SK M C and ciphertext-leakage function
leak : C → L, E.toFE leak is the functional encryption scheme of Example 15.1
([BS23], Section 15.7, p. 659, equation (15.33), and p. 660): some () is the identity
function identifier I whose secret key is some sk, and none is the null identifier ε whose
key none is public and evaluates leak on the ciphertext. E.toFE leak is correct for
FE.Functionality.pke len if and only if E is correct and leak c = len m on every honest
ciphertext c of m (PKE.toFE_correct_iff). Against an adversary that makes no key-generation
queries (FE.Adversary.ofTwoStage A), the semantic-security experiment of E.toFE leak for
FE.Functionality.pke len has the same output distribution as the chosen-plaintext experiment
E.cpaExperiment with admissibility rule len m₀ = len m₁
(PKE.eval_ssExperiment_toFE_ofTwoStage).
Design decisions and deviations from [BS23], Section 15.7:
- Both
F.evalandE.decryptreturnOption Y, whereYis the book's output set without⊥:nonerepresents⊥inF.evaland represents both⊥andrejectinE.decrypt. This does not affectFE.CorrectorFE.ssExperiment. ForFE.Robust, a scheme that is robust in the book's sense (with both⊥andrejectmapped tonone) satisfiesFE.Robust, whereas the converse can fail for a scheme whose decryption outputs⊥where the functionality has a value; a scheme whose decryption never outputs⊥loses nothing. - The challenger enforces the query restriction at the end of the experiment by returning
guess && F.admissible ((log₁ ++ log₂).map Prod.fst) pair, so an inadmissible run returnsfalsein both experiments (matchinglrExperiment), because a post-challenge key query in stage 2 can violate the restriction on the challenge pair. - The adversary makes a single challenge encryption query between its two stages (
chooseandguess), matching the book's restriction to a single encryption query. - The null identifier
null : Fn(ε) is bundled inFE.Functionality;FE.CorrectandFE.Robustdo not depend onnull, whileFE.ssExperimentgeneratessk_εfrom it and includes it inFE.Functionality.admissible. - Remark 15.13 (
FE.eval_ssExperiment_eq_of_injective_nullandFE.advantage_ssExperiment_eq_zero_of_injective_null) is proved under the hypothesis thatF.eval F.nullis injective, for every scheme and every adversary without assuming one-wayness or an asymptotic security definition. - The Remark 15.13 scheme is named
FE.cleartextrather thantrivialbecause Exercise 15.21 ("The trivial functional encryption scheme", p. 679) refers to a different construction. - In Example 15.1 (
FE.Functionality.pkeandPKE.toFE), the two-element identifier set{I, ε}is modeled asOption Unit(some ()forI,noneforε), the output type isM ⊕ Lso that the message and its leakagelen mhave disjoint tags, and the secret-key type isOption SK. - As in
PKE,FEandFE.Adversaryare typed records for one fixed scheme without an asymptotic security parameter or efficiency predicate;FE.Adversary.ofTwoStageandPKE.eval_ssExperiment_toFE_ofTwoStagecompare the two experiments and carry no efficiency claim or security reduction. - The key-generation field is named
keyGenafter the book's key generation algorithmG.
Not formalized here: Definition 15.14 as an asymptotic security predicate over scheme families and
efficient typed oracle adversaries (#4894), a security reduction between PKE.toFE and IND-CPA,
Example 15.2 (identity-based encryption as functional encryption, equation (15.34), p. 659),
Exercises 15.21 and 15.22 (pp. 679–681), the concrete functionality families of Section 15.7.1,
chosen-ciphertext security for functional encryption (pp. 661–662), and multi-challenge encryption
queries.
Main definitions #
Cslib.Crypto.FE: a functional encryption scheme with typed keys, function identifiers, messages, ciphertexts and outputs.Cslib.Crypto.FE.Functionality: a functionalityFn → M → Option Ybundled with its null identifiernull : Fn.Cslib.Crypto.FE.Correct: correctness on every(f, m)where the functionality evaluates tosome y.Cslib.Crypto.FE.Robust: ciphertext consistency across function keys whenever both decryption and the functionality returnsome.Cslib.Crypto.FE.Adversary: a two-stage adversary whose stages query the key-generation oracle.Cslib.Crypto.FE.Functionality.admissible,Cslib.Crypto.FE.ssExperiment: the query restriction and experimentbof Attack Game 15.9.Cslib.Crypto.FE.cleartext: the cleartext functional encryption scheme of Remark 15.13.Cslib.Crypto.FE.Functionality.pke,Cslib.Crypto.PKE.toFE: the public-key functionality (15.33) and the functional encryption view of aPKEscheme (Example 15.1).Cslib.Crypto.FE.Adversary.ofTwoStage: aTwoStageadversary lifted to anFE.Adversarythat makes no key-generation queries.
Main results #
Cslib.Crypto.FE.eval_ssExperiment_eq_of_injective_null,Cslib.Crypto.FE.advantage_ssExperiment_eq_zero_of_injective_null: whenF.eval F.nullis injective, the two semantic-security experiments have identical output distributions and advantage0for every scheme and adversary (Remark 15.13).Cslib.Crypto.FE.cleartext_correct,Cslib.Crypto.FE.cleartext_robust: the cleartext scheme is correct and robust for every functionality.Cslib.Crypto.FE.advantage_ssExperiment_pke_eq_zero: specialization of Remark 15.13 toFE.Functionality.pke πfor an injective leakage mapπ.Cslib.Crypto.PKE.toFE_correct_iff:E.toFE leakis correct forFE.Functionality.pke leniffEis correct andleakagrees withlenon all honest ciphertexts.Cslib.Crypto.PKE.eval_ssExperiment_toFE_ofTwoStage: againstFE.Adversary.ofTwoStage A, the semantic-security experiment ofE.toFE leakhas the same output distribution asE.cpaExperimentwith admissibility rulelen m₀ = len m₁.
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Section 15.7 (Definitions 15.13 and 15.15, Attack Game 15.9, Example 15.1, Remark 15.13, pp. 658–661).
A functional encryption scheme ([BS23], Section 15.7, Definition 15.13, pp. 658–659)
with master public keys MPK, master secret keys MSK, function identifiers Fn, function secret
keys SK, messages M, ciphertexts C and outputs Y. Both the functionality's ⊥ and
decryption rejection are represented by none : Option Y.
Setup algorithm
S: draw a master public key and a master secret key.- keyGen : MSK → Fn → ProbComp SK
Key generation algorithm
G: derive a secret key for function identifierffrom the master secret key. - encrypt : MPK → M → ProbComp C
Encryption algorithm
E: encrypt a message under the master public key. - decrypt : SK → C → Option Y
Deterministic decryption algorithm
D: evaluate a function secret key on a ciphertext, returningnonefor⊥or rejection.
A functionality F : Fn × M → Y ∪ {⊥} (none is ⊥) bundled with its distinguished null
function identifier null (ε), whose secret key is given to every party to model intentional
ciphertext leakage ([BS23], Section 15.7, Definition 15.13, p. 658, and p. 660).
- eval : Fn → M → Option Y
Evaluate function identifier
fon messagem;nonerepresents⊥(decryption is unconstrained). - null : Fn
The null function identifier
εwhose secret keysk_εis public.
Correctness of a functional encryption scheme for a functionality F ([BS23],
Section 15.7, Definition 15.13, p. 659): for every supported master key pair, every function
identifier f, every message m and every output y with F.eval f m = some y, decrypting any
supported encryption of m under any supported key for f yields some y.
Robustness of a functional encryption scheme for a functionality F ([BS23],
Section 15.7, Definition 15.15, p. 661): for every supported master key pair and every ciphertext
c, there is a message m such that for every function identifier f and every supported secret
key sk for f, if E.decrypt sk c = some y and F.eval f m = some y', then y = y'.
Because E.decrypt uses none for both ⊥ and reject, the book's robustness implies
FE.Robust; the converse fails for a scheme whose decryption outputs ⊥ where the functionality
has a value (a scheme whose decryption never outputs ⊥ loses nothing).
An adversary in the single-challenge semantic-security game for functional encryption
([BS23], Section 15.7, Attack Game 15.9, pp. 660–661). Both stages are oracle programs
over the key-generation oracle Fn → SK: choose receives the master public key and a null key
sk_ε and outputs a challenge message pair together with state σ; guess receives that state
and the challenge ciphertext and outputs a Boolean guess.
Stage 1: given
mpkandsk_ε, query the key-generation oracle and output a challenge message pair and saved state.- guess : σ → C → ProbOracleComp (fun (x : Fn) => SK) Bool
Stage 2: given the saved state and challenge ciphertext, query the key-generation oracle and output a Boolean guess.
The query restriction of Attack Game 15.9 ([BS23], Section 15.7, p. 660): the null
identifier F.null (ε) and every queried function identifier in queried agree on pair.msg₀
and pair.msg₁.
Experiment b of Attack Game 15.9 ([BS23], Section 15.7, pp. 660–661) for a single
encryption query: generate (mpk, msk) and the null key skNull ← E.keyGen msk F.null, run
A.choose mpk skNull and A.guess state challenge against the logged key-generation oracle
E.keyGen msk around the challenge encryption of pair.select b, and return guess gated by
F.admissible on all queried function identifiers and F.null.
If the null function F.eval F.null distinguishes pair.msg₀ from pair.msg₁, then pair is
inadmissible under Attack Game 15.9 ([BS23], Section 15.7, p. 660) regardless of which
key queries were made.
If the null function F.eval F.null is injective, the two experiments of Attack Game 15.9 have
the same output distribution for every scheme and every adversary, because any admissible challenge
pair must satisfy msg₀ = msg₁ ([BS23], Section 15.7, Remark 15.13, p. 661).
If the null function F.eval F.null is injective, every adversary has semantic-security
advantage 0 against every functional encryption scheme for F ([BS23], Section 15.7,
Remark 15.13, p. 661).
Remark 15.13: the cleartext scheme #
The cleartext scheme cleartext F is correct for every functionality F ([BS23],
Section 15.7, Definition 15.13 and Remark 15.13, pp. 659, 661).
The cleartext scheme cleartext F is robust for every functionality F ([BS23],
Section 15.7, Definition 15.15 and Remark 15.13, p. 661).
Example 15.1: public-key encryption #
The public-key encryption functionality of [BS23], Section 15.7, Example 15.1,
equation (15.33), p. 659, extended with the null identifier of p. 660: some () is the identity
identifier I returning Sum.inl m, and none is the null identifier ε returning the message
leakage Sum.inr (len m).
When the null leakage π in Functionality.pke π is injective, every adversary has
semantic-security advantage 0 against every scheme for Functionality.pke π ([BS23],
Section 15.7, Remark 15.13, p. 661).
Lift a TwoStage chosen-plaintext adversary to an FE.Adversary that ignores the null key and
makes no key-generation queries ([BS23], Section 15.7, Example 15.1 and Attack Game 15.9,
pp. 659–661). This checks the new game against the chosen-plaintext experiment already in the
library; it is not a reduction, carries no efficiency claim, and closes no security item.
View a public-key encryption scheme E as a functional encryption scheme ([BS23],
Section 15.7, Example 15.1, p. 659, and p. 660): the full key for some () is some sk, which
decrypts with E.decrypt sk, and the null key for none is none, which reads leak c off the
ciphertext.
E.toFE leak is a correct functional encryption scheme for FE.Functionality.pke len if and
only if E is a correct public-key scheme and leak c = len m for every honestly generated key
pair and every honest encryption c of m ([BS23], Section 15.7, Definition 15.13 and
Example 15.1, p. 659, and p. 660).
Played against an adversary FE.Adversary.ofTwoStage A that makes no key-generation queries,
Attack Game 15.9 for E.toFE leak and FE.Functionality.pke len has the same output distribution
as Attack Game 11.1 (E.cpaExperiment) with admissibility rule len m₀ = len m₁
([BS23], Section 15.7, Example 15.1 and Attack Game 15.9, pp. 659–661, and Section 11.2,
Attack Game 11.1, p. 436). This checks the new game against the chosen-plaintext experiment already
in the library; it is not a reduction, carries no efficiency claim, and closes no security item.