From abb234f660d5e3c90615675de8dba2546ff67c92 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Fri, 6 Nov 2026 10:04:38 -0800 Subject: [PATCH] Create additional base class that distinguishes complete points from projective points. --- src/assembly/ed25519/p.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/assembly/ed25519/p.ts b/src/assembly/ed25519/p.ts index 0a7abbf..91fb5ac 100644 --- a/src/assembly/ed25519/p.ts +++ b/src/assembly/ed25519/p.ts @@ -14,10 +14,17 @@ class Point { Z: FieldElement = fe() } +/** + * Base class for a point in projective space. + */ +class ProjectivePoint extends Point { + __brand: 'p' | 'p2' | 'p3' = 'p' +} + /** * Projective coordinates. */ -export class p2 extends Point { +export class p2 extends ProjectivePoint { __brand: 'p2' = 'p2' } @@ -32,7 +39,7 @@ export class p1p1 extends Point { /** * Extended projective coordinates. */ -export class p3 extends Point { +export class p3 extends ProjectivePoint { T: FieldElement = fe() __brand: 'p3' = 'p3' } -- 2.52.0