Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
DisSys Inc.
bsc-shamir
Commits
35db0956
Commit
35db0956
authored
Jun 04, 2020
by
Mikkel Wienberg Madsen
👀
Browse files
Fake Ballots
parent
2384e917
Pipeline
#21912
passed with stages
in 2 minutes and 24 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
election/election_test.go
View file @
35db0956
...
...
@@ -2,6 +2,8 @@ package election
import
(
"bsc-shamir/crypto/common"
"bsc-shamir/crypto/pedersen"
"bsc-shamir/crypto/sigma"
"bsc-shamir/network"
"crypto/rand"
"io/ioutil"
...
...
@@ -45,6 +47,24 @@ func createXS(n int) []*big.Int {
return
xs
}
func
CreateFakeBallots
(
xs
[]
*
big
.
Int
)
map
[
UniqueID
]
*
Ballot
{
timestamp
:=
time
.
Now
()
id
:=
uuid
.
New
()
ballots
:=
make
(
map
[
UniqueID
]
*
Ballot
)
for
_
,
x
:=
range
xs
{
ballots
[
UniqueID
(
x
.
String
())]
=
&
Ballot
{
ID
:
id
,
Timestamp
:
timestamp
,
Share
:
nil
,
Commits
:
pedersen
.
Proof
{
big
.
NewInt
(
0
),
big
.
NewInt
(
0
)},
Proofs
:
[
2
]
*
sigma
.
Proof
{
nil
,
nil
},
}
}
return
ballots
}
///////////////////////
///Client benchmarks///
///////////////////////
...
...
Write
Preview
Supports
Markdown
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