Sha256: 97926be66731d41fa016a4e04a4c91b155f66c150479ae93c8b7caa212c0526a

Contents?: true

Size: 1.14 KB

Versions: 35

Compression:

Stored size: 1.14 KB

Contents

var inherits = require('inherits')
var SHA512 = require('./sha512')
var Hash = require('./hash')
var Buffer = require('safe-buffer').Buffer

var W = new Array(160)

function Sha384 () {
  this.init()
  this._w = W

  Hash.call(this, 128, 112)
}

inherits(Sha384, SHA512)

Sha384.prototype.init = function () {
  this._ah = 0xcbbb9d5d
  this._bh = 0x629a292a
  this._ch = 0x9159015a
  this._dh = 0x152fecd8
  this._eh = 0x67332667
  this._fh = 0x8eb44a87
  this._gh = 0xdb0c2e0d
  this._hh = 0x47b5481d

  this._al = 0xc1059ed8
  this._bl = 0x367cd507
  this._cl = 0x3070dd17
  this._dl = 0xf70e5939
  this._el = 0xffc00b31
  this._fl = 0x68581511
  this._gl = 0x64f98fa7
  this._hl = 0xbefa4fa4

  return this
}

Sha384.prototype._hash = function () {
  var H = Buffer.allocUnsafe(48)

  function writeInt64BE (h, l, offset) {
    H.writeInt32BE(h, offset)
    H.writeInt32BE(l, offset + 4)
  }

  writeInt64BE(this._ah, this._al, 0)
  writeInt64BE(this._bh, this._bl, 8)
  writeInt64BE(this._ch, this._cl, 16)
  writeInt64BE(this._dh, this._dl, 24)
  writeInt64BE(this._eh, this._el, 32)
  writeInt64BE(this._fh, this._fl, 40)

  return H
}

module.exports = Sha384

Version data entries

35 entries across 34 versions & 12 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/sha.js/sha384.js
disco_app-0.18.0 test/dummy/node_modules/sha.js/sha384.js
disco_app-0.18.2 test/dummy/node_modules/sha.js/sha384.js
disco_app-0.16.1 test/dummy/node_modules/sha.js/sha384.js
disco_app-0.15.2 test/dummy/node_modules/sha.js/sha384.js
disco_app-0.18.4 test/dummy/node_modules/sha.js/sha384.js
disco_app-0.18.1 test/dummy/node_modules/sha.js/sha384.js
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/sha.js/sha384.js
disco_app-0.14.0 test/dummy/node_modules/sha.js/sha384.js
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/sha.js/sha384.js
tang-0.2.1 spec/tang_app/node_modules/sha.js/sha384.js
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/sha.js/sha384.js
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/sha.js/sha384.js
ruby2js-4.0.4 lib/tasks/testrails/node_modules/sha.js/sha384.js
ruby2js-4.0.3 lib/tasks/testrails/node_modules/sha.js/sha384.js
tang-0.2.0 spec/tang_app/node_modules/sha.js/sha384.js
tang-0.1.0 spec/tang_app/node_modules/sha.js/sha384.js
tang-0.0.9 spec/tang_app/node_modules/sha.js/sha384.js
enju_library-0.3.8 spec/dummy/node_modules/sha.js/sha384.js
ilog-0.4.1 node_modules/sha.js/sha384.js