Commit a8af9c7c authored by Stephane Glondu's avatar Stephane Glondu

s/MakeSimpleDistKeyGen/MakeSimple/g

parent e6f7fd69
......@@ -30,7 +30,7 @@ let check_modulo p x = Z.(geq x zero && lt x p)
(** Distributed key generation *)
module MakeSimpleDistKeyGen (G : GROUP) (M : RANDOM) = struct
module MakeSimple (G : GROUP) (M : RANDOM) = struct
open G
open M
......@@ -189,7 +189,7 @@ module MakePedersen (G : GROUP) (M : RANDOM)
open G
let (>>=) = M.bind
module K = MakeSimpleDistKeyGen (G) (M)
module K = MakeSimple (G) (M)
let compute_verification_keys coefexps =
let n = Array.length coefexps in
......
......@@ -23,7 +23,7 @@ open Platform
open Serializable_t
open Signatures
module MakeSimpleDistKeyGen (G : GROUP) (M : RANDOM) : sig
module MakeSimple (G : GROUP) (M : RANDOM) : sig
(** This module implements a simple distributed key generation. Each
share is a number modulo q, and the secret key is their sum. All
......
......@@ -61,7 +61,7 @@ module Make (P : PARSED_PARAMS) : S = struct
open P
module E = Election.MakeElection (G) (DirectRandom)
module KG = Trustees.MakeSimpleDistKeyGen (G) (DirectRandom)
module KG = Trustees.MakeSimple (G) (DirectRandom)
module P = Trustees.MakePKI (G) (DirectRandom)
module C = Trustees.MakeChannels (G) (DirectRandom) (P)
......
......@@ -76,7 +76,7 @@ module Make (P : PARSED_PARAMS) : S = struct
| Some keys -> keys
| None -> failwith "trustee keys are missing"
in
let module K = Trustees.MakeSimpleDistKeyGen (G) (DirectRandom) in
let module K = Trustees.MakeSimple (G) (DirectRandom) in
K.combine public_keys
| Some t ->
let module P = Trustees.MakePKI (G) (DirectRandom) in
......
......@@ -49,7 +49,7 @@ module Make (P : PARSED_PARAMS) : S = struct
(* Generate key *)
module KG = Trustees.MakeSimpleDistKeyGen (G) (DirectRandom)
module KG = Trustees.MakeSimple (G) (DirectRandom)
type keypair = { id : string; priv : string; pub : string }
......
......@@ -117,7 +117,7 @@ let verifydiff dir1 dir2 =
let y =
match threshold with
| None ->
let module K = Trustees.MakeSimpleDistKeyGen (G) (DirectRandom) in
let module K = Trustees.MakeSimple (G) (DirectRandom) in
let pks = match pks with
| None -> raise (VerifydiffError MissingPublicKeys)
| Some pks -> List.map (trustee_public_key_of_string G.read) pks
......
......@@ -104,7 +104,7 @@ let finalize_election uuid se =
(* trustees *)
let group = Group.of_string se.se_group in
let module G = (val group : GROUP) in
let module KG = Trustees.MakeSimpleDistKeyGen (G) (LwtRandom) in
let module KG = Trustees.MakeSimple (G) (LwtRandom) in
let%lwt trustees, public_keys, private_key =
match se.se_public_keys with
| [] ->
......@@ -850,7 +850,7 @@ let () =
let t = List.find (fun x -> token = x.st_token) se.se_public_keys in
let module G = (val Group.of_string se.se_group : GROUP) in
let pk = trustee_public_key_of_string G.read public_key in
let module KG = Trustees.MakeSimpleDistKeyGen (G) (LwtRandom) in
let module KG = Trustees.MakeSimple (G) (LwtRandom) in
if not (KG.check pk) then failwith "invalid public key";
(* we keep pk as a string because of G.t *)
t.st_public_key <- public_key;
......@@ -968,7 +968,7 @@ let () =
let () =
(* check that imported keys are valid *)
let module G = (val Group.of_string se.se_group : GROUP) in
let module KG = Trustees.MakeSimpleDistKeyGen (G) (LwtRandom) in
let module KG = Trustees.MakeSimple (G) (LwtRandom) in
if not @@ List.for_all (fun t ->
let pk = t.st_public_key in
let pk = trustee_public_key_of_string G.read pk in
......@@ -1376,7 +1376,7 @@ let handle_election_tally_release (uuid, ()) () =
let%lwt metadata = Web_persist.get_election_metadata uuid_s in
let module W = (val w) in
let module E = Election.MakeElection (W.G) (LwtRandom) in
let module KG = Trustees.MakeSimpleDistKeyGen (W.G) (LwtRandom) in
let module KG = Trustees.MakeSimple (W.G) (LwtRandom) in
let%lwt () =
match%lwt Web_state.get_site_user () with
| Some u when metadata.e_owner = Some u -> return ()
......
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