Skip to content

Point at infinity representation in elliptic curve operations #3

@marcbeep

Description

@marcbeep

Hi, I have a question about the elliptic curve implementation in SecP256.cs.

The code represents the point at infinity as

static BigIntegerPoint ZERO = new BigIntegerPoint(); // Creates (0,0)

However, testing this...

var pointAtInfinity = new BigIntegerPoint();
bool isValid = SecP256.IsOnCurve(pointAtInfinity); // Returns false

For secp256r1, the curve equation is y² = x³ + ax + b where b ≠ 0.
For point (0,0): 0² ≟ 0³ + a(0) + b = b
Since b ≠ 0, point (0,0) should not be considered on the curve.

  1. Is this the intended behavior for representing the point at infinity?
  2. Could the point.Y == 0 check in Add/Double methods cause issues with legitimate curve points that have Y=0?

I might be missing something. Thanks for maintaining this, let me know how I can help if needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions