Skip to content

Commit a6bff8a

Browse files
committed
fix: instantiate proper zero point
1 parent e7913b1 commit a6bff8a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

zkir/Dialect/EllipticCurve/Conversions/EllipticCurveToField/EllipticCurveToField.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,12 +506,13 @@ struct ConvertScalarMul : public OpConversionPattern<ScalarMulOp> {
506506
auto scalar = b.create<field::ExtractOp>(signlessIntType, scalarPF);
507507

508508
auto zeroPF = b.create<field::ConstantOp>(baseFieldType, 0);
509+
auto onePF = b.create<field::ConstantOp>(baseFieldType, 1);
509510
Value zeroPoint =
510511
isa<XYZZType>(outputType)
511512
? b.create<elliptic_curve::PointOp>(
512-
outputType, ValueRange{zeroPF, zeroPF, zeroPF, zeroPF})
513+
outputType, ValueRange{onePF, onePF, zeroPF, zeroPF})
513514
: b.create<elliptic_curve::PointOp>(
514-
outputType, ValueRange{zeroPF, zeroPF, zeroPF});
515+
outputType, ValueRange{onePF, onePF, zeroPF});
515516

516517
Value intialPoint =
517518
isa<AffineType>(pointType)

0 commit comments

Comments
 (0)