Asymmetric Encryption Schemes. #
This file defines a type AsymmEncAlg spec M PK SK C
to represent an protocol
for asymmetric encryption using oracles in spec
, with message space M
,
public/secret keys PK
and SK
, and ciphertext space C
.
An AsymmEncAlg
with message space M
, key spaces PK
and SK
, and ciphertexts in C
.
spec
is the available oracle set and m
is the monad used to execute the oracle calls.
Extends ExecutionMethod spec m
, in most cases will be ExecutionMethod.default
.
- keygen : m (PK × SK)
- encrypt (pk : PK) (msg : M) : m C
Instances For
Alias of AsymmEncAlg
.
An AsymmEncAlg
with message space M
, key spaces PK
and SK
, and ciphertexts in C
.
spec
is the available oracle set and m
is the monad used to execute the oracle calls.
Extends ExecutionMethod spec m
, in most cases will be ExecutionMethod.default
.
Equations
Instances For
A SymmEncAlg
is complete if decrypting an encrypted message always returns that original
message, captured here by a guard
statement.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- encAlg.PerfectlyCorrect = ∀ (msg : M), [⊥|encAlg.CorrectExp msg] = 0
Instances For
Instances For
Equations
- encAlg.IND_CPA_adversary = (PK → OracleComp encAlg.IND_CPA_oracleSpec Bool)
Instances For
Can be shown this is equivalent to below definition for asymptotic security.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- AsymmEncAlg.IND_CPA_advantage adversary = [=()|AsymmEncAlg.IND_CPA_experiment adversary] - 1 / 2
Instances For
The probability of the IND-CPA experiment is the average of the probability of the experiment with the challenge being true and the probability of the experiment with the challenge being false.
Oracle that uses a secret key to respond to decryption requests.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Two oracles for IND-CCA Experiment, the first for decrypting ciphertexts, and the second for getting a challenge from a pair of messages.
Instances For
Implement oracles for IND-CCA security game. A state monad is to track the current challenge, if it exists, and is set by the adversary calling the second oracle. The decryption oracle checks to make sure it doesn't decrypt the challenge.
Equations
- One or more equations did not get rendered due to their size.
Instances For
- main : PK → OracleComp encAlg.IND_CCA_oracleSpec Bool
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
IND_CPA_adv M PK C
is an adversary for IND-CPA security game on an
asymmetric encryption with public keys in PK
, messages in M
, and ciphertexts in C
.
The adversary consists of two functions:
chooseMessages
: given a public key, returns a pair of messages that it thinks it can distinguish the encryption of, and a private state.distinguish
: given a private state and an encryption, returns whether it is an encryption of the first message or the second message
- State : Type
Instances For
Experiment for one-time IND-CPA security of an asymmetric encryption algorithm:
- Run
keygen
to get a public key and a private key. - Run
adv.chooseMessages
onpk
to get a pair of messages and a private state. - The challenger then tosses a coin and encrypts one of the messages, returning the ciphertext
c
. - Run
adv.distinguish
on the private state and the ciphertext to get a boolean. - Return a Boolean indicating whether the adversary's guess is correct.
Note: we do not want to end with a guard
statement, as this can be biased by the adversary
potentially always failing.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- encAlg.IND_CPA_OneTime_Advantage adv = (AsymmEncAlg.IND_CPA_OneTime_Game adv).advantage'