This commit is contained in:
Dmitry Vagner 2022-12-05 14:31:05 -08:00
parent 57252c7fd2
commit 0ced2b3e06
2 changed files with 3 additions and 3 deletions

View File

@ -83,7 +83,7 @@ global ec_add_valid_points:
// stack: x0, x1, y0 - y1, x0, y0, x1, y1, retdest
%submod
// stack: x0 - x1, y0 - y1, x0, y0, x1, y1, retdest
%moddiv
%divfp254
// stack: lambda, x0, y0, x1, y1, retdest
%jump(ec_add_valid_points_with_lambda)
@ -201,7 +201,7 @@ ec_add_equal_points:
// stack: 3/2 * x0^2, x0, y0, x1, y1, retdest
DUP3
// stack: y0, 3/2 * x0^2, x0, y0, x1, y1, retdest
%moddiv
%divfp254
// stack: lambda, x0, y0, x1, y1, retdest
%jump(ec_add_valid_points_with_lambda)

View File

@ -1,7 +1,7 @@
/// Division modulo 0x30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47, the BN254 base field order
// Returns y * (x^-1) where the inverse is taken modulo N
%macro moddiv
%macro divfp254
// stack: x , y
%inverse
// stack: x^-1, y