https://github.com/EasyCrypt/easycrypt
Raw File
Tip revision: f47fb5394d471bb609b84ab7140bc0164d1fa2a3 authored by Cécile BARITEL-RUET on 26 November 2019, 07:51:24 UTC
better with the files
Tip revision: f47fb53
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