diff options
author | Steve Thomas <Sc00bz@users.noreply.github.com> | 2015-11-01 14:36:28 -0600 |
---|---|---|
committer | Steve Thomas <Sc00bz@users.noreply.github.com> | 2015-11-01 14:36:28 -0600 |
commit | db7e40d449ab4ae65bacf267b38d1bf836b4fe54 (patch) | |
tree | f6f815673f56490c8ae3bfdc8ed9a5f4d9996f76 /test/scrypt_test.js | |
parent | 025908ef2b091faab75f60188654f789b691ff0d (diff) | |
parent | f9a2494fae0dcddef493de453aa6ab69caa987cf (diff) | |
download | sjcl-db7e40d449ab4ae65bacf267b38d1bf836b4fe54.zip sjcl-db7e40d449ab4ae65bacf267b38d1bf836b4fe54.tar.gz sjcl-db7e40d449ab4ae65bacf267b38d1bf836b4fe54.tar.bz2 |
Merge pull request #1 from bitwiseshiftleft/master
Update
Diffstat (limited to 'test/scrypt_test.js')
-rw-r--r-- | test/scrypt_test.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/scrypt_test.js b/test/scrypt_test.js new file mode 100644 index 0000000..c6aa15c --- /dev/null +++ b/test/scrypt_test.js @@ -0,0 +1,23 @@ +new sjcl.test.TestCase("scrypt", function (cb) { + var self = this; + if (!sjcl.misc.scrypt) { + this.unimplemented(); + cb && cb(); + return; + } + + sjcl.test.vector.scrypt.forEach(function (vect) { + var cand = sjcl.codec.hex.fromBits(sjcl.misc.scrypt( + vect["password"], + vect["salt"], + vect["N"], + vect["r"], + vect["p"], + vect["dkLen"] * 8 + )); + + self.require(vect["expected"] == cand); + }); + + cb && cb(); +}); |