summaryrefslogtreecommitdiffstats
path: root/test/sha256_test_long_messages.js
blob: eb172fee3b5ccad1773fcbb564a2ffca8d07eb04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
new sjcl.test.TestCase("SHA-256 long messages", function (cb) {
  if (!sjcl.hash.sha256) {
    this.unimplemented();
    cb && cb();
    return;
  }
  
  var i, kat=sjcl.test.vector.sha256long, p=0, f=0;
  for (i=0; i<kat.length; i++) {
    var out = sjcl.hash.sha256.hash(kat[i][0]);
    this.require(sjcl.codec.hex.fromBits(out) == kat[i][1], i);
  }
  cb && cb();
});