aboutsummaryrefslogtreecommitdiff
path: root/src/js/node/crypto.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/node/crypto.js')
-rw-r--r--src/js/node/crypto.js118
1 files changed, 59 insertions, 59 deletions
diff --git a/src/js/node/crypto.js b/src/js/node/crypto.js
index 03ce06583..ae7e24655 100644
--- a/src/js/node/crypto.js
+++ b/src/js/node/crypto.js
@@ -168,7 +168,7 @@ var require_hash_base = __commonJS({
throw new TypeError(prefix + " must be a string or a buffer");
}
function HashBase(blockSize) {
- StreamModule.Transform.call(this),
+ StreamModule.Transform.$call(this),
(this._block = Buffer2.allocUnsafe(blockSize)),
(this._blockSize = blockSize),
(this._blockOffset = 0),
@@ -235,7 +235,7 @@ var require_md5 = __commonJS({
Buffer2 = require_safe_buffer().Buffer,
ARRAY16 = new Array(16);
function MD5() {
- HashBase.call(this, 64),
+ HashBase.$call(this, 64),
(this._a = 1732584193),
(this._b = 4023233417),
(this._c = 2562383102),
@@ -383,7 +383,7 @@ var require_ripemd160 = __commonJS({
hl = [0, 1518500249, 1859775393, 2400959708, 2840853838],
hr = [1352829926, 1548603684, 1836072691, 2053994217, 0];
function RIPEMD160() {
- HashBase.call(this, 64),
+ HashBase.$call(this, 64),
(this._a = 1732584193),
(this._b = 4023233417),
(this._c = 2562383102),
@@ -541,7 +541,7 @@ var require_sha = __commonJS({
K = [1518500249, 1859775393, -1894007588, -899497514],
W = new Array(80);
function Sha() {
- this.init(), (this._w = W), Hash.call(this, 64, 56);
+ this.init(), (this._w = W), Hash.$call(this, 64, 56);
}
inherits(Sha, Hash);
Sha.prototype.init = function () {
@@ -606,7 +606,7 @@ var require_sha1 = __commonJS({
K = [1518500249, 1859775393, -1894007588, -899497514],
W = new Array(80);
function Sha1() {
- this.init(), (this._w = W), Hash.call(this, 64, 56);
+ this.init(), (this._w = W), Hash.$call(this, 64, 56);
}
inherits(Sha1, Hash);
Sha1.prototype.init = function () {
@@ -683,7 +683,7 @@ var require_sha256 = __commonJS({
],
W = new Array(64);
function Sha256() {
- this.init(), (this._w = W), Hash.call(this, 64, 56);
+ this.init(), (this._w = W), Hash.$call(this, 64, 56);
}
inherits(Sha256, Hash);
Sha256.prototype.init = function () {
@@ -775,7 +775,7 @@ var require_sha224 = __commonJS({
Buffer2 = require_safe_buffer().Buffer,
W = new Array(64);
function Sha224() {
- this.init(), (this._w = W), Hash.call(this, 64, 56);
+ this.init(), (this._w = W), Hash.$call(this, 64, 56);
}
inherits(Sha224, Sha256);
Sha224.prototype.init = function () {
@@ -836,7 +836,7 @@ var require_sha512 = __commonJS({
],
W = new Array(160);
function Sha512() {
- this.init(), (this._w = W), Hash.call(this, 128, 112);
+ this.init(), (this._w = W), Hash.$call(this, 128, 112);
}
inherits(Sha512, Hash);
Sha512.prototype.init = function () {
@@ -1018,7 +1018,7 @@ var require_sha384 = __commonJS({
Buffer2 = require_safe_buffer().Buffer,
W = new Array(160);
function Sha384() {
- this.init(), (this._w = W), Hash.call(this, 128, 112);
+ this.init(), (this._w = W), Hash.$call(this, 128, 112);
}
inherits(Sha384, SHA512);
Sha384.prototype.init = function () {
@@ -1085,7 +1085,7 @@ var require_cipher_base = __commonJS({
var Buffer2 = require_safe_buffer().Buffer,
inherits = require_inherits_browser();
function CipherBase(hashMode) {
- StreamModule.Transform.call(this),
+ StreamModule.Transform.$call(this),
(this.hashMode = typeof hashMode == "string"),
this.hashMode ? (this[hashMode] = this._finalOrDigest) : (this.final = this._finalOrDigest),
this._final && ((this.__final = this._final), (this._final = null)),
@@ -1289,7 +1289,7 @@ var require_browser2 = __commonJS({
Object.defineProperty(LazyHash.prototype, method, {
get() {
Object.setPrototypeOf(this, lazyHashFullInitProto);
- StreamModule.Transform.call(this, this._options);
+ StreamModule.Transform.$call(this, this._options);
return this[method];
},
enumerable: false,
@@ -1318,7 +1318,7 @@ var require_legacy = __commonJS({
function Hmac(alg, key) {
key = exportIfKeyObject(key);
- Base.call(this, "digest"),
+ Base.$call(this, "digest"),
typeof key == "string" && (key = Buffer2.from(key)),
(this._alg = alg),
(this._key = key),
@@ -1373,7 +1373,7 @@ var require_browser3 = __commonJS({
function Hmac(alg, key) {
key = exportIfKeyObject(key);
- Base.call(this, "digest"), typeof key == "string" && (key = Buffer2.from(key));
+ Base.$call(this, "digest"), typeof key == "string" && (key = Buffer2.from(key));
var blocksize = alg === "sha512" || alg === "sha384" ? 128 : 64;
if (((this._alg = alg), (this._key = key), key.length > blocksize)) {
var hash = alg === "rmd160" ? new RIPEMD160() : sha(alg);
@@ -2061,7 +2061,7 @@ var require_des = __commonJS({
(this.tmp = new Array(2)), (this.keys = null);
}
function DES(options) {
- Cipher.call(this, options);
+ Cipher.$call(this, options);
var state = new DESState();
(this._desState = state), this.deriveKeys(state, options.key);
}
@@ -2143,7 +2143,7 @@ var require_cbc = __commonJS({
}
function instantiate(Base) {
function CBC(options) {
- Base.call(this, options), this._cbcInit();
+ Base.$call(this, options), this._cbcInit();
}
inherits(CBC, Base);
for (var keys = Object.keys(proto), i = 0; i < keys.length; i++) {
@@ -2168,10 +2168,10 @@ var require_cbc = __commonJS({
iv = state.iv;
if (this.type === "encrypt") {
for (var i = 0; i < this.blockSize; i++) iv[i] ^= inp[inOff + i];
- superProto._update.call(this, iv, 0, out, outOff);
+ superProto._update.$call(this, iv, 0, out, outOff);
for (var i = 0; i < this.blockSize; i++) iv[i] = out[outOff + i];
} else {
- superProto._update.call(this, inp, inOff, out, outOff);
+ superProto._update.$call(this, inp, inOff, out, outOff);
for (var i = 0; i < this.blockSize; i++) out[outOff + i] ^= iv[i];
for (var i = 0; i < this.blockSize; i++) iv[i] = inp[inOff + i];
}
@@ -2205,7 +2205,7 @@ var require_ede = __commonJS({
]);
}
function EDE(options) {
- Cipher.call(this, options);
+ Cipher.$call(this, options);
var state = new EDEState(this.type, this.options.key);
this._edeState = state;
}
@@ -2257,7 +2257,7 @@ var require_browserify_des = __commonJS({
module.exports = DES;
inherits(DES, CipherBase);
function DES(opts) {
- CipherBase.call(this);
+ CipherBase.$call(this);
var modeName = opts.mode.toLowerCase(),
mode = modes[modeName],
type;
@@ -2978,7 +2978,7 @@ var require_authCipher = __commonJS({
return incr32(out), out;
}
function StreamCipher(mode, key, iv, decrypt) {
- Transform.call(this);
+ Transform.$call(this);
var h = Buffer2.alloc(4, 0);
this._cipher = new aes.AES(key);
var ck = this._cipher.encryptBlock(h);
@@ -3036,7 +3036,7 @@ var require_streamCipher = __commonJS({
Transform = require_cipher_base(),
inherits = require_inherits_browser();
function StreamCipher(mode, key, iv, decrypt) {
- Transform.call(this),
+ Transform.$call(this),
(this._cipher = new aes.AES(key)),
(this._prev = Buffer2.from(iv)),
(this._cache = Buffer2.allocUnsafe(0)),
@@ -3102,7 +3102,7 @@ var require_encrypter = __commonJS({
ebtk = require_evp_bytestokey(),
inherits = require_inherits_browser();
function Cipher(mode, key, iv) {
- Transform.call(this),
+ Transform.$call(this),
(this._cache = new Splitter()),
(this._cipher = new aes.AES(key)),
(this._prev = Buffer2.from(iv)),
@@ -3192,7 +3192,7 @@ var require_decrypter = __commonJS({
ebtk = require_evp_bytestokey(),
inherits = require_inherits_browser();
function Decipher(mode, key, iv) {
- Transform.call(this),
+ Transform.$call(this),
(this._cache = new Splitter()),
(this._last = void 0),
(this._cipher = new aes.AES(key)),
@@ -5131,7 +5131,7 @@ var require_bn = __commonJS({
return num.imul(this.k);
});
function K256() {
- MPrime.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f");
+ MPrime.$call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f");
}
inherits(K256, MPrime),
(K256.prototype.split = function (input, output) {
@@ -5161,15 +5161,15 @@ var require_bn = __commonJS({
);
});
function P224() {
- MPrime.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001");
+ MPrime.$call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001");
}
inherits(P224, MPrime);
function P192() {
- MPrime.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff");
+ MPrime.$call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff");
}
inherits(P192, MPrime);
function P25519() {
- MPrime.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed");
+ MPrime.$call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed");
}
inherits(P25519, MPrime),
(P25519.prototype.imulK = function (num) {
@@ -5315,7 +5315,7 @@ var require_bn = __commonJS({
return new Mont(num);
});
function Mont(m) {
- Red.call(this, m),
+ Red.$call(this, m),
(this.shift = this.m.bitLength()),
this.shift % 26 !== 0 && (this.shift += 26 - (this.shift % 26)),
(this.r = new BN(1).iushln(this.shift)),
@@ -5908,7 +5908,7 @@ var require_utils3 = __commonJS({
function cachedProperty(obj, name, computer) {
var key = "_" + name;
obj.prototype[name] = function () {
- return this[key] !== void 0 ? this[key] : (this[key] = computer.call(this));
+ return this[key] !== void 0 ? this[key] : (this[key] = computer.$call(this));
};
}
utils.cachedProperty = cachedProperty;
@@ -6168,7 +6168,7 @@ var require_short = __commonJS({
Base = require_base(),
assert = utils.assert;
function ShortCurve(conf) {
- Base.call(this, "short", conf),
+ Base.$call(this, "short", conf),
(this.a = new BN(conf.a, 16).toRed(this.red)),
(this.b = new BN(conf.b, 16).toRed(this.red)),
(this.tinv = this.two.redInvm()),
@@ -6311,7 +6311,7 @@ var require_short = __commonJS({
return res;
};
function Point(curve, x, y, isRed) {
- Base.BasePoint.call(this, curve, "affine"),
+ Base.BasePoint.$call(this, curve, "affine"),
x === null && y === null
? ((this.x = null), (this.y = null), (this.inf = !0))
: ((this.x = new BN(x, 16)),
@@ -6489,7 +6489,7 @@ var require_short = __commonJS({
return res;
};
function JPoint(curve, x, y, z) {
- Base.BasePoint.call(this, curve, "jacobian"),
+ Base.BasePoint.$call(this, curve, "jacobian"),
x === null && y === null && z === null
? ((this.x = this.curve.one), (this.y = this.curve.one), (this.z = new BN(0)))
: ((this.x = new BN(x, 16)), (this.y = new BN(y, 16)), (this.z = new BN(z, 16))),
@@ -6752,7 +6752,7 @@ var require_mont = __commonJS({
Base = require_base(),
utils = require_utils3();
function MontCurve(conf) {
- Base.call(this, "mont", conf),
+ Base.$call(this, "mont", conf),
(this.a = new BN(conf.a, 16).toRed(this.red)),
(this.b = new BN(conf.b, 16).toRed(this.red)),
(this.i4 = new BN(4).toRed(this.red).redInvm()),
@@ -6769,7 +6769,7 @@ var require_mont = __commonJS({
return y.redSqr().cmp(rhs) === 0;
};
function Point(curve, x, z) {
- Base.BasePoint.call(this, curve, "projective"),
+ Base.BasePoint.$call(this, curve, "projective"),
x === null && z === null
? ((this.x = this.curve.one), (this.z = this.curve.zero))
: ((this.x = new BN(x, 16)),
@@ -6868,7 +6868,7 @@ var require_edwards = __commonJS({
(this.twisted = (conf.a | 0) !== 1),
(this.mOneA = this.twisted && (conf.a | 0) === -1),
(this.extended = this.mOneA),
- Base.call(this, "edwards", conf),
+ Base.$call(this, "edwards", conf),
(this.a = new BN(conf.a, 16).umod(this.red.m)),
(this.a = this.a.toRed(this.red)),
(this.c = new BN(conf.c, 16).toRed(this.red)),
@@ -6924,7 +6924,7 @@ var require_edwards = __commonJS({
return lhs.cmp(rhs) === 0;
};
function Point(curve, x, y, z, t) {
- Base.BasePoint.call(this, curve, "projective"),
+ Base.BasePoint.$call(this, curve, "projective"),
x === null && y === null && z === null
? ((this.x = this.curve.zero),
(this.y = this.curve.one),
@@ -7462,7 +7462,7 @@ var require__ = __commonJS({
sha1_K = [1518500249, 1859775393, 2400959708, 3395469782];
function SHA1() {
if (!(this instanceof SHA1)) return new SHA1();
- BlockHash.call(this),
+ BlockHash.$call(this),
(this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520]),
(this.W = new Array(80));
}
@@ -7527,7 +7527,7 @@ var require__2 = __commonJS({
];
function SHA256() {
if (!(this instanceof SHA256)) return new SHA256();
- BlockHash.call(this),
+ BlockHash.$call(this),
(this.h = [1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225]),
(this.k = sha256_K),
(this.W = new Array(64));
@@ -7577,7 +7577,7 @@ var require__3 = __commonJS({
SHA256 = require__2();
function SHA224() {
if (!(this instanceof SHA224)) return new SHA224();
- SHA256.call(this),
+ SHA256.$call(this),
(this.h = [3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, 1694076839, 3204075428]);
}
utils.inherits(SHA224, SHA256);
@@ -7633,7 +7633,7 @@ var require__4 = __commonJS({
];
function SHA512() {
if (!(this instanceof SHA512)) return new SHA512();
- BlockHash.call(this),
+ BlockHash.$call(this),
(this.h = [
1779033703, 4089235720, 3144134277, 2227873595, 1013904242, 4271175723, 2773480762, 1595750129, 1359893119,
2917565137, 2600822924, 725511199, 528734635, 4215389547, 1541459225, 327033209,
@@ -7813,7 +7813,7 @@ var require__5 = __commonJS({
SHA512 = require__4();
function SHA384() {
if (!(this instanceof SHA384)) return new SHA384();
- SHA512.call(this),
+ SHA512.$call(this),
(this.h = [
3418070365, 3238371032, 1654270250, 914150663, 2438529370, 812702999, 355462360, 4144912697, 1731405415,
4290775857, 2394180231, 1750603025, 3675008525, 1694076839, 1203062813, 3204075428,
@@ -7856,7 +7856,7 @@ var require_ripemd = __commonJS({
BlockHash = common.BlockHash;
function RIPEMD160() {
if (!(this instanceof RIPEMD160)) return new RIPEMD160();
- BlockHash.call(this),
+ BlockHash.$call(this),
(this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520]),
(this.endian = "little");
}
@@ -9198,7 +9198,7 @@ var require_ec = __commonJS({
function EC(options) {
if (!(this instanceof EC)) return new EC(options);
typeof options == "string" &&
- (assert(Object.prototype.hasOwnProperty.call(curves, options), "Unknown curve " + options),
+ (assert(Object.prototype.hasOwnProperty.$call(curves, options), "Unknown curve " + options),
(options = curves[options])),
options instanceof curves.PresetCurve && (options = { curve: options }),
(this.curve = options.curve.curve),
@@ -9699,7 +9699,7 @@ var require_buffer = __commonJS({
Reporter = require_reporter().Reporter,
Buffer2 = require_safer().Buffer;
function DecoderBuffer(base, options) {
- if ((Reporter.call(this, options), !Buffer2.isBuffer(base))) {
+ if ((Reporter.$call(this, options), !Buffer2.isBuffer(base))) {
this.error("Input not Buffer");
return;
}
@@ -9725,7 +9725,7 @@ var require_buffer = __commonJS({
DecoderBuffer.prototype.save = function () {
return {
offset: this.offset,
- reporter: Reporter.prototype.save.call(this),
+ reporter: Reporter.prototype.save.$call(this),
};
};
DecoderBuffer.prototype.restore = function (save) {
@@ -9734,7 +9734,7 @@ var require_buffer = __commonJS({
(res.offset = save.offset),
(res.length = this.offset),
(this.offset = save.offset),
- Reporter.prototype.restore.call(this, save.reporter),
+ Reporter.prototype.restore.$call(this, save.reporter),
res
);
};
@@ -9924,14 +9924,14 @@ var require_node = __commonJS({
methods.forEach(function (method) {
this[method] = function () {
let clone = new this.constructor(this);
- return state.children.push(clone), clone[method].apply(clone, arguments);
+ return state.children.push(clone), clone[method].$apply(clone, arguments);
};
}, this);
};
Node.prototype._init = function (body) {
let state = this._baseState;
assert(state.parent === null),
- body.call(this),
+ body.$call(this),
(state.children = state.children.filter(function (child) {
return child._baseState.parent === this;
}, this)),
@@ -9976,7 +9976,7 @@ var require_node = __commonJS({
tags.forEach(function (tag) {
Node.prototype[tag] = function () {
let state = this._baseState,
- args = Array.prototype.slice.call(arguments);
+ args = Array.prototype.slice.$call(arguments);
return assert(state.tag === null), (state.tag = tag), this._useArgs(args), this;
};
});
@@ -10003,7 +10003,7 @@ var require_node = __commonJS({
};
Node.prototype.obj = function () {
let state = this._baseState,
- args = Array.prototype.slice.call(arguments);
+ args = Array.prototype.slice.$call(arguments);
return (state.obj = !0), args.length !== 0 && this._useArgs(args), this;
};
Node.prototype.key = function (newKey) {
@@ -10330,7 +10330,7 @@ var require_der2 = __commonJS({
return this.tree._encode(data, reporter).join();
};
function DERNode(parent) {
- Node.call(this, "der", parent);
+ Node.$call(this, "der", parent);
}
inherits(DERNode, Node);
DERNode.prototype._encodeComposite = function (tag, primitive, cls, content) {
@@ -10497,12 +10497,12 @@ var require_pem = __commonJS({
var inherits = require_inherits_browser(),
DEREncoder = require_der2();
function PEMEncoder(entity) {
- DEREncoder.call(this, entity), (this.enc = "pem");
+ DEREncoder.$call(this, entity), (this.enc = "pem");
}
inherits(PEMEncoder, DEREncoder);
module.exports = PEMEncoder;
PEMEncoder.prototype.encode = function (data, options) {
- let p = DEREncoder.prototype.encode.call(this, data).toString("base64"),
+ let p = DEREncoder.prototype.encode.$call(this, data).toString("base64"),
out = ["-----BEGIN " + options.label + "-----"];
for (let i = 0; i < p.length; i += 64) out.push(p.slice(i, i + 64));
return (
@@ -10549,7 +10549,7 @@ var require_der3 = __commonJS({
);
};
function DERNode(parent) {
- Node.call(this, "der", parent);
+ Node.$call(this, "der", parent);
}
inherits(DERNode, Node);
DERNode.prototype._peekTag = function (buffer, tag, any) {
@@ -10737,7 +10737,7 @@ var require_pem2 = __commonJS({
Buffer2 = require_safer().Buffer,
DERDecoder = require_der3();
function PEMDecoder(entity) {
- DERDecoder.call(this, entity), (this.enc = "pem");
+ DERDecoder.$call(this, entity), (this.enc = "pem");
}
inherits(PEMDecoder, DERDecoder);
module.exports = PEMDecoder;
@@ -10763,7 +10763,7 @@ var require_pem2 = __commonJS({
let base64 = lines.slice(start + 1, end).join("");
base64.replace(/[^a-z0-9+/=]+/gi, "");
let input = Buffer2.from(base64, "base64");
- return DERDecoder.prototype.decode.call(this, input, options);
+ return DERDecoder.prototype.decode.$call(this, input, options);
};
},
});
@@ -10801,7 +10801,7 @@ var require_api = __commonJS({
return (
inherits(Generated, Base),
(Generated.prototype._initNamed = function (entity, name2) {
- Base.call(this, entity, name2);
+ Base.$call(this, entity, name2);
}),
new Generated(this)
);
@@ -11491,7 +11491,7 @@ var require_browser8 = __commonJS({
if (typeof algorithm === "string") {
algorithm = algorithm.toLowerCase();
}
- StreamModule.Writable.call(this);
+ StreamModule.Writable.$call(this);
var data = algorithms[algorithm];
if (!data) throw new Error("Unknown message digest");
(this._hashType = data.hash),
@@ -11513,7 +11513,7 @@ var require_browser8 = __commonJS({
return enc ? sig.toString(enc) : sig;
};
function Verify(algorithm) {
- StreamModule.Writable.call(this);
+ StreamModule.Writable.$call(this);
if (typeof algorithm === "string") {
algorithm = algorithm.toLowerCase();
}