Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
belenios
belenios
Commits
f9949778
Commit
f9949778
authored
Mar 22, 2017
by
Stephane Glondu
Browse files
In Election, rename combine_factors into compute_result
parent
e96d4387
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/lib/election.ml
View file @
f9949778
...
@@ -565,7 +565,7 @@ module MakeElection (G : GROUP) (M : RANDOM) = struct
...
@@ -565,7 +565,7 @@ module MakeElection (G : GROUP) (M : RANDOM) = struct
type
combinator
=
factor
array
->
elt
array
array
type
combinator
=
factor
array
->
elt
array
array
let
com
bine_factors
num_tallied
encrypted_tally
partial_decryptions
combinator
=
let
com
pute_result
num_tallied
encrypted_tally
partial_decryptions
combinator
=
let
factors
=
combinator
partial_decryptions
in
let
factors
=
combinator
partial_decryptions
in
let
results
=
Array
.
mmap2
(
fun
{
beta
;
_
}
f
->
let
results
=
Array
.
mmap2
(
fun
{
beta
;
_
}
f
->
beta
/
f
beta
/
f
...
...
src/lib/signatures.mli
View file @
f9949778
...
@@ -225,7 +225,7 @@ module type ELECTION = sig
...
@@ -225,7 +225,7 @@ module type ELECTION = sig
type
combinator
=
factor
array
->
elt
array
array
type
combinator
=
factor
array
->
elt
array
array
val
com
bine_factors
:
int
->
ciphertext
->
factor
array
->
combinator
->
result
val
com
pute_result
:
int
->
ciphertext
->
factor
array
->
combinator
->
result
(** Combine the encrypted tally and the factors from all trustees to
(** Combine the encrypted tally and the factors from all trustees to
produce the election result. The first argument is the number of
produce the election result. The first argument is the number of
tallied ballots. May raise [Invalid_argument]. *)
tallied ballots. May raise [Invalid_argument]. *)
...
...
src/tool/tool_election.ml
View file @
f9949778
...
@@ -205,7 +205,7 @@ module Make (P : PARSED_PARAMS) : S = struct
...
@@ -205,7 +205,7 @@ module Make (P : PARSED_PARAMS) : S = struct
KG
.
combine_factors
KG
.
combine_factors
|
Some
t
->
KP
.
combine_factors
checker
t
|
Some
t
->
KP
.
combine_factors
checker
t
in
in
let
result
=
E
.
com
bine_factors
(
M
.
cardinal
()
)
tally
factors
combinator
in
let
result
=
E
.
com
pute_result
(
M
.
cardinal
()
)
tally
factors
combinator
in
assert
(
E
.
check_result
combinator
(
Lazy
.
force
pks
)
result
);
assert
(
E
.
check_result
combinator
(
Lazy
.
force
pks
)
result
);
string_of_result
G
.
write
result
string_of_result
G
.
write
result
...
...
src/web/web_site.ml
View file @
f9949778
...
@@ -1402,7 +1402,7 @@ let handle_election_tally_release (uuid, ()) () =
...
@@ -1402,7 +1402,7 @@ let handle_election_tally_release (uuid, ()) () =
Lwt_io
.
chars_of_file
|>
Lwt_stream
.
to_string
>>=
Lwt_io
.
chars_of_file
|>
Lwt_stream
.
to_string
>>=
wrap1
(
encrypted_tally_of_string
W
.
G
.
read
)
wrap1
(
encrypted_tally_of_string
W
.
G
.
read
)
in
in
let
result
=
E
.
com
bine_factors
ntallied
et
pds
KG
.
combine_factors
in
let
result
=
E
.
com
pute_result
ntallied
et
pds
KG
.
combine_factors
in
let
%
lwt
()
=
let
%
lwt
()
=
let
open
Lwt_io
in
let
open
Lwt_io
in
with_file
with_file
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment