Skip to content

Commit d06b371

Browse files
authored
Upgrade to ElectionGuard v1.1.4 (#83)
- Use shared `read_json_object` function - Remove custom ElementModQ serialization in guardian challenge
1 parent 58c9fc6 commit d06b371

File tree

7 files changed

+49
-64
lines changed

7 files changed

+49
-64
lines changed

Pipfile.lock

Lines changed: 43 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/api/v1/guardian/guardian.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
verify_election_partial_key_challenge,
1313
)
1414
from electionguard.rsa import rsa_decrypt, rsa_encrypt
15-
from electionguard.serializable import write_json_object
15+
from electionguard.serializable import read_json_object, write_json_object
1616
from fastapi import APIRouter, HTTPException
1717
from typing import Any, List
1818

@@ -28,7 +28,6 @@
2828
GuardianBackupRequest,
2929
)
3030
from ..tags import KEY_CEREMONY
31-
from app.utils import read_json_object
3231

3332
router = APIRouter()
3433

@@ -130,8 +129,7 @@ def create_backup_challenge(request: BackupChallengeRequest) -> Any:
130129
raise HTTPException(
131130
status_code=500, detail="Backup challenge generation failed"
132131
)
133-
# FIXME Challenge value is ElementModQ converted to int that is too large
134-
challenge = challenge._replace(value=str(challenge.value))
132+
135133
return write_json_object(challenge)
136134

137135

app/api/v1/mediator/tally.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
ElectionDescription,
77
InternalElectionDescription,
88
)
9+
from electionguard.serializable import read_json_object
910
from electionguard.tally import (
1011
publish_ciphertext_tally,
1112
publish_plaintext_tally,
@@ -15,7 +16,6 @@
1516
from fastapi import APIRouter, Body, HTTPException
1617
from typing import Any, List, Tuple
1718

18-
from app.utils.serialize import read_json_object
1919
from ..models import (
2020
convert_tally,
2121
AppendTallyRequest,

app/api/v1/models/guardian.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
import electionguard.guardian
66
import electionguard.key_ceremony
77
import electionguard.schnorr
8-
9-
from app.utils.serialize import read_json_object
8+
from electionguard.serializable import read_json_object
109

1110
from .base import Base
1211
from .key import AuxiliaryKeyPair, AuxiliaryPublicKey, ElectionKeyPair

app/api/v1/models/tally.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
from typing import Any, Dict, List
21
import electionguard.election
2+
from electionguard.serializable import read_json_object
33
import electionguard.tally
4+
from typing import Any, Dict, List
45

5-
from app.utils.serialize import read_json_object
66

77
from .ballot import CiphertextAcceptedBallot
88
from .base import Base

app/utils/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

app/utils/serialize.py

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)