Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Helios Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
Helios Server
Commits
566d149a
Unverified
Commit
566d149a
authored
12 years ago
by
Nicolas Pouillard
Browse files
Options
Downloads
Patches
Plain Diff
Additionally check for the length of the array of proofs
parent
da246171
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
helios/crypto/algs.py
+4
-0
4 additions, 0 deletions
helios/crypto/algs.py
helios/crypto/elgamal.py
+4
-0
4 additions, 0 deletions
helios/crypto/elgamal.py
with
8 additions
and
0 deletions
helios/crypto/algs.py
+
4
−
0
View file @
566d149a
...
@@ -547,6 +547,10 @@ class EGCiphertext:
...
@@ -547,6 +547,10 @@ class EGCiphertext:
overall_challenge is what all of the challenges combined should yield.
overall_challenge is what all of the challenges combined should yield.
"""
"""
if
len
(
plaintexts
)
!=
len
(
proof
.
proofs
):
print
(
"
bad number of proofs (expected %s, found %s)
"
%
(
len
(
plaintexts
),
len
(
proof
.
proofs
)))
return
False
for
i
in
range
(
len
(
plaintexts
)):
for
i
in
range
(
len
(
plaintexts
)):
# if a proof fails, stop right there
# if a proof fails, stop right there
if
not
self
.
verify_encryption_proof
(
plaintexts
[
i
],
proof
.
proofs
[
i
]):
if
not
self
.
verify_encryption_proof
(
plaintexts
[
i
],
proof
.
proofs
[
i
]):
...
...
This diff is collapsed.
Click to expand it.
helios/crypto/elgamal.py
+
4
−
0
View file @
566d149a
...
@@ -409,6 +409,10 @@ class Ciphertext:
...
@@ -409,6 +409,10 @@ class Ciphertext:
overall_challenge is what all of the challenges combined should yield.
overall_challenge is what all of the challenges combined should yield.
"""
"""
if
len
(
plaintexts
)
!=
len
(
proof
.
proofs
):
print
(
"
bad number of proofs (expected %s, found %s)
"
%
(
len
(
plaintexts
),
len
(
proof
.
proofs
)))
return
False
for
i
in
range
(
len
(
plaintexts
)):
for
i
in
range
(
len
(
plaintexts
)):
# if a proof fails, stop right there
# if a proof fails, stop right there
if
not
self
.
verify_encryption_proof
(
plaintexts
[
i
],
proof
.
proofs
[
i
]):
if
not
self
.
verify_encryption_proof
(
plaintexts
[
i
],
proof
.
proofs
[
i
]):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment