diff options
Diffstat (limited to 'test/sha512_test.js')
-rw-r--r-- | test/sha512_test.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/sha512_test.js b/test/sha512_test.js new file mode 100644 index 0000000..85fee06 --- /dev/null +++ b/test/sha512_test.js @@ -0,0 +1,14 @@ +new sjcl.test.TestCase("SHA-512 from catameringue", function (cb) { + if (!sjcl.hash.sha512) { + this.unimplemented(); + cb && cb(); + return; + } + + var i, kat=sjcl.test.vector.sha512, p=0, f=0; + for (i=0; i<kat.length; i++) { + var out = sjcl.hash.sha512.hash(kat[i][0]); + this.require(sjcl.codec.hex.fromBits(out) == kat[i][1], i); + } + cb && cb(); +}); |