Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/electionguard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@
sequence_order_sort,
)
from electionguard.election_polynomial import (
ElectionPolynomial,
Coefficient,
ElectionPolynomial,
LagrangeCoefficientsRecord,
PublicCommitment,
SecretCoefficient,
Expand Down Expand Up @@ -410,6 +410,7 @@
"CiphertextTally",
"CiphertextTallyContest",
"CiphertextTallySelection",
"Coefficient",
"CompactPlaintextBallot",
"CompactSubmittedBallot",
"CompensatedDecryptionShare",
Expand Down Expand Up @@ -443,7 +444,6 @@
"ElectionPartialKeyBackup",
"ElectionPartialKeyChallenge",
"ElectionPartialKeyVerification",
"Coefficient",
"ElectionPolynomial",
"ElectionPublicKey",
"ElectionType",
Expand Down
11 changes: 5 additions & 6 deletions src/electionguard/election_polynomial.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
)
from .schnorr import make_schnorr_proof, SchnorrProof

SECRET_COEFFICIENT = ElementModQ # Secret coefficient of election polynomial
PUBLIC_COMMITMENT = ElementModP # Public commitment of election polynomial
SecretCoefficient = ElementModQ # Secret coefficient of election polynomial
PublicCommitment = ElementModP # Public commitment of election polynomial


@dataclass
Expand All @@ -28,10 +28,10 @@ class Coefficient:
A set of coefficients that define an Election Polynomal
"""

value: SECRET_COEFFICIENT
value: SecretCoefficient
"""The secret coefficient `a_ij` """

commitment: PUBLIC_COMMITMENT
commitment: PublicCommitment
"""The public key `K_ij` generated from secret coefficient"""

proof: SchnorrProof
Expand All @@ -50,7 +50,7 @@ class ElectionPolynomial:
coefficients: List[Coefficient]
"""List of coefficient value, commitments and proofs"""

def get_commitments(self) -> List[PUBLIC_COMMITMENT]:
def get_commitments(self) -> List[PublicCommitment]:
"""Access the list of public keys generated from secret coefficient"""
return [coefficient.commitment for coefficient in self.coefficients]

Expand All @@ -71,7 +71,6 @@ def generate_polynomial(
"""
coefficients: List[Coefficient] = []


for i in range(number_of_coefficients):
# Note: the nonce value is not safe. it is designed for testing only.
# this method should be called without the nonce in production.
Expand Down