Fix references to Bitcoin.BigInteger

This commit is contained in:
Andreas Brekken 2014-01-10 16:16:24 +07:00
parent 26ac76d42c
commit 3e6796a660

View file

@ -376,11 +376,11 @@ ECPointFp.decodeFrom = function (ecparams, enc) {
var xBa = enc.slice(1),
x = BigInteger.fromByteArrayUnsigned(xBa),
p = ecparams.getQ(),
xCubedPlus7 = x.multiply(x).multiply(x).add(new Bitcoin.BigInteger('7')).mod(p),
pPlus1Over4 = p.add(new Bitcoin.BigInteger('1'))
.divide(new Bitcoin.BigInteger('4')),
xCubedPlus7 = x.multiply(x).multiply(x).add(new BigInteger('7')).mod(p),
pPlus1Over4 = p.add(new BigInteger('1'))
.divide(new BigInteger('4')),
y = xCubedPlus7.modPow(pPlus1Over4,p);
if (y.mod(new Bitcoin.BigInteger('2')).toString() != ''+(type % 2)) {
if (y.mod(new BigInteger('2')).toString() != ''+(type % 2)) {
y = p.subtract(y)
}
}