From 909a503be07f2dbd07f22b21ed16abcbfe84c6a6 Mon Sep 17 00:00:00 2001 From: Quinn Slack Date: Tue, 19 Apr 2011 01:43:21 -0700 Subject: [PATCH] SRP tests --- test/srp_test.js | 19 +++++++++++++++++++ test/srp_vectors.js | 9 +++++++++ 2 files changed, 28 insertions(+) create mode 100644 test/srp_test.js create mode 100644 test/srp_vectors.js diff --git a/test/srp_test.js b/test/srp_test.js new file mode 100644 index 00000000..bbbd9281 --- /dev/null +++ b/test/srp_test.js @@ -0,0 +1,19 @@ +new sjcl.test.TestCase("SRP known-answer (RFC 5054) tests", function (cb) { + if (!sjcl.keyexchange.srp) { + this.unimplemented(); + cb && cb(); + return; + } + + var i, kat = sjcl.test.vector.srp, tv, N, g, v; + + for (i=0; i v = " + v); + this.require(sjcl.bitArray.equal(v, tv.v), "srpv #"+i); + } + cb && cb(); +}); diff --git a/test/srp_vectors.js b/test/srp_vectors.js new file mode 100644 index 00000000..9759ecde --- /dev/null +++ b/test/srp_vectors.js @@ -0,0 +1,9 @@ +/* Official SRP test vectors. */ +sjcl.test.vector.srp = [ +{ I: "alice", + P: "password123", + s: "BEB25379D1A8581EB5A727673A2441EE", + v: "7E273DE8696FFC4F4E337D05B4B375BEB0DDE1569E8FA00A9886D8129BADA1F1822223CA1A605B530E379BA4729FDC59F105B4787E5186F5C671085A1447B52A48CF1970B4FB6F8400BBF4CEBFBB168152E08AB5EA53D15C1AFF87B2B9DA6E04E058AD51CC72BFC9033B564E26480D78E955A5E29E7AB245DB2BE315E2099AFB", + known_group_size: 1024 +} +]