Attention une mise à jour du service Gitlab va être effectuée le mardi 30 novembre entre 17h30 et 18h00. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes. Cette mise à jour intermédiaire en version 14.0.12 nous permettra de rapidement pouvoir mettre à votre disposition une version plus récente.

Commit 73ea9cfd authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Always check finite field parameters

parent 89cd91f8
......@@ -103,9 +103,6 @@ end
module RunCredgen (P : PARAMS) (G : Election.FF_GROUP) = struct
open P
(* Check the group *)
let () = assert (Election.check_finite_field G.group)
(* Some helpers *)
(* Beware: the following must be changed in accordance with the booth! *)
......
......@@ -123,7 +123,6 @@ module GetParams (X : sig end) : PARAMS = struct
let {ffpk_g = g; ffpk_p = p; ffpk_q = q; ffpk_y = y} = params.e_public_key
let group = {g; p; q}
let () = assert (Election.check_finite_field group)
let sk_file = !sk_file
let do_finalize = !do_finalize
......
......@@ -85,7 +85,6 @@ module MakeElection (G : Election.FF_GROUP) (P : PARAMS) = struct
(* Setup group *)
assert (Election.check_finite_field G.group);;
module M = Election.MakeSimpleMonad(G);;
(* Setup trustees *)
......
......@@ -63,7 +63,6 @@ module RunTrusteeKeygen (G : Election.FF_GROUP) = struct
(* Setup group *)
assert (Election.check_finite_field G.group);;
module M = Election.MakeSimpleMonad(G);;
(* Generate key *)
......
......@@ -50,7 +50,7 @@ module type FF_GROUP = GROUP
with type t = Z.t
and type group = ff_params
let finite_field group =
let unsafe_finite_field group =
let {p; q; g} = group in
let module G = struct
open Z
......@@ -74,6 +74,12 @@ let finite_field group =
let group = group
end in (module G : FF_GROUP)
let finite_field group =
if check_finite_field group then
unsafe_finite_field group
else
invalid_arg "incorrect finite field parameters"
(** Parameters *)
let check_election_public_key (type t) g e =
......
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