INNER CODE UNIT · Python

evaluate

AntonKueltz/fastecdsa · fastecdsa/curve.py:115

    def evaluate(self, x: int) -> int:
        r"""Evaluate the elliptic curve polynomial at 'x'

        Args:
            x (int): The position to evaluate the polynomial at

        Returns:
            int: the value of :math:`(x^3 + ax + b) \bmod{p}`
        """
        return (x**3 + self.a * x + self.b) % self.p

    @property
    def G(self) -> Point:
        """The base point of the curve.

        For the purposes of ECDSA this point is multiplied by a private key to obtain the
        corresponding public key. Make a property to avoid cyclic dependency of Point on Curve
        (a point lies on a curve) and Curve on Point (curves have a base point).

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…