Commit 827328de authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Inline "group" field of wrapped_pubkey (temporary)

This should be reverted once the booth is adapted...
parent 2292631c
......@@ -143,8 +143,9 @@ let list_save_to filename writer xs =
close_out oc;;
let save_to_disk () =
let {g; p; q} = G.group in
let params = { params with
e_public_key = G.({group; y})
e_public_key = {ffpk_g = g; ffpk_p = p; ffpk_q = q; ffpk_y = y}
} in
let ballots = Array.of_list (M.fold_ballots (fun x xs () -> x::xs) [] ()) in
let dir = Printf.sprintf "demo/data/%s" (Uuidm.to_string params.e_uuid) in
......
......@@ -32,10 +32,12 @@ let y = KG.combine public_keys
(* Setup election *)
let {g; p; q} = G.group
let params = {
e_description = "This is a test election.";
e_name = "Test election";
e_public_key = G.({group; y});
e_public_key = {ffpk_g = g; ffpk_p = p; ffpk_q = q; ffpk_y = y};
e_questions =
[|
{
......
......@@ -248,17 +248,11 @@ secret exponent, a public key $\public(c)=g^s$ is computed.
\newcommand{\question}{\texttt{question}}
\begin{gather*}
\texttt{group}=\left\{
\texttt{wrapped\_pk}=\left\{\small
\begin{array}{rcl}
\textsf{g}&:&\G\\
\textsf{p}&:&\N\\
\textsf{q}&:&\N
\end{array}
\right\}
\qquad
\texttt{wrapped\_pk}=\left\{\small
\begin{array}{rcl}
\textsf{group}&:&\texttt{group}\\
\textsf{q}&:&\N\\
\textsf{y}&:&\G
\end{array}
\right\}
......
......@@ -93,8 +93,8 @@ let params, election_fingerprint =
| Some [e] -> e
| _ -> failwith "invalid election file"
let {group; y} = params.e_public_key
let {g; p; q} = group
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)
end
......
......@@ -60,10 +60,13 @@ type ff_params = {
}
<doc text="Parameters for a multiplicative subgroup of a finite field.">
(* FIXME: use a "group" field of type 'a *)
type ('a, 'b) wrapped_pubkey = {
group : 'a;
g : number;
p : number;
q : number;
y : 'b;
}
} <ocaml field_prefix="ffpk_">
<doc text="A public key wrapped with its group parameters.">
type ff_pubkey = (ff_params, number) wrapped_pubkey
......
......@@ -187,7 +187,8 @@ let make_web_election raw_election e_meta election_web =
let wrapped_params = Serializable_j.params_of_string
Serializable_j.read_ff_pubkey raw_election
in
let {group; y} = wrapped_params.e_public_key in
let {ffpk_g = g; ffpk_p = p; ffpk_q = q; ffpk_y = y} = wrapped_params.e_public_key in
let group = {g; p; q} in
let e_params = { wrapped_params with e_public_key = y } in
let election = {e_params; e_meta; e_pks = None; e_fingerprint} in
......
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