Commit 4892092a authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Threshold: (client-side) partial decryption

parent 7a17b8c7
......@@ -74,8 +74,17 @@ let compute_partial_decryption _ =
document##getElementById (Js.string "private_key") >>= fun e ->
Dom_html.CoerceTo.input e >>= fun e ->
let pk_str = Js.to_string e##value in
basic_check_private_key pk_str;
let private_key =
let epk = get_textarea "encrypted_private_key" in
let module PKI = Trustees.MakePKI (P.G) (DirectRandom) in
let module C = Trustees.MakeChannels (P.G) (DirectRandom) (PKI) in
let sk = PKI.derive_sk pk_str and dk = PKI.derive_dk pk_str in
let vk = P.G.(g **~ sk) in
let epk = C.recv dk vk epk in
(partial_decryption_key_of_string epk).pdk_decryption_key
with Not_found ->
basic_check_private_key pk_str;
try number_of_string pk_str
with 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