https://github.com/EasyCrypt/easycrypt
Raw File
Tip revision: 8e47fe3d10d154d0653552a905fee3a3113265d4 authored by Pierre-Yves Strub on 03 December 2021, 16:11:39 UTC
Fix bug that prevents `rewrite //= in h` to simplify in `h`
Tip revision: 8e47fe3
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