Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var createKey = function(key, decrypt) {
var key01 = Long.fromBits(util.decodeUInt32(key, 4), util.decodeUInt32(key, 0));
var key23 = Long.fromBits(util.decodeUInt32(key, 12), util.decodeUInt32(key, 8));
// var k = this.key = new Array(32);
var k = new Array(32);
var index = 0;
var kInc = 2;
if(decrypt) {
index = index + 30;
kInc = 0 - kInc;
}
// Mix up the key
for(var i = 0; i < ROUNDS; i++) {
var t0 = Long.fromNumber(key01.shiftRightUnsigned(32).getLowBitsUnsigned()
+ key23.shiftRightUnsigned(32).getLowBitsUnsigned()
- s_kc[i]).getLowBitsUnsigned();
var processFilledBuffer = function(self, src, inOff) {
// copies into the block...
for(var i = 0; i < self._state.length; i++) {
self._block[i] = Long.fromBits(util.decodeUInt32(self._buffer, (i * 8) + 4), util.decodeUInt32(self._buffer, (i * 8)));
}
processBlock(self);
self._bufferPos = 0;
for(var i = 0; i < self._buffer.length; i++) self._buffer[i] = 0;
}
var createKey = function(key, decrypt) {
var key01 = Long.fromBits(util.decodeUInt32(key, 4), util.decodeUInt32(key, 0));
var key23 = Long.fromBits(util.decodeUInt32(key, 12), util.decodeUInt32(key, 8));
// var k = this.key = new Array(32);
var k = new Array(32);
var index = 0;
var kInc = 2;
if(decrypt) {
index = index + 30;
kInc = 0 - kInc;
}
// Mix up the key
for(var i = 0; i < ROUNDS; i++) {
var t0 = Long.fromNumber(key01.shiftRightUnsigned(32).getLowBitsUnsigned()
+ key23.shiftRightUnsigned(32).getLowBitsUnsigned()
var packIntoLong = function(b7, b6, b5, b4, b3, b2, b1, b0) {
return Long.fromBits(util.decodeUInt32R([b0, b1, b2, b3], 0), util.decodeUInt32R([b4, b5, b6, b7], 0));
}
SHA384.prototype.processWord = function(src, inOff) {
this.W[this.wOff] = Long.fromBits(util.decodeUInt32(src, inOff + 4), util.decodeUInt32(src, inOff + 0));
if (++this.wOff == 16) {
this.processBlock();
}
}
var inputBufferToCipherInput = function(self) {
for(var i = 0; i < self.cipherStateWords; i++) {
self.cipherInput[i] = Long.fromBits(util.decodeUInt32R(self.inputBuffer, (i * 8) + 0), util.decodeUInt32R(self.inputBuffer, (i * 8) + 4));
}
}
Tiger.prototype.processWord = function(src, inOff) {
this.x[this.xOff++] = Long.fromBits(util.decodeUInt32R(src, inOff + 0), util.decodeUInt32R(src, inOff + 4));
if (this.xOff == this.x.length) {
this.processBlock();
}
this.bOff = Long.ZERO;
}
SHA512.prototype.processWord = function(src, inOff) {
this.W[this.wOff] = Long.fromBits(util.decodeUInt32(src, inOff + 4), util.decodeUInt32(src, inOff + 0));
if (++this.wOff == 16) {
this.processBlock();
}
}