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
a8af9c7c
Commit
a8af9c7c
authored
Apr 10, 2017
by
Stephane Glondu
Browse files
s/MakeSimpleDistKeyGen/MakeSimple/g
parent
e6f7fd69
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/lib/trustees.ml
View file @
a8af9c7c
...
...
@@ -30,7 +30,7 @@ let check_modulo p x = Z.(geq x zero && lt x p)
(** Distributed key generation *)
module
MakeSimple
DistKeyGen
(
G
:
GROUP
)
(
M
:
RANDOM
)
=
struct
module
MakeSimple
(
G
:
GROUP
)
(
M
:
RANDOM
)
=
struct
open
G
open
M
...
...
@@ -189,7 +189,7 @@ module MakePedersen (G : GROUP) (M : RANDOM)
open
G
let
(
>>=
)
=
M
.
bind
module
K
=
MakeSimple
DistKeyGen
(
G
)
(
M
)
module
K
=
MakeSimple
(
G
)
(
M
)
let
compute_verification_keys
coefexps
=
let
n
=
Array
.
length
coefexps
in
...
...
src/lib/trustees.mli
View file @
a8af9c7c
...
...
@@ -23,7 +23,7 @@ open Platform
open
Serializable_t
open
Signatures
module
MakeSimple
DistKeyGen
(
G
:
GROUP
)
(
M
:
RANDOM
)
:
sig
module
MakeSimple
(
G
:
GROUP
)
(
M
:
RANDOM
)
:
sig
(** This module implements a simple distributed key generation. Each
share is a number modulo q, and the secret key is their sum. All
...
...
src/tool/tool_election.ml
View file @
a8af9c7c
...
...
@@ -61,7 +61,7 @@ module Make (P : PARSED_PARAMS) : S = struct
open
P
module
E
=
Election
.
MakeElection
(
G
)
(
DirectRandom
)
module
KG
=
Trustees
.
MakeSimple
DistKeyGen
(
G
)
(
DirectRandom
)
module
KG
=
Trustees
.
MakeSimple
(
G
)
(
DirectRandom
)
module
P
=
Trustees
.
MakePKI
(
G
)
(
DirectRandom
)
module
C
=
Trustees
.
MakeChannels
(
G
)
(
DirectRandom
)
(
P
)
...
...
src/tool/tool_mkelection.ml
View file @
a8af9c7c
...
...
@@ -76,7 +76,7 @@ module Make (P : PARSED_PARAMS) : S = struct
|
Some
keys
->
keys
|
None
->
failwith
"trustee keys are missing"
in
let
module
K
=
Trustees
.
MakeSimple
DistKeyGen
(
G
)
(
DirectRandom
)
in
let
module
K
=
Trustees
.
MakeSimple
(
G
)
(
DirectRandom
)
in
K
.
combine
public_keys
|
Some
t
->
let
module
P
=
Trustees
.
MakePKI
(
G
)
(
DirectRandom
)
in
...
...
src/tool/tool_tkeygen.ml
View file @
a8af9c7c
...
...
@@ -49,7 +49,7 @@ module Make (P : PARSED_PARAMS) : S = struct
(* Generate key *)
module
KG
=
Trustees
.
MakeSimple
DistKeyGen
(
G
)
(
DirectRandom
)
module
KG
=
Trustees
.
MakeSimple
(
G
)
(
DirectRandom
)
type
keypair
=
{
id
:
string
;
priv
:
string
;
pub
:
string
}
...
...
src/tool/tool_verifydiff.ml
View file @
a8af9c7c
...
...
@@ -117,7 +117,7 @@ let verifydiff dir1 dir2 =
let
y
=
match
threshold
with
|
None
->
let
module
K
=
Trustees
.
MakeSimple
DistKeyGen
(
G
)
(
DirectRandom
)
in
let
module
K
=
Trustees
.
MakeSimple
(
G
)
(
DirectRandom
)
in
let
pks
=
match
pks
with
|
None
->
raise
(
VerifydiffError
MissingPublicKeys
)
|
Some
pks
->
List
.
map
(
trustee_public_key_of_string
G
.
read
)
pks
...
...
src/web/web_site.ml
View file @
a8af9c7c
...
...
@@ -104,7 +104,7 @@ let finalize_election uuid se =
(* trustees *)
let
group
=
Group
.
of_string
se
.
se_group
in
let
module
G
=
(
val
group
:
GROUP
)
in
let
module
KG
=
Trustees
.
MakeSimple
DistKeyGen
(
G
)
(
LwtRandom
)
in
let
module
KG
=
Trustees
.
MakeSimple
(
G
)
(
LwtRandom
)
in
let
%
lwt
trustees
,
public_keys
,
private_key
=
match
se
.
se_public_keys
with
|
[]
->
...
...
@@ -850,7 +850,7 @@ let () =
let
t
=
List
.
find
(
fun
x
->
token
=
x
.
st_token
)
se
.
se_public_keys
in
let
module
G
=
(
val
Group
.
of_string
se
.
se_group
:
GROUP
)
in
let
pk
=
trustee_public_key_of_string
G
.
read
public_key
in
let
module
KG
=
Trustees
.
MakeSimple
DistKeyGen
(
G
)
(
LwtRandom
)
in
let
module
KG
=
Trustees
.
MakeSimple
(
G
)
(
LwtRandom
)
in
if
not
(
KG
.
check
pk
)
then
failwith
"invalid public key"
;
(* we keep pk as a string because of G.t *)
t
.
st_public_key
<-
public_key
;
...
...
@@ -968,7 +968,7 @@ let () =
let
()
=
(* check that imported keys are valid *)
let
module
G
=
(
val
Group
.
of_string
se
.
se_group
:
GROUP
)
in
let
module
KG
=
Trustees
.
MakeSimple
DistKeyGen
(
G
)
(
LwtRandom
)
in
let
module
KG
=
Trustees
.
MakeSimple
(
G
)
(
LwtRandom
)
in
if
not
@@
List
.
for_all
(
fun
t
->
let
pk
=
t
.
st_public_key
in
let
pk
=
trustee_public_key_of_string
G
.
read
pk
in
...
...
@@ -1376,7 +1376,7 @@ let handle_election_tally_release (uuid, ()) () =
let
%
lwt
metadata
=
Web_persist
.
get_election_metadata
uuid_s
in
let
module
W
=
(
val
w
)
in
let
module
E
=
Election
.
MakeElection
(
W
.
G
)
(
LwtRandom
)
in
let
module
KG
=
Trustees
.
MakeSimple
DistKeyGen
(
W
.
G
)
(
LwtRandom
)
in
let
module
KG
=
Trustees
.
MakeSimple
(
W
.
G
)
(
LwtRandom
)
in
let
%
lwt
()
=
match
%
lwt
Web_state
.
get_site_user
()
with
|
Some
u
when
metadata
.
e_owner
=
Some
u
->
return
()
...
...
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