https://github.com/EasyCrypt/easycrypt
Raw File
Tip revision: 723d459c8d5a51439d1d36e0352311b6d127f017 authored by Pierre-Yves Strub on 17 March 2020, 21:17:33 UTC
def. of ring quotients
Tip revision: 723d459
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