From c3ae7fff71dcca97e99417904404bc0bfdeb1c0e Mon Sep 17 00:00:00 2001 From: SteveMaier-IRT Date: Mon, 1 Nov 2021 15:33:40 -0400 Subject: [PATCH] Fixed linting issues Set name of 2 types back to the new standard --- src/electionguard/__init__.py | 4 ++-- src/electionguard/election_polynomial.py | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/electionguard/__init__.py b/src/electionguard/__init__.py index 147c4316..04cffe26 100644 --- a/src/electionguard/__init__.py +++ b/src/electionguard/__init__.py @@ -185,8 +185,8 @@ sequence_order_sort, ) from electionguard.election_polynomial import ( - ElectionPolynomial, Coefficient, + ElectionPolynomial, LagrangeCoefficientsRecord, PublicCommitment, SecretCoefficient, @@ -410,6 +410,7 @@ "CiphertextTally", "CiphertextTallyContest", "CiphertextTallySelection", + "Coefficient", "CompactPlaintextBallot", "CompactSubmittedBallot", "CompensatedDecryptionShare", @@ -443,7 +444,6 @@ "ElectionPartialKeyBackup", "ElectionPartialKeyChallenge", "ElectionPartialKeyVerification", - "Coefficient", "ElectionPolynomial", "ElectionPublicKey", "ElectionType", diff --git a/src/electionguard/election_polynomial.py b/src/electionguard/election_polynomial.py index dcf099bd..1675f229 100644 --- a/src/electionguard/election_polynomial.py +++ b/src/electionguard/election_polynomial.py @@ -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 @@ -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 @@ -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] @@ -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.