summaryrefslogtreecommitdiffstats
path: root/node_modules/hash.js
diff options
context:
space:
mode:
authorGravatar Piotr Russ <mail@pruss.it> 2020-11-18 23:26:45 +0100
committerGravatar Piotr Russ <mail@pruss.it> 2020-11-18 23:26:45 +0100
commit81ddf9b700bc48a1f8e472209f080f9c1d9a9b09 (patch)
tree8b959d50c5a614cbf9fcb346ed556140374d4b6d /node_modules/hash.js
parent1870f3fdf43707a15fda0f609a021f516f45eb63 (diff)
downloadwebsite_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.gz
website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.bz2
website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.zip
rm node_modules
Diffstat (limited to 'node_modules/hash.js')
-rw-r--r--node_modules/hash.js/.eslintrc.js41
-rw-r--r--node_modules/hash.js/.travis.yml10
-rw-r--r--node_modules/hash.js/README.md48
-rw-r--r--node_modules/hash.js/lib/hash.d.ts106
-rw-r--r--node_modules/hash.js/lib/hash.js15
-rw-r--r--node_modules/hash.js/lib/hash/common.js92
-rw-r--r--node_modules/hash.js/lib/hash/hmac.js47
-rw-r--r--node_modules/hash.js/lib/hash/ripemd.js146
-rw-r--r--node_modules/hash.js/lib/hash/sha.js7
-rw-r--r--node_modules/hash.js/lib/hash/sha/1.js74
-rw-r--r--node_modules/hash.js/lib/hash/sha/224.js30
-rw-r--r--node_modules/hash.js/lib/hash/sha/256.js105
-rw-r--r--node_modules/hash.js/lib/hash/sha/384.js35
-rw-r--r--node_modules/hash.js/lib/hash/sha/512.js330
-rw-r--r--node_modules/hash.js/lib/hash/sha/common.js49
-rw-r--r--node_modules/hash.js/lib/hash/utils.js278
-rw-r--r--node_modules/hash.js/package.json64
-rw-r--r--node_modules/hash.js/test/hash-test.js140
-rw-r--r--node_modules/hash.js/test/hmac-test.js62
19 files changed, 0 insertions, 1679 deletions
diff --git a/node_modules/hash.js/.eslintrc.js b/node_modules/hash.js/.eslintrc.js
deleted file mode 100644
index 614f8fc..0000000
--- a/node_modules/hash.js/.eslintrc.js
+++ /dev/null
@@ -1,41 +0,0 @@
-module.exports = {
- 'env': {
- 'browser': true,
- 'commonjs': true,
- 'node': true,
- 'es6': true
- },
- 'parserOptions': {
- 'ecmaVersion': 8
- },
- 'extends': 'eslint:recommended',
- 'rules': {
- 'indent': [
- 'error',
- 2,
- {
- 'FunctionDeclaration': {
- 'parameters': 'first'
- },
- 'FunctionExpression': {
- 'parameters': 'first'
- },
- 'CallExpression': {
- 'arguments': 'first'
- }
- }
- ],
- 'linebreak-style': [
- 'error',
- 'unix'
- ],
- 'quotes': [
- 'error',
- 'single'
- ],
- 'semi': [
- 'error',
- 'always'
- ]
- }
-};
diff --git a/node_modules/hash.js/.travis.yml b/node_modules/hash.js/.travis.yml
deleted file mode 100644
index 5406edc..0000000
--- a/node_modules/hash.js/.travis.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-sudo: false
-language: node_js
-node_js:
- - "6"
- - "8"
- - "10"
- - "stable"
-branches:
- only:
- - master
diff --git a/node_modules/hash.js/README.md b/node_modules/hash.js/README.md
deleted file mode 100644
index 006d3bb..0000000
--- a/node_modules/hash.js/README.md
+++ /dev/null
@@ -1,48 +0,0 @@
-# hash.js [![Build Status](https://secure.travis-ci.org/indutny/hash.js.svg)](http://travis-ci.org/indutny/hash.js)
-
-Just a bike-shed.
-
-## Install
-
-```sh
-npm install hash.js
-```
-
-## Usage
-
-```js
-var hash = require('hash.js')
-hash.sha256().update('abc').digest('hex')
-```
-
-## Selective hash usage
-
-```js
-var sha512 = require('hash.js/lib/hash/sha/512');
-sha512().update('abc').digest('hex');
-```
-
-#### LICENSE
-
-This software is licensed under the MIT License.
-
-Copyright Fedor Indutny, 2014.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to permit
-persons to whom the Software is furnished to do so, subject to the
-following conditions:
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/hash.js/lib/hash.d.ts b/node_modules/hash.js/lib/hash.d.ts
deleted file mode 100644
index abbb5c5..0000000
--- a/node_modules/hash.js/lib/hash.d.ts
+++ /dev/null
@@ -1,106 +0,0 @@
-declare var hash: Hash;
-
-declare module "hash.js" {
- export = hash;
-}
-
-interface BlockHash<T> {
- hmacStrength: number
- padLength: number
- endian: 'big' | 'little'
-}
-
-interface MessageDigest<T> {
- blockSize: number
- outSize: number
- update(msg: any, enc?: 'hex'): T
- digest(): number[]
- digest(enc: 'hex'): string
-}
-
-interface Hash {
- hmac: HmacConstructor
- ripemd: RipemdSet
- ripemd160: Ripemd160Constructor
- sha: ShaSet
- sha1: Sha1Constructor
- sha224: Sha224Constructor
- sha256: Sha256Constructor
- sha384: Sha384Constructor
- sha512: Sha512Constructor
- utils: Utils
-}
-
-interface Utils {
- toArray(msg: any, enc: 'hex'): Array<number>
- toHex(msg: any): string
-}
-
-interface RipemdSet {
- ripemd160: Ripemd160Constructor
-}
-
-interface ShaSet {
- sha1: Sha1Constructor
- sha224: Sha224Constructor
- sha256: Sha256Constructor
- sha384: Sha384Constructor
- sha512: Sha512Constructor
-}
-
-interface HmacConstructor { (hash: BlockHash<any>, key: any, enc?: 'hex'): Hmac }
-interface Ripemd160Constructor { (): Ripemd160 }
-interface Sha1Constructor { (): Sha1; }
-interface Sha224Constructor { (): Sha224; }
-interface Sha256Constructor { (): Sha256; }
-interface Sha384Constructor { (): Sha384; }
-interface Sha512Constructor { (): Sha512; }
-
-interface Hmac extends MessageDigest<Hmac> {
- blockSize: 512
- outSize: 160
-}
-
-interface Ripemd160 extends BlockHash<Ripemd160>, MessageDigest<Ripemd160> {
- blockSize: 512
- hmacStrength: 192
- outSize: 160
- padLength: 64
- endian: 'little'
-}
-
-interface Sha1 extends BlockHash<Sha1>, MessageDigest<Sha1> {
- blockSize: 512
- hmacStrength: 80
- outSize: 160
- padLength: 64
- endian: 'big'
-}
-interface Sha224 extends BlockHash<Sha224>, MessageDigest<Sha224> {
- blockSize: 512
- hmacStrength: 192
- outSize: 224
- padLength: 64
- endian: 'big'
-}
-interface Sha256 extends BlockHash<Sha256>, MessageDigest<Sha256> {
- blockSize: 512
- hmacStrength: 192
- outSize: 256
- padLength: 64
- endian: 'big'
-}
-interface Sha384 extends BlockHash<Sha384>, MessageDigest<Sha384> {
- blockSize: 1024
- hmacStrength: 192
- outSize: 384
- padLength: 128
- endian: 'big'
-}
-interface Sha512 extends BlockHash<Sha512>, MessageDigest<Sha512> {
- blockSize: 1024
- hmacStrength: 192
- outSize: 512
- padLength: 128
- endian: 'big'
-}
diff --git a/node_modules/hash.js/lib/hash.js b/node_modules/hash.js/lib/hash.js
deleted file mode 100644
index f59b673..0000000
--- a/node_modules/hash.js/lib/hash.js
+++ /dev/null
@@ -1,15 +0,0 @@
-var hash = exports;
-
-hash.utils = require('./hash/utils');
-hash.common = require('./hash/common');
-hash.sha = require('./hash/sha');
-hash.ripemd = require('./hash/ripemd');
-hash.hmac = require('./hash/hmac');
-
-// Proxy hash functions to the main object
-hash.sha1 = hash.sha.sha1;
-hash.sha256 = hash.sha.sha256;
-hash.sha224 = hash.sha.sha224;
-hash.sha384 = hash.sha.sha384;
-hash.sha512 = hash.sha.sha512;
-hash.ripemd160 = hash.ripemd.ripemd160;
diff --git a/node_modules/hash.js/lib/hash/common.js b/node_modules/hash.js/lib/hash/common.js
deleted file mode 100644
index c49f476..0000000
--- a/node_modules/hash.js/lib/hash/common.js
+++ /dev/null
@@ -1,92 +0,0 @@
-'use strict';
-
-var utils = require('./utils');
-var assert = require('minimalistic-assert');
-
-function BlockHash() {
- this.pending = null;
- this.pendingTotal = 0;
- this.blockSize = this.constructor.blockSize;
- this.outSize = this.constructor.outSize;
- this.hmacStrength = this.constructor.hmacStrength;
- this.padLength = this.constructor.padLength / 8;
- this.endian = 'big';
-
- this._delta8 = this.blockSize / 8;
- this._delta32 = this.blockSize / 32;
-}
-exports.BlockHash = BlockHash;
-
-BlockHash.prototype.update = function update(msg, enc) {
- // Convert message to array, pad it, and join into 32bit blocks
- msg = utils.toArray(msg, enc);
- if (!this.pending)
- this.pending = msg;
- else
- this.pending = this.pending.concat(msg);
- this.pendingTotal += msg.length;
-
- // Enough data, try updating
- if (this.pending.length >= this._delta8) {
- msg = this.pending;
-
- // Process pending data in blocks
- var r = msg.length % this._delta8;
- this.pending = msg.slice(msg.length - r, msg.length);
- if (this.pending.length === 0)
- this.pending = null;
-
- msg = utils.join32(msg, 0, msg.length - r, this.endian);
- for (var i = 0; i < msg.length; i += this._delta32)
- this._update(msg, i, i + this._delta32);
- }
-
- return this;
-};
-
-BlockHash.prototype.digest = function digest(enc) {
- this.update(this._pad());
- assert(this.pending === null);
-
- return this._digest(enc);
-};
-
-BlockHash.prototype._pad = function pad() {
- var len = this.pendingTotal;
- var bytes = this._delta8;
- var k = bytes - ((len + this.padLength) % bytes);
- var res = new Array(k + this.padLength);
- res[0] = 0x80;
- for (var i = 1; i < k; i++)
- res[i] = 0;
-
- // Append length
- len <<= 3;
- if (this.endian === 'big') {
- for (var t = 8; t < this.padLength; t++)
- res[i++] = 0;
-
- res[i++] = 0;
- res[i++] = 0;
- res[i++] = 0;
- res[i++] = 0;
- res[i++] = (len >>> 24) & 0xff;
- res[i++] = (len >>> 16) & 0xff;
- res[i++] = (len >>> 8) & 0xff;
- res[i++] = len & 0xff;
- } else {
- res[i++] = len & 0xff;
- res[i++] = (len >>> 8) & 0xff;
- res[i++] = (len >>> 16) & 0xff;
- res[i++] = (len >>> 24) & 0xff;
- res[i++] = 0;
- res[i++] = 0;
- res[i++] = 0;
- res[i++] = 0;
-
- for (t = 8; t < this.padLength; t++)
- res[i++] = 0;
- }
-
- return res;
-};
diff --git a/node_modules/hash.js/lib/hash/hmac.js b/node_modules/hash.js/lib/hash/hmac.js
deleted file mode 100644
index faff12d..0000000
--- a/node_modules/hash.js/lib/hash/hmac.js
+++ /dev/null
@@ -1,47 +0,0 @@
-'use strict';
-
-var utils = require('./utils');
-var assert = require('minimalistic-assert');
-
-function Hmac(hash, key, enc) {
- if (!(this instanceof Hmac))
- return new Hmac(hash, key, enc);
- this.Hash = hash;
- this.blockSize = hash.blockSize / 8;
- this.outSize = hash.outSize / 8;
- this.inner = null;
- this.outer = null;
-
- this._init(utils.toArray(key, enc));
-}
-module.exports = Hmac;
-
-Hmac.prototype._init = function init(key) {
- // Shorten key, if needed
- if (key.length > this.blockSize)
- key = new this.Hash().update(key).digest();
- assert(key.length <= this.blockSize);
-
- // Add padding to key
- for (var i = key.length; i < this.blockSize; i++)
- key.push(0);
-
- for (i = 0; i < key.length; i++)
- key[i] ^= 0x36;
- this.inner = new this.Hash().update(key);
-
- // 0x36 ^ 0x5c = 0x6a
- for (i = 0; i < key.length; i++)
- key[i] ^= 0x6a;
- this.outer = new this.Hash().update(key);
-};
-
-Hmac.prototype.update = function update(msg, enc) {
- this.inner.update(msg, enc);
- return this;
-};
-
-Hmac.prototype.digest = function digest(enc) {
- this.outer.update(this.inner.digest());
- return this.outer.digest(enc);
-};
diff --git a/node_modules/hash.js/lib/hash/ripemd.js b/node_modules/hash.js/lib/hash/ripemd.js
deleted file mode 100644
index 2dcdff2..0000000
--- a/node_modules/hash.js/lib/hash/ripemd.js
+++ /dev/null
@@ -1,146 +0,0 @@
-'use strict';
-
-var utils = require('./utils');
-var common = require('./common');
-
-var rotl32 = utils.rotl32;
-var sum32 = utils.sum32;
-var sum32_3 = utils.sum32_3;
-var sum32_4 = utils.sum32_4;
-var BlockHash = common.BlockHash;
-
-function RIPEMD160() {
- if (!(this instanceof RIPEMD160))
- return new RIPEMD160();
-
- BlockHash.call(this);
-
- this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ];
- this.endian = 'little';
-}
-utils.inherits(RIPEMD160, BlockHash);
-exports.ripemd160 = RIPEMD160;
-
-RIPEMD160.blockSize = 512;
-RIPEMD160.outSize = 160;
-RIPEMD160.hmacStrength = 192;
-RIPEMD160.padLength = 64;
-
-RIPEMD160.prototype._update = function update(msg, start) {
- var A = this.h[0];
- var B = this.h[1];
- var C = this.h[2];
- var D = this.h[3];
- var E = this.h[4];
- var Ah = A;
- var Bh = B;
- var Ch = C;
- var Dh = D;
- var Eh = E;
- for (var j = 0; j < 80; j++) {
- var T = sum32(
- rotl32(
- sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)),
- s[j]),
- E);
- A = E;
- E = D;
- D = rotl32(C, 10);
- C = B;
- B = T;
- T = sum32(
- rotl32(
- sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)),
- sh[j]),
- Eh);
- Ah = Eh;
- Eh = Dh;
- Dh = rotl32(Ch, 10);
- Ch = Bh;
- Bh = T;
- }
- T = sum32_3(this.h[1], C, Dh);
- this.h[1] = sum32_3(this.h[2], D, Eh);
- this.h[2] = sum32_3(this.h[3], E, Ah);
- this.h[3] = sum32_3(this.h[4], A, Bh);
- this.h[4] = sum32_3(this.h[0], B, Ch);
- this.h[0] = T;
-};
-
-RIPEMD160.prototype._digest = function digest(enc) {
- if (enc === 'hex')
- return utils.toHex32(this.h, 'little');
- else
- return utils.split32(this.h, 'little');
-};
-
-function f(j, x, y, z) {
- if (j <= 15)
- return x ^ y ^ z;
- else if (j <= 31)
- return (x & y) | ((~x) & z);
- else if (j <= 47)
- return (x | (~y)) ^ z;
- else if (j <= 63)
- return (x & z) | (y & (~z));
- else
- return x ^ (y | (~z));
-}
-
-function K(j) {
- if (j <= 15)
- return 0x00000000;
- else if (j <= 31)
- return 0x5a827999;
- else if (j <= 47)
- return 0x6ed9eba1;
- else if (j <= 63)
- return 0x8f1bbcdc;
- else
- return 0xa953fd4e;
-}
-
-function Kh(j) {
- if (j <= 15)
- return 0x50a28be6;
- else if (j <= 31)
- return 0x5c4dd124;
- else if (j <= 47)
- return 0x6d703ef3;
- else if (j <= 63)
- return 0x7a6d76e9;
- else
- return 0x00000000;
-}
-
-var r = [
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
- 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
- 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
- 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13
-];
-
-var rh = [
- 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
- 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
- 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
- 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
- 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11
-];
-
-var s = [
- 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
- 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
- 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
- 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
- 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6
-];
-
-var sh = [
- 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
- 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
- 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
- 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
- 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11
-];
diff --git a/node_modules/hash.js/lib/hash/sha.js b/node_modules/hash.js/lib/hash/sha.js
deleted file mode 100644
index f34a38d..0000000
--- a/node_modules/hash.js/lib/hash/sha.js
+++ /dev/null
@@ -1,7 +0,0 @@
-'use strict';
-
-exports.sha1 = require('./sha/1');
-exports.sha224 = require('./sha/224');
-exports.sha256 = require('./sha/256');
-exports.sha384 = require('./sha/384');
-exports.sha512 = require('./sha/512');
diff --git a/node_modules/hash.js/lib/hash/sha/1.js b/node_modules/hash.js/lib/hash/sha/1.js
deleted file mode 100644
index fcdfa29..0000000
--- a/node_modules/hash.js/lib/hash/sha/1.js
+++ /dev/null
@@ -1,74 +0,0 @@
-'use strict';
-
-var utils = require('../utils');
-var common = require('../common');
-var shaCommon = require('./common');
-
-var rotl32 = utils.rotl32;
-var sum32 = utils.sum32;
-var sum32_5 = utils.sum32_5;
-var ft_1 = shaCommon.ft_1;
-var BlockHash = common.BlockHash;
-
-var sha1_K = [
- 0x5A827999, 0x6ED9EBA1,
- 0x8F1BBCDC, 0xCA62C1D6
-];
-
-function SHA1() {
- if (!(this instanceof SHA1))
- return new SHA1();
-
- BlockHash.call(this);
- this.h = [
- 0x67452301, 0xefcdab89, 0x98badcfe,
- 0x10325476, 0xc3d2e1f0 ];
- this.W = new Array(80);
-}
-
-utils.inherits(SHA1, BlockHash);
-module.exports = SHA1;
-
-SHA1.blockSize = 512;
-SHA1.outSize = 160;
-SHA1.hmacStrength = 80;
-SHA1.padLength = 64;
-
-SHA1.prototype._update = function _update(msg, start) {
- var W = this.W;
-
- for (var i = 0; i < 16; i++)
- W[i] = msg[start + i];
-
- for(; i < W.length; i++)
- W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);
-
- var a = this.h[0];
- var b = this.h[1];
- var c = this.h[2];
- var d = this.h[3];
- var e = this.h[4];
-
- for (i = 0; i < W.length; i++) {
- var s = ~~(i / 20);
- var t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]);
- e = d;
- d = c;
- c = rotl32(b, 30);
- b = a;
- a = t;
- }
-
- this.h[0] = sum32(this.h[0], a);
- this.h[1] = sum32(this.h[1], b);
- this.h[2] = sum32(this.h[2], c);
- this.h[3] = sum32(this.h[3], d);
- this.h[4] = sum32(this.h[4], e);
-};
-
-SHA1.prototype._digest = function digest(enc) {
- if (enc === 'hex')
- return utils.toHex32(this.h, 'big');
- else
- return utils.split32(this.h, 'big');
-};
diff --git a/node_modules/hash.js/lib/hash/sha/224.js b/node_modules/hash.js/lib/hash/sha/224.js
deleted file mode 100644
index c69882d..0000000
--- a/node_modules/hash.js/lib/hash/sha/224.js
+++ /dev/null
@@ -1,30 +0,0 @@
-'use strict';
-
-var utils = require('../utils');
-var SHA256 = require('./256');
-
-function SHA224() {
- if (!(this instanceof SHA224))
- return new SHA224();
-
- SHA256.call(this);
- this.h = [
- 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,
- 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 ];
-}
-utils.inherits(SHA224, SHA256);
-module.exports = SHA224;
-
-SHA224.blockSize = 512;
-SHA224.outSize = 224;
-SHA224.hmacStrength = 192;
-SHA224.padLength = 64;
-
-SHA224.prototype._digest = function digest(enc) {
- // Just truncate output
- if (enc === 'hex')
- return utils.toHex32(this.h.slice(0, 7), 'big');
- else
- return utils.split32(this.h.slice(0, 7), 'big');
-};
-
diff --git a/node_modules/hash.js/lib/hash/sha/256.js b/node_modules/hash.js/lib/hash/sha/256.js
deleted file mode 100644
index 6dbd6a0..0000000
--- a/node_modules/hash.js/lib/hash/sha/256.js
+++ /dev/null
@@ -1,105 +0,0 @@
-'use strict';
-
-var utils = require('../utils');
-var common = require('../common');
-var shaCommon = require('./common');
-var assert = require('minimalistic-assert');
-
-var sum32 = utils.sum32;
-var sum32_4 = utils.sum32_4;
-var sum32_5 = utils.sum32_5;
-var ch32 = shaCommon.ch32;
-var maj32 = shaCommon.maj32;
-var s0_256 = shaCommon.s0_256;
-var s1_256 = shaCommon.s1_256;
-var g0_256 = shaCommon.g0_256;
-var g1_256 = shaCommon.g1_256;
-
-var BlockHash = common.BlockHash;
-
-var sha256_K = [
- 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
- 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
- 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
- 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
- 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
- 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
- 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,
- 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
- 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
- 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
- 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,
- 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
- 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,
- 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
- 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
- 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
-];
-
-function SHA256() {
- if (!(this instanceof SHA256))
- return new SHA256();
-
- BlockHash.call(this);
- this.h = [
- 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
- 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19
- ];
- this.k = sha256_K;
- this.W = new Array(64);
-}
-utils.inherits(SHA256, BlockHash);
-module.exports = SHA256;
-
-SHA256.blockSize = 512;
-SHA256.outSize = 256;
-SHA256.hmacStrength = 192;
-SHA256.padLength = 64;
-
-SHA256.prototype._update = function _update(msg, start) {
- var W = this.W;
-
- for (var i = 0; i < 16; i++)
- W[i] = msg[start + i];
- for (; i < W.length; i++)
- W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);
-
- var a = this.h[0];
- var b = this.h[1];
- var c = this.h[2];
- var d = this.h[3];
- var e = this.h[4];
- var f = this.h[5];
- var g = this.h[6];
- var h = this.h[7];
-
- assert(this.k.length === W.length);
- for (i = 0; i < W.length; i++) {
- var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]);
- var T2 = sum32(s0_256(a), maj32(a, b, c));
- h = g;
- g = f;
- f = e;
- e = sum32(d, T1);
- d = c;
- c = b;
- b = a;
- a = sum32(T1, T2);
- }
-
- this.h[0] = sum32(this.h[0], a);
- this.h[1] = sum32(this.h[1], b);
- this.h[2] = sum32(this.h[2], c);
- this.h[3] = sum32(this.h[3], d);
- this.h[4] = sum32(this.h[4], e);
- this.h[5] = sum32(this.h[5], f);
- this.h[6] = sum32(this.h[6], g);
- this.h[7] = sum32(this.h[7], h);
-};
-
-SHA256.prototype._digest = function digest(enc) {
- if (enc === 'hex')
- return utils.toHex32(this.h, 'big');
- else
- return utils.split32(this.h, 'big');
-};
diff --git a/node_modules/hash.js/lib/hash/sha/384.js b/node_modules/hash.js/lib/hash/sha/384.js
deleted file mode 100644
index 01df256..0000000
--- a/node_modules/hash.js/lib/hash/sha/384.js
+++ /dev/null
@@ -1,35 +0,0 @@
-'use strict';
-
-var utils = require('../utils');
-
-var SHA512 = require('./512');
-
-function SHA384() {
- if (!(this instanceof SHA384))
- return new SHA384();
-
- SHA512.call(this);
- this.h = [
- 0xcbbb9d5d, 0xc1059ed8,
- 0x629a292a, 0x367cd507,
- 0x9159015a, 0x3070dd17,
- 0x152fecd8, 0xf70e5939,
- 0x67332667, 0xffc00b31,
- 0x8eb44a87, 0x68581511,
- 0xdb0c2e0d, 0x64f98fa7,
- 0x47b5481d, 0xbefa4fa4 ];
-}
-utils.inherits(SHA384, SHA512);
-module.exports = SHA384;
-
-SHA384.blockSize = 1024;
-SHA384.outSize = 384;
-SHA384.hmacStrength = 192;
-SHA384.padLength = 128;
-
-SHA384.prototype._digest = function digest(enc) {
- if (enc === 'hex')
- return utils.toHex32(this.h.slice(0, 12), 'big');
- else
- return utils.split32(this.h.slice(0, 12), 'big');
-};
diff --git a/node_modules/hash.js/lib/hash/sha/512.js b/node_modules/hash.js/lib/hash/sha/512.js
deleted file mode 100644
index c371a25..0000000
--- a/node_modules/hash.js/lib/hash/sha/512.js
+++ /dev/null
@@ -1,330 +0,0 @@
-'use strict';
-
-var utils = require('../utils');
-var common = require('../common');
-var assert = require('minimalistic-assert');
-
-var rotr64_hi = utils.rotr64_hi;
-var rotr64_lo = utils.rotr64_lo;
-var shr64_hi = utils.shr64_hi;
-var shr64_lo = utils.shr64_lo;
-var sum64 = utils.sum64;
-var sum64_hi = utils.sum64_hi;
-var sum64_lo = utils.sum64_lo;
-var sum64_4_hi = utils.sum64_4_hi;
-var sum64_4_lo = utils.sum64_4_lo;
-var sum64_5_hi = utils.sum64_5_hi;
-var sum64_5_lo = utils.sum64_5_lo;
-
-var BlockHash = common.BlockHash;
-
-var sha512_K = [
- 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,
- 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,
- 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,
- 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,
- 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,
- 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,
- 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,
- 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,
- 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,
- 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,
- 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,
- 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,
- 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,
- 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,
- 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,
- 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,
- 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,
- 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,
- 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,
- 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,
- 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,
- 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,
- 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,
- 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,
- 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,
- 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,
- 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,
- 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,
- 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,
- 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,
- 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,
- 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,
- 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,
- 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,
- 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,
- 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,
- 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,
- 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,
- 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,
- 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817
-];
-
-function SHA512() {
- if (!(this instanceof SHA512))
- return new SHA512();
-
- BlockHash.call(this);
- this.h = [
- 0x6a09e667, 0xf3bcc908,
- 0xbb67ae85, 0x84caa73b,
- 0x3c6ef372, 0xfe94f82b,
- 0xa54ff53a, 0x5f1d36f1,
- 0x510e527f, 0xade682d1,
- 0x9b05688c, 0x2b3e6c1f,
- 0x1f83d9ab, 0xfb41bd6b,
- 0x5be0cd19, 0x137e2179 ];
- this.k = sha512_K;
- this.W = new Array(160);
-}
-utils.inherits(SHA512, BlockHash);
-module.exports = SHA512;
-
-SHA512.blockSize = 1024;
-SHA512.outSize = 512;
-SHA512.hmacStrength = 192;
-SHA512.padLength = 128;
-
-SHA512.prototype._prepareBlock = function _prepareBlock(msg, start) {
- var W = this.W;
-
- // 32 x 32bit words
- for (var i = 0; i < 32; i++)
- W[i] = msg[start + i];
- for (; i < W.length; i += 2) {
- var c0_hi = g1_512_hi(W[i - 4], W[i - 3]); // i - 2
- var c0_lo = g1_512_lo(W[i - 4], W[i - 3]);
- var c1_hi = W[i - 14]; // i - 7
- var c1_lo = W[i - 13];
- var c2_hi = g0_512_hi(W[i - 30], W[i - 29]); // i - 15
- var c2_lo = g0_512_lo(W[i - 30], W[i - 29]);
- var c3_hi = W[i - 32]; // i - 16
- var c3_lo = W[i - 31];
-
- W[i] = sum64_4_hi(
- c0_hi, c0_lo,
- c1_hi, c1_lo,
- c2_hi, c2_lo,
- c3_hi, c3_lo);
- W[i + 1] = sum64_4_lo(
- c0_hi, c0_lo,
- c1_hi, c1_lo,
- c2_hi, c2_lo,
- c3_hi, c3_lo);
- }
-};
-
-SHA512.prototype._update = function _update(msg, start) {
- this._prepareBlock(msg, start);
-
- var W = this.W;
-
- var ah = this.h[0];
- var al = this.h[1];
- var bh = this.h[2];
- var bl = this.h[3];
- var ch = this.h[4];
- var cl = this.h[5];
- var dh = this.h[6];
- var dl = this.h[7];
- var eh = this.h[8];
- var el = this.h[9];
- var fh = this.h[10];
- var fl = this.h[11];
- var gh = this.h[12];
- var gl = this.h[13];
- var hh = this.h[14];
- var hl = this.h[15];
-
- assert(this.k.length === W.length);
- for (var i = 0; i < W.length; i += 2) {
- var c0_hi = hh;
- var c0_lo = hl;
- var c1_hi = s1_512_hi(eh, el);
- var c1_lo = s1_512_lo(eh, el);
- var c2_hi = ch64_hi(eh, el, fh, fl, gh, gl);
- var c2_lo = ch64_lo(eh, el, fh, fl, gh, gl);
- var c3_hi = this.k[i];
- var c3_lo = this.k[i + 1];
- var c4_hi = W[i];
- var c4_lo = W[i + 1];
-
- var T1_hi = sum64_5_hi(
- c0_hi, c0_lo,
- c1_hi, c1_lo,
- c2_hi, c2_lo,
- c3_hi, c3_lo,
- c4_hi, c4_lo);
- var T1_lo = sum64_5_lo(
- c0_hi, c0_lo,
- c1_hi, c1_lo,
- c2_hi, c2_lo,
- c3_hi, c3_lo,
- c4_hi, c4_lo);
-
- c0_hi = s0_512_hi(ah, al);
- c0_lo = s0_512_lo(ah, al);
- c1_hi = maj64_hi(ah, al, bh, bl, ch, cl);
- c1_lo = maj64_lo(ah, al, bh, bl, ch, cl);
-
- var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo);
- var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo);
-
- hh = gh;
- hl = gl;
-
- gh = fh;
- gl = fl;
-
- fh = eh;
- fl = el;
-
- eh = sum64_hi(dh, dl, T1_hi, T1_lo);
- el = sum64_lo(dl, dl, T1_hi, T1_lo);
-
- dh = ch;
- dl = cl;
-
- ch = bh;
- cl = bl;
-
- bh = ah;
- bl = al;
-
- ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo);
- al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo);
- }
-
- sum64(this.h, 0, ah, al);
- sum64(this.h, 2, bh, bl);
- sum64(this.h, 4, ch, cl);
- sum64(this.h, 6, dh, dl);
- sum64(this.h, 8, eh, el);
- sum64(this.h, 10, fh, fl);
- sum64(this.h, 12, gh, gl);
- sum64(this.h, 14, hh, hl);
-};
-
-SHA512.prototype._digest = function digest(enc) {
- if (enc === 'hex')
- return utils.toHex32(this.h, 'big');
- else
- return utils.split32(this.h, 'big');
-};
-
-function ch64_hi(xh, xl, yh, yl, zh) {
- var r = (xh & yh) ^ ((~xh) & zh);
- if (r < 0)
- r += 0x100000000;
- return r;
-}
-
-function ch64_lo(xh, xl, yh, yl, zh, zl) {
- var r = (xl & yl) ^ ((~xl) & zl);
- if (r < 0)
- r += 0x100000000;
- return r;
-}
-
-function maj64_hi(xh, xl, yh, yl, zh) {
- var r = (xh & yh) ^ (xh & zh) ^ (yh & zh);
- if (r < 0)
- r += 0x100000000;
- return r;
-}
-
-function maj64_lo(xh, xl, yh, yl, zh, zl) {
- var r = (xl & yl) ^ (xl & zl) ^ (yl & zl);
- if (r < 0)
- r += 0x100000000;
- return r;
-}
-
-function s0_512_hi(xh, xl) {
- var c0_hi = rotr64_hi(xh, xl, 28);
- var c1_hi = rotr64_hi(xl, xh, 2); // 34
- var c2_hi = rotr64_hi(xl, xh, 7); // 39
-
- var r = c0_hi ^ c1_hi ^ c2_hi;
- if (r < 0)
- r += 0x100000000;
- return r;
-}
-
-function s0_512_lo(xh, xl) {
- var c0_lo = rotr64_lo(xh, xl, 28);
- var c1_lo = rotr64_lo(xl, xh, 2); // 34
- var c2_lo = rotr64_lo(xl, xh, 7); // 39
-
- var r = c0_lo ^ c1_lo ^ c2_lo;
- if (r < 0)
- r += 0x100000000;
- return r;
-}
-
-function s1_512_hi(xh, xl) {
- var c0_hi = rotr64_hi(xh, xl, 14);
- var c1_hi = rotr64_hi(xh, xl, 18);
- var c2_hi = rotr64_hi(xl, xh, 9); // 41
-
- var r = c0_hi ^ c1_hi ^ c2_hi;
- if (r < 0)
- r += 0x100000000;
- return r;
-}
-
-function s1_512_lo(xh, xl) {
- var c0_lo = rotr64_lo(xh, xl, 14);
- var c1_lo = rotr64_lo(xh, xl, 18);
- var c2_lo = rotr64_lo(xl, xh, 9); // 41
-
- var r = c0_lo ^ c1_lo ^ c2_lo;
- if (r < 0)
- r += 0x100000000;
- return r;
-}
-
-function g0_512_hi(xh, xl) {
- var c0_hi = rotr64_hi(xh, xl, 1);
- var c1_hi = rotr64_hi(xh, xl, 8);
- var c2_hi = shr64_hi(xh, xl, 7);
-
- var r = c0_hi ^ c1_hi ^ c2_hi;
- if (r < 0)
- r += 0x100000000;
- return r;
-}
-
-function g0_512_lo(xh, xl) {
- var c0_lo = rotr64_lo(xh, xl, 1);
- var c1_lo = rotr64_lo(xh, xl, 8);
- var c2_lo = shr64_lo(xh, xl, 7);
-
- var r = c0_lo ^ c1_lo ^ c2_lo;
- if (r < 0)
- r += 0x100000000;
- return r;
-}
-
-function g1_512_hi(xh, xl) {
- var c0_hi = rotr64_hi(xh, xl, 19);
- var c1_hi = rotr64_hi(xl, xh, 29); // 61
- var c2_hi = shr64_hi(xh, xl, 6);
-
- var r = c0_hi ^ c1_hi ^ c2_hi;
- if (r < 0)
- r += 0x100000000;
- return r;
-}
-
-function g1_512_lo(xh, xl) {
- var c0_lo = rotr64_lo(xh, xl, 19);
- var c1_lo = rotr64_lo(xl, xh, 29); // 61
- var c2_lo = shr64_lo(xh, xl, 6);
-
- var r = c0_lo ^ c1_lo ^ c2_lo;
- if (r < 0)
- r += 0x100000000;
- return r;
-}
diff --git a/node_modules/hash.js/lib/hash/sha/common.js b/node_modules/hash.js/lib/hash/sha/common.js
deleted file mode 100644
index d41b464..0000000
--- a/node_modules/hash.js/lib/hash/sha/common.js
+++ /dev/null
@@ -1,49 +0,0 @@
-'use strict';
-
-var utils = require('../utils');
-var rotr32 = utils.rotr32;
-
-function ft_1(s, x, y, z) {
- if (s === 0)
- return ch32(x, y, z);
- if (s === 1 || s === 3)
- return p32(x, y, z);
- if (s === 2)
- return maj32(x, y, z);
-}
-exports.ft_1 = ft_1;
-
-function ch32(x, y, z) {
- return (x & y) ^ ((~x) & z);
-}
-exports.ch32 = ch32;
-
-function maj32(x, y, z) {
- return (x & y) ^ (x & z) ^ (y & z);
-}
-exports.maj32 = maj32;
-
-function p32(x, y, z) {
- return x ^ y ^ z;
-}
-exports.p32 = p32;
-
-function s0_256(x) {
- return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);
-}
-exports.s0_256 = s0_256;
-
-function s1_256(x) {
- return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);
-}
-exports.s1_256 = s1_256;
-
-function g0_256(x) {
- return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3);
-}
-exports.g0_256 = g0_256;
-
-function g1_256(x) {
- return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10);
-}
-exports.g1_256 = g1_256;
diff --git a/node_modules/hash.js/lib/hash/utils.js b/node_modules/hash.js/lib/hash/utils.js
deleted file mode 100644
index 7487f8e..0000000
--- a/node_modules/hash.js/lib/hash/utils.js
+++ /dev/null
@@ -1,278 +0,0 @@
-'use strict';
-
-var assert = require('minimalistic-assert');
-var inherits = require('inherits');
-
-exports.inherits = inherits;
-
-function isSurrogatePair(msg, i) {
- if ((msg.charCodeAt(i) & 0xFC00) !== 0xD800) {
- return false;
- }
- if (i < 0 || i + 1 >= msg.length) {
- return false;
- }
- return (msg.charCodeAt(i + 1) & 0xFC00) === 0xDC00;
-}
-
-function toArray(msg, enc) {
- if (Array.isArray(msg))
- return msg.slice();
- if (!msg)
- return [];
- var res = [];
- if (typeof msg === 'string') {
- if (!enc) {
- // Inspired by stringToUtf8ByteArray() in closure-library by Google
- // https://github.com/google/closure-library/blob/8598d87242af59aac233270742c8984e2b2bdbe0/closure/goog/crypt/crypt.js#L117-L143
- // Apache License 2.0
- // https://github.com/google/closure-library/blob/master/LICENSE
- var p = 0;
- for (var i = 0; i < msg.length; i++) {
- var c = msg.charCodeAt(i);
- if (c < 128) {
- res[p++] = c;
- } else if (c < 2048) {
- res[p++] = (c >> 6) | 192;
- res[p++] = (c & 63) | 128;
- } else if (isSurrogatePair(msg, i)) {
- c = 0x10000 + ((c & 0x03FF) << 10) + (msg.charCodeAt(++i) & 0x03FF);
- res[p++] = (c >> 18) | 240;
- res[p++] = ((c >> 12) & 63) | 128;
- res[p++] = ((c >> 6) & 63) | 128;
- res[p++] = (c & 63) | 128;
- } else {
- res[p++] = (c >> 12) | 224;
- res[p++] = ((c >> 6) & 63) | 128;
- res[p++] = (c & 63) | 128;
- }
- }
- } else if (enc === 'hex') {
- msg = msg.replace(/[^a-z0-9]+/ig, '');
- if (msg.length % 2 !== 0)
- msg = '0' + msg;
- for (i = 0; i < msg.length; i += 2)
- res.push(parseInt(msg[i] + msg[i + 1], 16));
- }
- } else {
- for (i = 0; i < msg.length; i++)
- res[i] = msg[i] | 0;
- }
- return res;
-}
-exports.toArray = toArray;
-
-function toHex(msg) {
- var res = '';
- for (var i = 0; i < msg.length; i++)
- res += zero2(msg[i].toString(16));
- return res;
-}
-exports.toHex = toHex;
-
-function htonl(w) {
- var res = (w >>> 24) |
- ((w >>> 8) & 0xff00) |
- ((w << 8) & 0xff0000) |
- ((w & 0xff) << 24);
- return res >>> 0;
-}
-exports.htonl = htonl;
-
-function toHex32(msg, endian) {
- var res = '';
- for (var i = 0; i < msg.length; i++) {
- var w = msg[i];
- if (endian === 'little')
- w = htonl(w);
- res += zero8(w.toString(16));
- }
- return res;
-}
-exports.toHex32 = toHex32;
-
-function zero2(word) {
- if (word.length === 1)
- return '0' + word;
- else
- return word;
-}
-exports.zero2 = zero2;
-
-function zero8(word) {
- if (word.length === 7)
- return '0' + word;
- else if (word.length === 6)
- return '00' + word;
- else if (word.length === 5)
- return '000' + word;
- else if (word.length === 4)
- return '0000' + word;
- else if (word.length === 3)
- return '00000' + word;
- else if (word.length === 2)
- return '000000' + word;
- else if (word.length === 1)
- return '0000000' + word;
- else
- return word;
-}
-exports.zero8 = zero8;
-
-function join32(msg, start, end, endian) {
- var len = end - start;
- assert(len % 4 === 0);
- var res = new Array(len / 4);
- for (var i = 0, k = start; i < res.length; i++, k += 4) {
- var w;
- if (endian === 'big')
- w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3];
- else
- w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k];
- res[i] = w >>> 0;
- }
- return res;
-}
-exports.join32 = join32;
-
-function split32(msg, endian) {
- var res = new Array(msg.length * 4);
- for (var i = 0, k = 0; i < msg.length; i++, k += 4) {
- var m = msg[i];
- if (endian === 'big') {
- res[k] = m >>> 24;
- res[k + 1] = (m >>> 16) & 0xff;
- res[k + 2] = (m >>> 8) & 0xff;
- res[k + 3] = m & 0xff;
- } else {
- res[k + 3] = m >>> 24;
- res[k + 2] = (m >>> 16) & 0xff;
- res[k + 1] = (m >>> 8) & 0xff;
- res[k] = m & 0xff;
- }
- }
- return res;
-}
-exports.split32 = split32;
-
-function rotr32(w, b) {
- return (w >>> b) | (w << (32 - b));
-}
-exports.rotr32 = rotr32;
-
-function rotl32(w, b) {
- return (w << b) | (w >>> (32 - b));
-}
-exports.rotl32 = rotl32;
-
-function sum32(a, b) {
- return (a + b) >>> 0;
-}
-exports.sum32 = sum32;
-
-function sum32_3(a, b, c) {
- return (a + b + c) >>> 0;
-}
-exports.sum32_3 = sum32_3;
-
-function sum32_4(a, b, c, d) {
- return (a + b + c + d) >>> 0;
-}
-exports.sum32_4 = sum32_4;
-
-function sum32_5(a, b, c, d, e) {
- return (a + b + c + d + e) >>> 0;
-}
-exports.sum32_5 = sum32_5;
-
-function sum64(buf, pos, ah, al) {
- var bh = buf[pos];
- var bl = buf[pos + 1];
-
- var lo = (al + bl) >>> 0;
- var hi = (lo < al ? 1 : 0) + ah + bh;
- buf[pos] = hi >>> 0;
- buf[pos + 1] = lo;
-}
-exports.sum64 = sum64;
-
-function sum64_hi(ah, al, bh, bl) {
- var lo = (al + bl) >>> 0;
- var hi = (lo < al ? 1 : 0) + ah + bh;
- return hi >>> 0;
-}
-exports.sum64_hi = sum64_hi;
-
-function sum64_lo(ah, al, bh, bl) {
- var lo = al + bl;
- return lo >>> 0;
-}
-exports.sum64_lo = sum64_lo;
-
-function sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {
- var carry = 0;
- var lo = al;
- lo = (lo + bl) >>> 0;
- carry += lo < al ? 1 : 0;
- lo = (lo + cl) >>> 0;
- carry += lo < cl ? 1 : 0;
- lo = (lo + dl) >>> 0;
- carry += lo < dl ? 1 : 0;
-
- var hi = ah + bh + ch + dh + carry;
- return hi >>> 0;
-}
-exports.sum64_4_hi = sum64_4_hi;
-
-function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {
- var lo = al + bl + cl + dl;
- return lo >>> 0;
-}
-exports.sum64_4_lo = sum64_4_lo;
-
-function sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
- var carry = 0;
- var lo = al;
- lo = (lo + bl) >>> 0;
- carry += lo < al ? 1 : 0;
- lo = (lo + cl) >>> 0;
- carry += lo < cl ? 1 : 0;
- lo = (lo + dl) >>> 0;
- carry += lo < dl ? 1 : 0;
- lo = (lo + el) >>> 0;
- carry += lo < el ? 1 : 0;
-
- var hi = ah + bh + ch + dh + eh + carry;
- return hi >>> 0;
-}
-exports.sum64_5_hi = sum64_5_hi;
-
-function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
- var lo = al + bl + cl + dl + el;
-
- return lo >>> 0;
-}
-exports.sum64_5_lo = sum64_5_lo;
-
-function rotr64_hi(ah, al, num) {
- var r = (al << (32 - num)) | (ah >>> num);
- return r >>> 0;
-}
-exports.rotr64_hi = rotr64_hi;
-
-function rotr64_lo(ah, al, num) {
- var r = (ah << (32 - num)) | (al >>> num);
- return r >>> 0;
-}
-exports.rotr64_lo = rotr64_lo;
-
-function shr64_hi(ah, al, num) {
- return ah >>> num;
-}
-exports.shr64_hi = shr64_hi;
-
-function shr64_lo(ah, al, num) {
- var r = (ah << (32 - num)) | (al >>> num);
- return r >>> 0;
-}
-exports.shr64_lo = shr64_lo;
diff --git a/node_modules/hash.js/package.json b/node_modules/hash.js/package.json
deleted file mode 100644
index 8f3040a..0000000
--- a/node_modules/hash.js/package.json
+++ /dev/null
@@ -1,64 +0,0 @@
-{
- "_from": "hash.js@^1.0.0",
- "_id": "hash.js@1.1.7",
- "_inBundle": false,
- "_integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==",
- "_location": "/hash.js",
- "_phantomChildren": {},
- "_requested": {
- "type": "range",
- "registry": true,
- "raw": "hash.js@^1.0.0",
- "name": "hash.js",
- "escapedName": "hash.js",
- "rawSpec": "^1.0.0",
- "saveSpec": null,
- "fetchSpec": "^1.0.0"
- },
- "_requiredBy": [
- "/elliptic",
- "/hmac-drbg"
- ],
- "_resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz",
- "_shasum": "0babca538e8d4ee4a0f8988d68866537a003cf42",
- "_spec": "hash.js@^1.0.0",
- "_where": "/home/pruss/Dev/3-minute-website/node_modules/elliptic",
- "author": {
- "name": "Fedor Indutny",
- "email": "fedor@indutny.com"
- },
- "bugs": {
- "url": "https://github.com/indutny/hash.js/issues"
- },
- "bundleDependencies": false,
- "dependencies": {
- "inherits": "^2.0.3",
- "minimalistic-assert": "^1.0.1"
- },
- "deprecated": false,
- "description": "Various hash functions that could be run by both browser and node",
- "devDependencies": {
- "eslint": "^4.19.1",
- "mocha": "^5.2.0"
- },
- "homepage": "https://github.com/indutny/hash.js",
- "keywords": [
- "hash",
- "sha256",
- "sha224",
- "hmac"
- ],
- "license": "MIT",
- "main": "lib/hash.js",
- "name": "hash.js",
- "repository": {
- "type": "git",
- "url": "git+ssh://git@github.com/indutny/hash.js.git"
- },
- "scripts": {
- "lint": "eslint lib/*.js lib/**/*.js lib/**/**/*.js test/*.js",
- "test": "mocha --reporter=spec test/*-test.js && npm run lint"
- },
- "typings": "lib/hash.d.ts",
- "version": "1.1.7"
-}
diff --git a/node_modules/hash.js/test/hash-test.js b/node_modules/hash.js/test/hash-test.js
deleted file mode 100644
index f6ca564..0000000
--- a/node_modules/hash.js/test/hash-test.js
+++ /dev/null
@@ -1,140 +0,0 @@
-'use strict';
-/* global describe it */
-
-var assert = require('assert');
-var crypto = require('crypto');
-var hash = require('../');
-
-describe('Hash', function() {
- function test(fn, cases) {
- for (var i = 0; i < cases.length; i++) {
- var msg = cases[i][0];
- var res = cases[i][1];
- var enc = cases[i][2];
-
- var dgst = fn().update(msg, enc).digest('hex');
- assert.equal(dgst, res);
-
- // Split message
- dgst = fn().update(msg.slice(0, 2), enc)
- .update(msg.slice(2), enc)
- .digest('hex');
- assert.equal(dgst, res);
- }
- }
-
- it('should support sha256', function() {
- assert.equal(hash.sha256.blockSize, 512);
- assert.equal(hash.sha256.outSize, 256);
-
- test(hash.sha256, [
- [ 'abc',
- 'ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad' ],
- [ 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq',
- '248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1' ],
- [ 'deadbeef',
- '5f78c33274e43fa9de5659265c1d917e25c03722dcb0b8d27db8d5feaa813953',
- 'hex' ],
- ]);
- });
-
- it('should support sha224', function() {
- assert.equal(hash.sha224.blockSize, 512);
- assert.equal(hash.sha224.outSize, 224);
-
- test(hash.sha224, [
- [ 'abc',
- '23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7' ],
- [ 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq',
- '75388b16512776cc5dba5da1fd890150b0c6455cb4f58b1952522525' ],
- [ 'deadbeef',
- '55b9eee5f60cc362ddc07676f620372611e22272f60fdbec94f243f8',
- 'hex' ],
- ]);
- });
-
- it('should support ripemd160', function() {
- assert.equal(hash.ripemd160.blockSize, 512);
- assert.equal(hash.ripemd160.outSize, 160);
-
- test(hash.ripemd160, [
- [ '', '9c1185a5c5e9fc54612808977ee8f548b2258d31'],
- [ 'abc',
- '8eb208f7e05d987a9b044a8e98c6b087f15a0bfc' ],
- [ 'message digest',
- '5d0689ef49d2fae572b881b123a85ffa21595f36' ],
- [ 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq',
- '12a053384a9c0c88e405a06c27dcf49ada62eb2b' ],
- [ 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',
- 'b0e20b6e3116640286ed3a87a5713079b21f5189' ],
- ]);
- });
-
- it('should support sha1', function() {
- assert.equal(hash.sha1.blockSize, 512);
- assert.equal(hash.sha1.outSize, 160);
-
- test(hash.sha1, [
- [ '',
- 'da39a3ee5e6b4b0d3255bfef95601890afd80709' ],
- [ 'abc',
- 'a9993e364706816aba3e25717850c26c9cd0d89d' ],
- [ 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq',
- '84983e441c3bd26ebaae4aa1f95129e5e54670f1' ],
- [ 'deadbeef',
- 'd78f8bb992a56a597f6c7a1fb918bb78271367eb',
- 'hex' ],
- ]);
- });
-
- it('should support sha512', function() {
- assert.equal(hash.sha512.blockSize, 1024);
- assert.equal(hash.sha512.outSize, 512);
-
- test(hash.sha512, [
- [ 'abc',
- 'ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a' +
- '2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f'
- ],
- [
- 'abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn' +
- 'hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu',
- '8e959b75dae313da8cf4f72814fc143f8f7779c6eb9f7fa17299aeadb6889018' +
- '501d289e4900f7e4331b99dec4b5433ac7d329eeb6dd26545e96e55b874be909'
- ]
- ]);
- });
-
- it('should support sha384', function() {
- assert.equal(hash.sha384.blockSize, 1024);
- assert.equal(hash.sha384.outSize, 384);
-
- test(hash.sha384, [
- [ 'abc',
- 'cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed' +
- '8086072ba1e7cc2358baeca134c825a7'
- ],
- [
- 'abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn' +
- 'hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu',
- '09330c33f71147e83d192fc782cd1b4753111b173b3b05d22fa08086e3b0f712' +
- 'fcc7c71a557e2db966c3e9fa91746039'
- ]
- ]);
- });
-
- it('handles utf8 in strings just like crypto', function() {
- const algorithm = 'sha256';
- test(hash[algorithm], [
- 'hello', // one byte per character
- 'привет', // two bytes per character
- '您好', // three bytes per character
- '👋', // four bytes per character
- 'hello привет 您好 👋!!!' // mixed character lengths
- ].map(str => [str, crypto
- .createHash(algorithm)
- .update(str)
- .digest('hex')]));
- });
-
-});
diff --git a/node_modules/hash.js/test/hmac-test.js b/node_modules/hash.js/test/hmac-test.js
deleted file mode 100644
index 6fe18e3..0000000
--- a/node_modules/hash.js/test/hmac-test.js
+++ /dev/null
@@ -1,62 +0,0 @@
-'use strict';
-/* global describe it */
-
-var assert = require('assert');
-var hash = require('../');
-
-describe('Hmac', function() {
- describe('mixed test vector', function() {
- test({
- name: 'nist 1',
- key: '00010203 04050607 08090A0B 0C0D0E0F' +
- '10111213 14151617 18191A1B 1C1D1E1F 20212223 24252627' +
- '28292A2B 2C2D2E2F 30313233 34353637 38393A3B 3C3D3E3F',
- msg: 'Sample message for keylen=blocklen',
- res: '8bb9a1db9806f20df7f77b82138c7914d174d59e13dc4d0169c9057b133e1d62'
- });
- test({
- name: 'nist 2',
- key: '00010203 04050607' +
- '08090A0B 0C0D0E0F 10111213 14151617 18191A1B 1C1D1E1F',
- msg: 'Sample message for keylen<blocklen',
- res: 'a28cf43130ee696a98f14a37678b56bcfcbdd9e5cf69717fecf5480f0ebdf790'
- });
- test({
- name: 'nist 3',
- key: '00010203' +
- '04050607 08090A0B 0C0D0E0F 10111213 14151617 18191A1B' +
- '1C1D1E1F 20212223 24252627 28292A2B 2C2D2E2F 30313233' +
- '34353637 38393A3B 3C3D3E3F 40414243 44454647 48494A4B' +
- '4C4D4E4F 50515253 54555657 58595A5B 5C5D5E5F 60616263',
- msg: 'Sample message for keylen=blocklen',
- res: 'bdccb6c72ddeadb500ae768386cb38cc41c63dbb0878ddb9c7a38a431b78378d'
- });
- test({
- name: 'nist 4',
- key: '00' +
- '01020304 05060708 090A0B0C 0D0E0F10 11121314 15161718' +
- '191A1B1C 1D1E1F20 21222324 25262728 292A2B2C 2D2E2F30',
- msg: 'Sample message for keylen<blocklen, with truncated tag',
- res: '27a8b157839efeac98df070b331d593618ddb985d403c0c786d23b5d132e57c7'
- });
- test({
- name: 'regression 1',
- key: '48f38d0c6a344959cc94502b7b5e8dffb6a5f41795d9066fc9a649557167ee2f',
- msg: '1d495eef7761b65dccd0a983d2d7204fea28b5c81f1758046e062eb043755ea1',
- msgEnc: 'hex',
- res: 'cf5ad5984f9e43917aa9087380dac46e410ddc8a7731859c84e9d0f31bd43655'
- });
-
- function test(opt) {
- it('should not fail at ' + opt.name, function() {
- var h = hash.hmac(hash.sha256, opt.key, 'hex');
- assert.equal(h.update(opt.msg, opt.msgEnc).digest('hex'), opt.res);
- h = hash.hmac(hash.sha256, opt.key, 'hex');
- assert.equal(h
- .update(opt.msg.slice(0, 10), opt.msgEnc)
- .update(opt.msg.slice(10), opt.msgEnc)
- .digest('hex'), opt.res);
- });
- }
- });
-});