https://github.com/EasyCrypt/easycrypt
Raw File
Tip revision: ac3cc65da89ee48f1c4ea07f14d0f0de700f3cb2 authored by Lionel Blatter on 05 April 2024, 13:22:05 UTC
Add zify tactic
Tip revision: ac3cc65
PRG.eca
type output.
op dout:output distr.

module type RG = {
  proc init(): unit
  proc next(): output
}.

module type RGA = { proc next(): output }.

module type Distinguisher(G:RGA) = { proc distinguish(): bool }.

module IND(G:RG,D:Distinguisher) = {
  module D = D(G)

  proc main(): bool = {
    var b;

    G.init();
    b <@ D.distinguish();
    return b;
  }
}.

module PRGi:RG,RGA = {
  proc init(): unit = { }
  proc next(): output = { var r; r <$ dout; return r; }
}.

(** Advantage of a distinguisher against a PRG G:
      Adv_G(D) = `|IND(G,D) - IND(PRGi,D)|        **)
back to top