diff options
author | Azul <azul@riseup.net> | 2013-06-22 15:14:14 +0200 |
---|---|---|
committer | Azul <azul@riseup.net> | 2013-06-22 15:14:14 +0200 |
commit | 16602079b3cd92ad85f3d4afe57763c029b67ae8 (patch) | |
tree | 007ee4f285db8e955bf77334bf5beb15ebdb2829 /spec | |
parent | fb20ef3060a4e2dc8065f46891ce3b9cd3ef463f (diff) |
refactor: rename constants to calculate and clean up hash usage
Diffstat (limited to 'spec')
-rw-r--r-- | spec/calculate_spec.js (renamed from spec/constants_spec.js) | 12 | ||||
-rw-r--r-- | spec/runner.html | 4 | ||||
-rw-r--r-- | spec/signup_spec.js | 6 |
3 files changed, 11 insertions, 11 deletions
diff --git a/spec/constants_spec.js b/spec/calculate_spec.js index a8aa7fd..f60c343 100644 --- a/spec/constants_spec.js +++ b/spec/calculate_spec.js @@ -1,7 +1,7 @@ -describe("Constants", function() { +describe("Calculate", function() { beforeEach(function() { - constants = new srp.Constants(); + calculate = new srp.Calculate(); }); // login attempt with correct password that failed never the less: @@ -19,17 +19,17 @@ describe("Constants", function() { }; it("calculates the proper A", function() { - expect(constants.calcA(compare.a)).toBe(compare.aa); + expect(calculate.A(compare.a)).toBe(compare.aa); }); it("calculates the right x", function() { - x = constants.calcX("testuser","password","7686acb8") + x = calculate.X("testuser","password","7686acb8") expect(x).toBe('84d6bb567ddf584b1d8c8728289644d45dbfbb02deedd05c0f64db96740f0398'); }); it("calculates the right verifier", function() { - x = constants.calcX(compare.username, compare.password, compare.salt) - expect(constants.calcV(x)).toBe(compare.v); + x = calculate.X(compare.username, compare.password, compare.salt) + expect(calculate.V(x)).toBe(compare.v); }); }); diff --git a/spec/runner.html b/spec/runner.html index e94cd24..3a458df 100644 --- a/spec/runner.html +++ b/spec/runner.html @@ -23,14 +23,14 @@ <script type="text/javascript" src="../lib/jsbn2.js"></script> <script type="text/javascript" src="../src/srp.js"></script> <script type="text/javascript" src="../src/jqueryRest.js"></script> - <script type="text/javascript" src="../src/srp_constants.js"></script> + <script type="text/javascript" src="../src/srp_calculate.js"></script> <script type="text/javascript" src="../src/srp_session.js"></script> <!-- include spec files here... --> <script type="text/javascript" src="helper.js"></script> <script type="text/javascript" src="signup_spec.js"></script> <script type="text/javascript" src="login_spec.js"></script> - <script type="text/javascript" src="constants_spec.js"></script> + <script type="text/javascript" src="calculate_spec.js"></script> <script type="text/javascript" src="session_spec.js"></script> <script type="text/javascript"> diff --git a/spec/signup_spec.js b/spec/signup_spec.js index 70c6823..4f7a65d 100644 --- a/spec/signup_spec.js +++ b/spec/signup_spec.js @@ -9,9 +9,9 @@ describe("Signup with srp var", function() { beforeEach(function() { specHelper.setupFakeXHR.apply(this); - constants = new srp.Constants(); - constants.randomSalt = function() {return "4c78c3f8"}; - srp.session = new srp.Session(undefined, undefined, constants); + calculate = new srp.Calculate(); + calculate.randomSalt = function() {return "4c78c3f8"}; + srp.session = new srp.Session(undefined, undefined, calculate); }); afterEach(function() { |