Commit c2862989 authored by Stephane Glondu's avatar Stephane Glondu

In threshold mode, offer for download the public key

parent 1f8854c6
Pipeline #61145 passed with stages
in 17 minutes and 11 seconds
......@@ -28,6 +28,8 @@ type uuid <ocaml predef from="Serializable_builtin"> = abstract
(** {2 Basic cryptographic datastructures} *)
type 'a group_element = 'a
type 'a ciphertext = {
alpha : 'a;
beta : 'a;
......
......@@ -103,8 +103,19 @@ let fill_interactivity _ =
| 6 | 7 ->
set_step 3;
set_element_display "data_form" "none";
let t = document##createTextNode (Js.string "Your job in the key establishment protocol is done! Your private key will be needed to decrypt the election result.") in
Dom.appendChild e t
let t = document##createTextNode (Js.string "Your job in the key establishment protocol is done! Please download your ") in
Dom.appendChild e t;
let a = document##createTextNode (Js.string "public key") in
let t = Dom_html.createA document in
t##setAttribute (Js.string "id") (Js.string "public_key");
Dom.appendChild t a;
Dom.appendChild e t;
let t = document##createTextNode (Js.string " and check that it is in the public threshold parameters when the election is open. Your private key will be needed to decrypt the election result.") in
Dom.appendChild e t;
let group = get_textarea "group" in
let module G = (val Group.of_string group : GROUP) in
let voutput = voutput_of_string G.read (get_textarea "voutput") in
set_download "public_key" "application/json" "public_key.json" (string_of_group_element G.write voutput.vo_public_key.trustee_public_key)
| 1 ->
set_step 1;
let b = document##createElement (Js.string "button") in
......
......@@ -1321,6 +1321,10 @@ let election_draft_threshold_trustee token uuid se () =
pcdata "Vinput: ";
unsafe_textarea "vinput" (match trustee.stt_vinput with None -> "" | Some x -> string_of_vinput x);
];
div [
pcdata "Voutput: ";
unsafe_textarea "voutput" (match trustee.stt_voutput with None -> "" | Some x -> x);
];
]
in
let form =
......
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