mirror of
https://github.com/danog/fast-srp.git
synced 2024-11-30 04:19:18 +01:00
Adjustment for BigInteger.
This commit is contained in:
parent
24a32ff313
commit
0c812b0145
@ -308,8 +308,8 @@ function getM1(params, u_buf, s_buf, A_buf, B_buf, K_buf) {
|
|||||||
assertIsNBuffer(B_buf, params, "B");
|
assertIsNBuffer(B_buf, params, "B");
|
||||||
assertIsBuffer(K_buf, params, "K");
|
assertIsBuffer(K_buf, params, "K");
|
||||||
|
|
||||||
var hN = crypto.createHash(params.hash).update(params.N.toBuffer()).digest();
|
var hN = crypto.createHash(params.hash).update(params.N.toBuffer(true)).digest();
|
||||||
var hG = crypto.createHash(params.hash).update(params.g.toBuffer()).digest();
|
var hG = crypto.createHash(params.hash).update(params.g.toBuffer(true)).digest();
|
||||||
|
|
||||||
for (var i = 0; i < hN.length; i++)
|
for (var i = 0; i < hN.length; i++)
|
||||||
hN[i] ^= hG[i];
|
hN[i] ^= hG[i];
|
||||||
@ -428,7 +428,6 @@ Server.prototype = {
|
|||||||
throw new Error("incomplete protocol");
|
throw new Error("incomplete protocol");
|
||||||
if (!equal(this._private.M1_buf, clientM1_buf))
|
if (!equal(this._private.M1_buf, clientM1_buf))
|
||||||
throw new Error("client did not use the same password");
|
throw new Error("client did not use the same password");
|
||||||
// return this._private.M2_buf;
|
|
||||||
},
|
},
|
||||||
computeK: function computeK() {
|
computeK: function computeK() {
|
||||||
if (this._private.K_buf === undefined)
|
if (this._private.K_buf === undefined)
|
||||||
|
Loading…
Reference in New Issue
Block a user