lambda-uc-0.1.0.0
Safe HaskellSafe
LanguageGHC2021

LambdaUC.Games.SymEncryption

Synopsis

Documentation

data SymEncryptionScheme key mes ciph s #

Constructors

SymEncryptionScheme 

Fields

  • symEKey :: forall m. MonadRand m => m key
     
  • symEEnc :: forall m. MonadRand m => key -> mes -> s -> m (Maybe (s, ciph))

    Probabilistic, stateful computation that may fail,

    This is equivalent to `key -> mes -> StateT s (MaybeT m) ciph`.

  • symEDec :: key -> ciph -> Maybe mes

    Deterministic, stateless computation that may fail

type SpSymEncryptionScheme key mes ciph s = Integer -> SymEncryptionScheme key mes ciph s #

data EncDecReq mes ciph #

Constructors

EncReq mes 
DecReq ciph 

data EncDecResp mes ciph #

Constructors

EncResp ciph 
DecResp mes 
RespError 

type EncDecIface mes ciph = EncDecReq mes ciph :> EncDecResp mes ciph #

type AdvAlgo mes ciph = OracleCaller '[EncDecIface mes ciph] Bool #

advantageIndCca2 #

Arguments

:: forall key mes ciph s. (UniformDist mes, Default s) 
=> Integer

Security parameter

-> SpSymEncryptionScheme key mes ciph s

Encryption scheme

-> (Integer -> AdvAlgo mes ciph)

Adversary

-> Rational 

advantageIndCca3 #

Arguments

:: forall key mes ciph s. (UniformDist mes, Default s) 
=> Integer

Security parameter

-> SpSymEncryptionScheme key mes ciph s

Encryption scheme

-> (Integer -> AdvAlgo mes ciph)

Adversary

-> Rational 

Authenticated Encryption formulated as a form of Indistinguishability under Chosen Ciphertext Attack, see https://eprint.iacr.org/2004/272

TODO: implement without-loss-of-generality logic for the adversary here

oracleEncDec :: SymEncryptionScheme key mes ciph s -> key -> s -> Oracle (EncDecIface mes ciph) () #

oracleEncRandNoDec :: UniformDist mes => SymEncryptionScheme key mes ciph s -> key -> s -> Oracle (EncDecIface mes ciph) () #

oracleEncRandDec :: UniformDist mes => SymEncryptionScheme key mes ciph s -> key -> s -> Oracle (EncDecIface mes ciph) () #