From 57da29902f1358e6f1c4d57403af4077becaa363 Mon Sep 17 00:00:00 2001 From: Quinn Slack Date: Tue, 19 Apr 2011 16:26:44 -0700 Subject: [PATCH] SRP group as object --- core/srp.js | 4 ++-- test/srp_test.js | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/core/srp.js b/core/srp.js index 417cd5e..814f324 100644 --- a/core/srp.js +++ b/core/srp.js @@ -8,13 +8,13 @@ * @class SRP */ sjcl.keyexchange.srp = { - makeVerifier: function(I, P, s, N, g) { + makeVerifier: function(I, P, s, group) { var x; // From RFC 5054: // v = g^x mod N x = this.makeX(I, P, s); x = sjcl.bn.fromBits(x); - return g.powermod(x, N); + return group.g.powermod(x, group.N); }, makeX: function(I, P, s) { diff --git a/test/srp_test.js b/test/srp_test.js index d5219e7..8a40b87 100644 --- a/test/srp_test.js +++ b/test/srp_test.js @@ -5,17 +5,16 @@ new sjcl.test.TestCase("SRP known-answer (RFC 5054) tests", function (cb) { return; } - var i, kat = sjcl.test.vector.srp, tv, N, g, v, x; + var i, kat = sjcl.test.vector.srp, tv, group, v, x; for (i=0; i