aboutsummaryrefslogtreecommitdiffhomepage
path: root/pyecsca/ec
diff options
context:
space:
mode:
authorJ08nY2020-06-29 22:39:35 +0200
committerJ08nY2020-06-29 22:39:35 +0200
commit9c8099f04ed2815dd50fd69a12d8b4e6f30aac7d (patch)
tree89a1f03ccb17574b0c2ab703aa14771a6a4b6434 /pyecsca/ec
parenta726c69f3e30982bde485479e81a53d24a6a759b (diff)
downloadpyecsca-9c8099f04ed2815dd50fd69a12d8b4e6f30aac7d.tar.gz
pyecsca-9c8099f04ed2815dd50fd69a12d8b4e6f30aac7d.tar.zst
pyecsca-9c8099f04ed2815dd50fd69a12d8b4e6f30aac7d.zip
Fix codestyle.
Diffstat (limited to 'pyecsca/ec')
-rw-r--r--pyecsca/ec/curve.py2
-rw-r--r--pyecsca/ec/mult.py8
-rw-r--r--pyecsca/ec/params.py4
3 files changed, 7 insertions, 7 deletions
diff --git a/pyecsca/ec/curve.py b/pyecsca/ec/curve.py
index 8cbd48e..20b3902 100644
--- a/pyecsca/ec/curve.py
+++ b/pyecsca/ec/curve.py
@@ -112,7 +112,7 @@ class EllipticCurve(object):
def to_affine(self) -> "EllipticCurve":
"""Convert this curve into the affine coordinate model, if possible."""
coord_model = AffineCoordinateModel(self.model)
- return EllipticCurve(self.model, coord_model, self.prime, self.neutral.to_affine(), self.parameters) # type: ignore[arg-type]
+ return EllipticCurve(self.model, coord_model, self.prime, self.neutral.to_affine(), self.parameters) # type: ignore[arg-type]
def decode_point(self, encoded: bytes) -> Point:
"""Decode a point encoded as a sequence of bytes (ANSI X9.62)."""
diff --git a/pyecsca/ec/mult.py b/pyecsca/ec/mult.py
index a3622f5..bfaa962 100644
--- a/pyecsca/ec/mult.py
+++ b/pyecsca/ec/mult.py
@@ -35,8 +35,8 @@ class ScalarMultiplier(ABC):
of the point at infinity.
:param formulas: Formulas this instance will use.
"""
- requires: ClassVar[Set[Type]] #Type[Formula] but mypy has a false positive
- optionals: ClassVar[Set[Type]] #Type[Formula] but mypy has a false positive
+ requires: ClassVar[Set[Type]] # Type[Formula] but mypy has a false positive
+ optionals: ClassVar[Set[Type]] # Type[Formula] but mypy has a false positive
short_circuit: bool
formulas: Mapping[str, Formula]
_params: DomainParameters
@@ -408,9 +408,9 @@ class WindowNAFMultiplier(ScalarMultiplier):
current_point = point
double_point = self._dbl(point)
for i in range(0, 2**(self.width - 2)):
- self._points[2*i + 1] = current_point
+ self._points[2 * i + 1] = current_point
if self.precompute_negation:
- self._points_neg[2*i + 1] = self._neg(current_point)
+ self._points_neg[2 * i + 1] = self._neg(current_point)
current_point = self._add(current_point, double_point)
def multiply(self, scalar: int) -> Point:
diff --git a/pyecsca/ec/params.py b/pyecsca/ec/params.py
index 8f5afd6..9f1865f 100644
--- a/pyecsca/ec/params.py
+++ b/pyecsca/ec/params.py
@@ -139,11 +139,11 @@ def get_params(category: str, name: str, coords: str, infty: bool = True) -> Dom
value = Mod(value, field)
infinity_coords[coordinate] = value
infinity = Point(coord_model, **infinity_coords)
- elliptic_curve = EllipticCurve(model, coord_model, field, infinity, params) # type: ignore[arg-type]
+ elliptic_curve = EllipticCurve(model, coord_model, field, infinity, params) # type: ignore[arg-type]
affine = Point(AffineCoordinateModel(model), x=Mod(int(curve["generator"]["x"], 16), field),
y=Mod(int(curve["generator"]["y"], 16), field))
if not isinstance(coord_model, AffineCoordinateModel):
generator = Point.from_affine(coord_model, affine)
else:
generator = affine
- return DomainParameters(elliptic_curve, generator, order, cofactor, name, category) \ No newline at end of file
+ return DomainParameters(elliptic_curve, generator, order, cofactor, name, category)