https://github.com/EasyCrypt/easycrypt
Raw File
Tip revision: d3179246f8365b8ee7b73167a12e954f2bdfeb91 authored by Benjamin Gregoire on 14 December 2022, 09:56:45 UTC
Merge branch 'main' into deploy-quantum
Tip revision: d317924
Indistinguishability.eca
type t_in, t_out.

module type Oracle = {
  proc f (_: t_in) : t_out
}.

module type Function = {
  proc init () : unit
  proc f (_: t_in) : t_out
}.

module type Distinguisher (O : Oracle) = {
  proc guess () : bool
}.

module Distinguish (D : Distinguisher) (O : Function) = {
  proc game () : bool = {
    var b;
    
    O.init();
    b <@ D(O).guess();
    return b;
  }
}.
back to top