Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
belenios
belenios
Commits
d43a8438
Commit
d43a8438
authored
Aug 11, 2017
by
Stephane Glondu
Browse files
Election.MakeElection -> Election.Make
parent
c906c565
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/booth/booth.ml
View file @
d43a8438
...
...
@@ -103,7 +103,7 @@ end
let
encryptBallot
params
cred
plaintext
()
=
let
module
P
=
(
val
params
:
ELECTION_DATA
)
in
let
module
G
=
P
.
G
in
let
module
E
=
Election
.
Make
Election
(
G
)
(
LwtJsRandom
)
in
let
module
E
=
Election
.
Make
(
G
)
(
LwtJsRandom
)
in
let
module
CD
=
Credential
.
MakeDerive
(
G
)
in
let
sk
=
CD
.
derive
P
.
election
.
e_params
.
e_uuid
cred
in
lwt
randomness
=
E
.
make_randomness
P
.
election
()
in
...
...
src/lib/election.ml
View file @
d43a8438
...
...
@@ -54,7 +54,7 @@ let question_length q =
(** Homomorphic elections *)
module
Make
Election
(
G
:
GROUP
)
(
M
:
RANDOM
)
=
struct
module
Make
(
G
:
GROUP
)
(
M
:
RANDOM
)
=
struct
open
G
type
'
a
m
=
'
a
M
.
t
...
...
src/lib/election.mli
View file @
d43a8438
...
...
@@ -29,6 +29,6 @@ val get_group : Yojson.Safe.json election -> (module ELECTION_DATA)
val
question_length
:
question
->
int
module
Make
Election
(
G
:
GROUP
)
(
M
:
RANDOM
)
:
module
Make
(
G
:
GROUP
)
(
M
:
RANDOM
)
:
ELECTION
with
type
elt
=
G
.
t
and
type
'
a
m
=
'
a
M
.
t
(** Implementation of {!Signatures.ELECTION}. *)
src/tool/tool_election.ml
View file @
d43a8438
...
...
@@ -59,7 +59,7 @@ let parse_params p =
module
Make
(
P
:
PARSED_PARAMS
)
:
S
=
struct
open
P
module
E
=
Election
.
Make
Election
(
G
)
(
DirectRandom
)
module
E
=
Election
.
Make
(
G
)
(
DirectRandom
)
module
KG
=
Trustees
.
MakeSimple
(
G
)
(
DirectRandom
)
...
...
src/tool/tool_js_pd.ml
View file @
d43a8438
...
...
@@ -68,7 +68,7 @@ let compute_partial_decryption _ =
Js
.
Opt
.
option
!
election
>>=
fun
e
->
let
election
=
Election
.(
get_group
(
of_string
e
))
in
let
module
P
=
(
val
election
)
in
let
module
E
=
Election
.
Make
Election
(
P
.
G
)
(
DirectRandom
)
in
let
module
E
=
Election
.
Make
(
P
.
G
)
(
DirectRandom
)
in
Js
.
Opt
.
option
!
encrypted_tally
>>=
fun
e
->
let
encrypted_tally
=
encrypted_tally_of_string
P
.
G
.
read
e
in
document
##
getElementById
(
Js
.
string
"private_key"
)
>>=
fun
e
->
...
...
src/tool/tool_verifydiff.ml
View file @
d43a8438
...
...
@@ -113,7 +113,7 @@ let verifydiff dir1 dir2 =
(* the public keys / threshold parameters must be valid *)
let
module
ED
=
(
val
Election
.(
get_group
(
of_string
election
)))
in
let
open
ED
in
let
module
E
=
Election
.
Make
Election
(
G
)
(
DirectRandom
)
in
let
module
E
=
Election
.
Make
(
G
)
(
DirectRandom
)
in
let
y
=
match
threshold
with
|
None
->
...
...
src/web/web_election.ml
View file @
d43a8438
...
...
@@ -36,7 +36,7 @@ module Make (D : ELECTION_DATA) (M : RANDOM with type 'a t = 'a Lwt.t) : WEB_ELE
let
uuid
=
D
.
election
.
e_params
.
e_uuid
module
G
=
D
.
G
module
E
=
Election
.
Make
Election
(
G
)
(
M
)
module
E
=
Election
.
Make
(
G
)
(
M
)
module
B
:
WEB_BALLOT_BOX
=
struct
...
...
src/web/web_site.ml
View file @
d43a8438
...
...
@@ -1364,7 +1364,7 @@ let () =
in
let
%
lwt
election
=
find_election
uuid
in
let
module
W
=
(
val
Election
.
get_group
election
)
in
let
module
E
=
Election
.
Make
Election
(
W
.
G
)
(
LwtRandom
)
in
let
module
E
=
Election
.
Make
(
W
.
G
)
(
LwtRandom
)
in
let
%
lwt
pks
=
match
%
lwt
Web_persist
.
get_threshold
uuid
with
|
Some
tp
->
...
...
@@ -1402,7 +1402,7 @@ let handle_election_tally_release (uuid, ()) () =
let
%
lwt
election
=
find_election
uuid
in
let
%
lwt
metadata
=
Web_persist
.
get_election_metadata
uuid
in
let
module
W
=
(
val
Election
.
get_group
election
)
in
let
module
E
=
Election
.
Make
Election
(
W
.
G
)
(
LwtRandom
)
in
let
module
E
=
Election
.
Make
(
W
.
G
)
(
LwtRandom
)
in
if
metadata
.
e_owner
=
Some
u
then
(
let
%
lwt
npks
,
ntallied
=
match
%
lwt
Web_persist
.
get_election_state
uuid
with
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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