MAJ terminée. Nous sommes passés en version 14.6.2 . Pour consulter les "releases notes" associées c'est ici :

https://about.gitlab.com/releases/2022/01/11/security-release-gitlab-14-6-2-released/
https://about.gitlab.com/releases/2022/01/04/gitlab-14-6-1-released/

Commit f0ced2f6 authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Move election result to an optional field of public_data

parent 2d101182
......@@ -64,7 +64,7 @@ module type ELGAMAL_CRYPTO = sig
val verify_partial_decryption :
t election -> t tally -> t trustee_public_key -> t partial_decryption -> bool
val verify_partial_decryptions : t election -> t election_public_data -> bool
val verify_result : t election -> t election_public_data -> bool
val verify_result : t election -> t result -> bool
val compute_encrypted_tally : t election -> t vote array -> t encrypted_tally
end
......@@ -164,9 +164,13 @@ module Make (G : GROUP) = struct
) election.e_questions
let verify_partial_decryptions election public_data =
array_forall2 (verify_partial_decryption election public_data.encrypted_tally.tally)
public_data.public_keys
public_data.partial_decryptions
(* FIXME: move this match elsewhere *)
match public_data.election_result with
| Some r ->
array_forall2 (verify_partial_decryption election r.encrypted_tally.tally)
public_data.public_keys
r.partial_decryptions
| None -> false
let verify_result election public_data =
let pds = public_data.partial_decryptions in
......
......@@ -36,7 +36,7 @@ module type ELGAMAL_CRYPTO = sig
val verify_partial_decryption :
t election -> t tally -> t trustee_public_key -> t partial_decryption -> bool
val verify_partial_decryptions : t election -> t election_public_data -> bool
val verify_result : t election -> t election_public_data -> bool
val verify_result : t election -> t result -> bool
val compute_encrypted_tally : t election -> t vote array -> t encrypted_tally
end
......
......@@ -122,13 +122,17 @@ type 'a partial_decryption = {
(** {1 Compound datastructures} *)
type 'a election_public_data = {
public_keys : 'a trustee_public_key list <ocaml repr="array">;
type 'a result = {
encrypted_tally : 'a encrypted_tally;
partial_decryptions : 'a partial_decryption list <ocaml repr="array">;
result : int list <ocaml repr="array"> list <ocaml repr="array">;
}
type 'a election_public_data = {
public_keys : 'a trustee_public_key list <ocaml repr="array">;
?election_result : 'a result option;
}
type 'a election_private_data = {
private_keys : 'a private_key list <ocaml repr="array">;
}
This diff is collapsed.
......@@ -130,6 +130,11 @@ let verbose_verify_election_test_data e =
let {g; p; q; y} = e.election.e_public_key in
let module G = (val ElGamal.make_ff_msubgroup p q g : ElGamal.GROUP with type t = Z.t) in
let module Crypto = ElGamal.Make (G) in
let r =
match e.public_data.election_result with
| Some r -> r
| None -> assert false
in
verbose_assert "election key"
(lazy (Crypto.verify_election_key
e.election.e_public_key.y
......@@ -139,12 +144,12 @@ let verbose_verify_election_test_data e =
(fun _ x -> Crypto.verify_vote e.election e.fingerprint x)
e.votes));
verbose_assert "encrypted tally"
(lazy (e.public_data.encrypted_tally =
(lazy (r.encrypted_tally =
Crypto.compute_encrypted_tally e.election e.votes));
verbose_assert "partial decryptions"
(lazy (Crypto.verify_partial_decryptions e.election e.public_data));
verbose_assert "result"
(lazy (Crypto.verify_result e.election e.public_data));
(lazy (Crypto.verify_result e.election r));
verbose_assert "private keys"
(lazy (array_foralli
(fun _ k -> Crypto.verify_private_key k)
......
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