This repository was archived by the owner on Jun 7, 2024. It is now read-only.
File tree 11 files changed +29
-18
lines changed
electionguard_cli/cli_steps
11 files changed +29
-18
lines changed Original file line number Diff line number Diff line change 18
18
from electionguard import decryption_share
19
19
from electionguard import discrete_log
20
20
from electionguard import election
21
- from electionguard import election_builder
22
21
from electionguard import election_object_base
23
22
from electionguard import election_polynomial
24
23
from electionguard import elgamal
189
188
Configuration ,
190
189
make_ciphertext_election_context ,
191
190
)
192
- from electionguard .election_builder import (
193
- ElectionBuilder ,
194
- )
195
191
from electionguard .election_object_base import (
196
192
ElectionObjectBase ,
197
193
OrderedObjectBase ,
468
464
"ElGamalKeyPair" ,
469
465
"ElGamalPublicKey" ,
470
466
"ElGamalSecretKey" ,
471
- "ElectionBuilder" ,
472
467
"ElectionConstants" ,
473
468
"ElectionGuardLog" ,
474
469
"ElectionJointKey" ,
609
604
"div_p" ,
610
605
"div_q" ,
611
606
"election" ,
612
- "election_builder" ,
613
607
"election_object_base" ,
614
608
"election_polynomial" ,
615
609
"elgamal" ,
Original file line number Diff line number Diff line change 2
2
import click
3
3
from electionguard .elgamal import ElGamalPublicKey
4
4
from electionguard .group import ElementModQ
5
- from electionguard .election_builder import ElectionBuilder
6
5
from electionguard .utils import get_optional
6
+ from electionguard_tools .helpers .election_builder import ElectionBuilder
7
7
8
8
from ..cli_models import CliElectionInputsBase , BuildElectionResults
9
9
from .cli_step_base import CliStepBase
Original file line number Diff line number Diff line change 29
29
DEVICE_PREFIX ,
30
30
ELECTION_RECORD_DIR ,
31
31
ENCRYPTED_TALLY_FILE_NAME ,
32
+ ElectionBuilder ,
32
33
GUARDIANS_DIR ,
33
34
GUARDIAN_PREFIX ,
34
35
KeyCeremonyOrchestrator ,
43
44
TALLY_FILE_NAME ,
44
45
TallyCeremonyOrchestrator ,
45
46
accumulate_plaintext_ballots ,
47
+ election_builder ,
46
48
export ,
47
49
export_private_data ,
48
50
export_record ,
116
118
"DEVICE_PREFIX" ,
117
119
"ELECTION_RECORD_DIR" ,
118
120
"ENCRYPTED_TALLY_FILE_NAME" ,
121
+ "ElectionBuilder" ,
119
122
"ElectionFactory" ,
120
123
"ElectionSampleDataGenerator" ,
121
124
"ElectionsAndBallotsTupleType" ,
146
149
"contest_descriptions" ,
147
150
"contest_descriptions_room_for_overvoting" ,
148
151
"election" ,
152
+ "election_builder" ,
149
153
"election_descriptions" ,
150
154
"election_factory" ,
151
155
"election_types" ,
Original file line number Diff line number Diff line change 17
17
from electionguard .ballot import PlaintextBallot
18
18
from electionguard .constants import ElectionConstants , get_constants
19
19
from electionguard .election import CiphertextElectionContext
20
- from electionguard .election_builder import ElectionBuilder
21
20
from electionguard .elgamal import ElGamalPublicKey
22
21
from electionguard .encrypt import EncryptionDevice , contest_from , generate_device_uuid
23
22
from electionguard .group import TWO_MOD_Q
48
47
from electionguard_tools .helpers .key_ceremony_orchestrator import (
49
48
KeyCeremonyOrchestrator ,
50
49
)
50
+ from electionguard_tools .helpers .election_builder import ElectionBuilder
51
51
52
52
53
53
_T = TypeVar ("_T" )
Original file line number Diff line number Diff line change
1
+ from electionguard_tools .helpers import election_builder
1
2
from electionguard_tools .helpers import export
2
3
from electionguard_tools .helpers import key_ceremony_orchestrator
3
4
from electionguard_tools .helpers import tally_accumulate
4
5
from electionguard_tools .helpers import tally_ceremony_orchestrator
5
6
7
+ from electionguard_tools .helpers .election_builder import (
8
+ ElectionBuilder ,
9
+ )
6
10
from electionguard_tools .helpers .export import (
7
11
CIPHERTEXT_BALLOT_PREFIX ,
8
12
COEFFICIENTS_FILE_NAME ,
45
49
"DEVICE_PREFIX" ,
46
50
"ELECTION_RECORD_DIR" ,
47
51
"ENCRYPTED_TALLY_FILE_NAME" ,
52
+ "ElectionBuilder" ,
48
53
"GUARDIANS_DIR" ,
49
54
"GUARDIAN_PREFIX" ,
50
55
"KeyCeremonyOrchestrator" ,
59
64
"TALLY_FILE_NAME" ,
60
65
"TallyCeremonyOrchestrator" ,
61
66
"accumulate_plaintext_ballots" ,
67
+ "election_builder" ,
62
68
"export" ,
63
69
"export_private_data" ,
64
70
"export_record" ,
Original file line number Diff line number Diff line change 5
5
6
6
from electionguard .elgamal import ElGamalPublicKey
7
7
8
- from .election import CiphertextElectionContext , make_ciphertext_election_context
9
- from .group import ElementModQ
10
- from .manifest import Manifest , InternalManifest
11
- from .utils import get_optional
8
+ from electionguard .election import (
9
+ CiphertextElectionContext ,
10
+ make_ciphertext_election_context ,
11
+ )
12
+ from electionguard .group import ElementModQ
13
+ from electionguard .manifest import Manifest , InternalManifest
14
+ from electionguard .utils import get_optional
12
15
13
16
14
17
@dataclass
15
18
class ElectionBuilder :
16
19
"""
17
20
`ElectionBuilder` is a stateful builder object that constructs `CiphertextElectionContext` objects
18
21
following the initialization process that ElectionGuard Expects.
19
- SUGGESTION Perhaps move to test package.
20
22
"""
21
23
22
24
number_of_guardians : int
Original file line number Diff line number Diff line change 14
14
# Step 0 - Configure Election
15
15
from electionguard .constants import ElectionConstants , get_constants
16
16
from electionguard .election import CiphertextElectionContext
17
- from electionguard .election_builder import ElectionBuilder
18
17
from electionguard .manifest import Manifest , InternalManifest
19
18
20
19
# Step 1 - Key Ceremony
73
72
ElectionFactory ,
74
73
NUMBER_OF_GUARDIANS ,
75
74
)
75
+ from electionguard_tools .helpers .election_builder import ElectionBuilder
76
+
76
77
77
78
devices_directory = path .join (ELECTION_RECORD_DIR , DEVICES_DIR )
78
79
guardians_directory = path .join (ELECTION_RECORD_DIR , GUARDIANS_DIR )
Original file line number Diff line number Diff line change 14
14
from electionguard .data_store import DataStore
15
15
from electionguard .decryption_mediator import DecryptionMediator
16
16
from electionguard .election import CiphertextElectionContext
17
- from electionguard .election_builder import ElectionBuilder
18
17
from electionguard .encrypt import (
19
18
EncryptionMediator ,
20
19
encrypt_ballot ,
44
43
KeyCeremonyOrchestrator ,
45
44
)
46
45
from electionguard_tools .helpers .tally_accumulate import accumulate_plaintext_ballots
46
+ from electionguard_tools .helpers .election_builder import ElectionBuilder
47
+
47
48
48
49
election_factory = ElectionFactory .ElectionFactory ()
49
50
ballot_factory = BallotFactory .BallotFactory ()
Original file line number Diff line number Diff line change 11
11
from electionguard .decryption import compute_decryption_share
12
12
from electionguard .decryption_share import DecryptionShare
13
13
from electionguard .decrypt_with_shares import decrypt_tally
14
- from electionguard .election_builder import ElectionBuilder
15
14
from electionguard .elgamal import ElGamalKeyPair
16
15
from electionguard .encrypt import EncryptionMediator , encrypt_ballot
17
16
from electionguard .key_ceremony import CeremonyDetails
36
35
from electionguard_tools .helpers .key_ceremony_orchestrator import (
37
36
KeyCeremonyOrchestrator ,
38
37
)
38
+ from electionguard_tools .helpers .election_builder import ElectionBuilder
39
+
39
40
40
41
election_factory = ElectionFactory .ElectionFactory ()
41
42
ballot_factory = BallotFactory .BallotFactory ()
Original file line number Diff line number Diff line change 20
20
reconstruct_decryption_share_for_ballot ,
21
21
)
22
22
from electionguard .decryption_share import DecryptionShare
23
- from electionguard .election_builder import ElectionBuilder
24
23
from electionguard .encrypt import EncryptionMediator
25
24
from electionguard .group import ElementModP
26
25
from electionguard .guardian import Guardian
36
35
KeyCeremonyOrchestrator ,
37
36
)
38
37
from electionguard_tools .helpers .tally_accumulate import accumulate_plaintext_ballots
38
+ from electionguard_tools .helpers .election_builder import ElectionBuilder
39
+
39
40
40
41
election_factory = ElectionFactory .ElectionFactory ()
41
42
ballot_factory = BallotFactory .BallotFactory ()
Original file line number Diff line number Diff line change 31
31
mult_p ,
32
32
pow_p ,
33
33
)
34
- from electionguard .election_builder import ElectionBuilder
35
34
from electionguard .encrypt import EncryptionMediator
36
35
from electionguard .guardian import Guardian
37
36
from electionguard .key_ceremony import (
49
48
KeyCeremonyOrchestrator ,
50
49
)
51
50
from electionguard_tools .helpers .tally_accumulate import accumulate_plaintext_ballots
51
+ from electionguard_tools .helpers .election_builder import ElectionBuilder
52
+
52
53
53
54
election_factory = ElectionFactory .ElectionFactory ()
54
55
ballot_factory = BallotFactory .BallotFactory ()
You can’t perform that action at this time.
0 commit comments