bn.js icon indicating copy to clipboard operation
bn.js copied to clipboard

redSqrt function seems error

Open wz003 opened this issue 6 years ago • 2 comments

a Red { m: <BN: b>, prime: null } tmp = new BN(2).toRed(a) <BN-R: 2> tmp.redSqrt() <BN-R: 8>

2 doesn't have quadratic residue in (mod 11), but it return 8

is there a bug or am I misunderstanding this function?

wz003 avatar Mar 25 '18 15:03 wz003

@indutny any insight here?

dcousens avatar Jun 06 '18 05:06 dcousens

I think it works only with prime modulo.

indutny avatar Jun 08 '18 14:06 indutny