Commit 97a94ca2 authored by Stephane Glondu's avatar Stephane Glondu

Remove GROUP parameter of MakeSimpleMonad, renamed to DirectRandom

parent 7c6071f6
......@@ -33,9 +33,9 @@ let question_length q =
| Some true -> 1
| _ -> 0
(** Simple monad *)
(** Direct random monad *)
module MakeSimpleMonad (G : GROUP) = struct
module DirectRandom = struct
type 'a t = unit -> 'a
let return x () = x
let bind x f = f (x ())
......
......@@ -27,7 +27,7 @@ open Signatures
val question_length : question -> int
module MakeSimpleMonad (G : GROUP) : sig
module DirectRandom : sig
(** {2 Monadic definitions} *)
......@@ -40,7 +40,7 @@ module MakeSimpleMonad (G : GROUP) : sig
random number generator lazily initialized by a 128-bit seed
shared by all instances. *)
end
(** Simple election monad that keeps all ballots in memory. *)
(** Direct random monad *)
module MakeElection (G : GROUP) (M : RANDOM) :
ELECTION with type elt = G.t and type 'a m = 'a M.t
......
......@@ -178,7 +178,7 @@ module Ttkeygen : CMDLINER_MODULE = struct
in
let group = get_mandatory_opt "--group" group |> string_of_file in
let module G = (val Group.of_string group : GROUP) in
let module M = Election.MakeSimpleMonad (G) in
let module M = Election.DirectRandom in
let module P = Trustees.MakePKI (G) (M) in
let module C = Trustees.MakeChannels (G) (M) (P) in
let module T = Trustees.MakePedersen (G) (M) (P) (C) in
......
......@@ -52,7 +52,7 @@ let parse_params p =
module Make (P : PARSED_PARAMS) : S = struct
open P
module CG = Credential.MakeGenerate (Election.MakeSimpleMonad (G))
module CG = Credential.MakeGenerate (Election.DirectRandom)
module CD = Credential.MakeDerive (G)
let derive x =
......
......@@ -59,7 +59,7 @@ let parse_params p =
module Make (P : PARSED_PARAMS) : S = struct
open P
module M = Election.MakeSimpleMonad(G)
module M = Election.DirectRandom
module E = Election.MakeElection(G)(M);;
module KG = Trustees.MakeSimpleDistKeyGen (G) (M)
......
......@@ -67,7 +67,7 @@ let compute_partial_decryption _ =
Js.Opt.option !election >>= fun e ->
let election = Group.election_params_of_string e in
let module P = (val election) in
let module M = Election.MakeSimpleMonad (P.G) in
let module M = Election.DirectRandom in
let module E = Election.MakeElection (P.G) (M) in
Js.Opt.option !encrypted_tally >>= fun e ->
let encrypted_tally = encrypted_tally_of_string P.G.read e in
......
......@@ -66,9 +66,7 @@ let parse_params p =
module Make (P : PARSED_PARAMS) : S = struct
open P
(* Setup group *)
module M = Election.MakeSimpleMonad(G);;
module M = Election.DirectRandom
(* Setup trustees *)
......
......@@ -47,9 +47,7 @@ let parse_params p =
module Make (P : PARSED_PARAMS) : S = struct
open P
(* Setup group *)
module M = Election.MakeSimpleMonad(G);;
module M = Election.DirectRandom
(* Generate key *)
......
......@@ -112,7 +112,7 @@ let verifydiff dir1 dir2 =
(* the public keys / threshold parameters must be valid *)
let module ED = (val Group.election_params_of_string election) in
let open ED in
let module M = Election.MakeSimpleMonad (G) in
let module M = Election.DirectRandom in
let module E = Election.MakeElection (G) (M) in
let y =
match threshold with
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment