File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -414,8 +414,13 @@ Point.prototype.eqXToP = function eqXToP(x) {
414
414
if ( this . x . cmp ( rx ) === 0 )
415
415
return true ;
416
416
417
+ var xc = x . clone ( ) ;
417
418
var t = this . curve . redN . redMul ( this . z ) ;
418
419
for ( var i = 1 ; i <= this . curve . _maxwellAdjust ; i ++ ) {
420
+ xc . iadd ( this . curve . n ) ;
421
+ if ( xc . cmp ( this . curve . p ) >= 0 )
422
+ return false ;
423
+
419
424
rx . redIAdd ( t ) ;
420
425
if ( this . x . cmp ( rx ) === 0 )
421
426
return true ;
Original file line number Diff line number Diff line change @@ -910,8 +910,13 @@ JPoint.prototype.eqXToP = function eqXToP(x) {
910
910
if ( this . x . cmp ( rx ) === 0 )
911
911
return true ;
912
912
913
+ var xc = x . clone ( ) ;
913
914
var t = this . curve . redN . redMul ( zs ) ;
914
915
for ( var i = 1 ; i <= this . curve . _maxwellAdjust ; i ++ ) {
916
+ xc . iadd ( this . curve . n ) ;
917
+ if ( xc . cmp ( this . curve . p ) >= 0 )
918
+ return false ;
919
+
915
920
rx . redIAdd ( t ) ;
916
921
if ( this . x . cmp ( rx ) === 0 )
917
922
return true ;
You can’t perform that action at this time.
0 commit comments