diff --git a/test/srp_test.js b/test/srp_test.js new file mode 100644 index 0000000..bbbd928 --- /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 0000000..9759ecd --- /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 +} +]