cas-typescript-sdk 1.0.54 → 1.0.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +6 -0
- package/index.darwin-x64.node +0 -0
- package/index.js +55 -52
- package/index.linux-x64-gnu.node +0 -0
- package/index.linux-x64-musl.node +0 -0
- package/index.win32-x64-msvc.node +0 -0
- package/lib/asymmetric/RSAWrapper.d.ts +1 -1
- package/lib/asymmetric/RSAWrapper.d.ts.map +1 -1
- package/lib/asymmetric/RSAWrapper.js +25 -5
- package/lib/asymmetric/RSAWrapper.js.map +1 -1
- package/lib/asymmetric/index.d.ts +3 -2
- package/lib/asymmetric/index.d.ts.map +1 -1
- package/lib/asymmetric/index.js +5 -2
- package/lib/asymmetric/index.js.map +1 -1
- package/lib/cas-configuration.d.ts +20 -0
- package/lib/cas-configuration.d.ts.map +1 -0
- package/lib/cas-configuration.js +44 -0
- package/lib/cas-configuration.js.map +1 -0
- package/lib/decorators/benchmark-method.d.ts +2 -0
- package/lib/decorators/benchmark-method.d.ts.map +1 -0
- package/lib/decorators/benchmark-method.js +29 -0
- package/lib/decorators/benchmark-method.js.map +1 -0
- package/lib/digital-signature/digital-siganture-sha-512.d.ts +2 -2
- package/lib/digital-signature/digital-siganture-sha-512.d.ts.map +1 -1
- package/lib/digital-signature/digital-siganture-sha-512.js +18 -4
- package/lib/digital-signature/digital-siganture-sha-512.js.map +1 -1
- package/lib/digital-signature/digital-signature-base.d.ts +1 -1
- package/lib/digital-signature/digital-signature-base.d.ts.map +1 -1
- package/lib/digital-signature/digital-signature-base.js +2 -1
- package/lib/digital-signature/digital-signature-factory.d.ts +1 -1
- package/lib/digital-signature/digital-signature-factory.d.ts.map +1 -1
- package/lib/digital-signature/digital-signature-factory.js +11 -7
- package/lib/digital-signature/digital-signature-factory.js.map +1 -1
- package/lib/digital-signature/digital-signaturte-sha-256.d.ts +4 -4
- package/lib/digital-signature/digital-signaturte-sha-256.d.ts.map +1 -1
- package/lib/digital-signature/digital-signaturte-sha-256.js +23 -6
- package/lib/digital-signature/digital-signaturte-sha-256.js.map +1 -1
- package/lib/digital-signature/index.d.ts +5 -5
- package/lib/digital-signature/index.d.ts.map +1 -1
- package/lib/digital-signature/index.js +11 -6
- package/lib/digital-signature/index.js.map +1 -1
- package/lib/hashers/blake2-wrapper.d.ts +1 -1
- package/lib/hashers/blake2-wrapper.d.ts.map +1 -1
- package/lib/hashers/blake2-wrapper.js +29 -6
- package/lib/hashers/blake2-wrapper.js.map +1 -1
- package/lib/hashers/hasher-base.js +2 -1
- package/lib/hashers/hasher-factory.d.ts +1 -1
- package/lib/hashers/hasher-factory.d.ts.map +1 -1
- package/lib/hashers/hasher-factory.js +11 -7
- package/lib/hashers/hasher-factory.js.map +1 -1
- package/lib/hashers/hasher-type.js +5 -2
- package/lib/hashers/hasher-type.js.map +1 -1
- package/lib/hashers/index.d.ts +4 -4
- package/lib/hashers/index.d.ts.map +1 -1
- package/lib/hashers/index.js +11 -5
- package/lib/hashers/index.js.map +1 -1
- package/lib/hashers/sha-wrapper.d.ts +1 -1
- package/lib/hashers/sha-wrapper.d.ts.map +1 -1
- package/lib/hashers/sha-wrapper.js +29 -6
- package/lib/hashers/sha-wrapper.js.map +1 -1
- package/lib/http/http-wrapper.d.ts +6 -0
- package/lib/http/http-wrapper.d.ts.map +1 -0
- package/lib/http/http-wrapper.js +30 -0
- package/lib/http/http-wrapper.js.map +1 -0
- package/lib/hybrid/hpke.d.ts +1 -1
- package/lib/hybrid/hpke.d.ts.map +1 -1
- package/lib/hybrid/hpke.js +29 -6
- package/lib/hybrid/hpke.js.map +1 -1
- package/lib/hybrid/index.d.ts +1 -1
- package/lib/hybrid/index.d.ts.map +1 -1
- package/lib/hybrid/index.js +5 -2
- package/lib/hybrid/index.js.map +1 -1
- package/lib/index.d.ts +12 -41
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +32 -41
- package/lib/index.js.map +1 -1
- package/lib/key_exchange/index.d.ts +2 -2
- package/lib/key_exchange/index.d.ts.map +1 -1
- package/lib/key_exchange/index.js +5 -3
- package/lib/key_exchange/index.js.map +1 -1
- package/lib/key_exchange/x25519.d.ts +1 -1
- package/lib/key_exchange/x25519.d.ts.map +1 -1
- package/lib/key_exchange/x25519.js +21 -4
- package/lib/key_exchange/x25519.js.map +1 -1
- package/lib/message/hmac.d.ts.map +1 -1
- package/lib/message/hmac.js +21 -4
- package/lib/message/hmac.js.map +1 -1
- package/lib/message/index.d.ts +1 -1
- package/lib/message/index.d.ts.map +1 -1
- package/lib/message/index.js +5 -2
- package/lib/message/index.js.map +1 -1
- package/lib/password-hashers/argon2-wrapper.d.ts +1 -1
- package/lib/password-hashers/argon2-wrapper.d.ts.map +1 -1
- package/lib/password-hashers/argon2-wrapper.js +22 -5
- package/lib/password-hashers/argon2-wrapper.js.map +1 -1
- package/lib/password-hashers/bcrypt-wrapper.d.ts +1 -1
- package/lib/password-hashers/bcrypt-wrapper.d.ts.map +1 -1
- package/lib/password-hashers/bcrypt-wrapper.js +25 -5
- package/lib/password-hashers/bcrypt-wrapper.js.map +1 -1
- package/lib/password-hashers/index.d.ts +5 -5
- package/lib/password-hashers/index.d.ts.map +1 -1
- package/lib/password-hashers/index.js +13 -6
- package/lib/password-hashers/index.js.map +1 -1
- package/lib/password-hashers/password-hasher-base.js +2 -1
- package/lib/password-hashers/password-hasher-factory.d.ts +1 -1
- package/lib/password-hashers/password-hasher-factory.d.ts.map +1 -1
- package/lib/password-hashers/password-hasher-factory.js +14 -10
- package/lib/password-hashers/password-hasher-factory.js.map +1 -1
- package/lib/password-hashers/password-hasher-type.js +5 -2
- package/lib/password-hashers/password-hasher-type.js.map +1 -1
- package/lib/password-hashers/scrypt-wrapper.d.ts +1 -1
- package/lib/password-hashers/scrypt-wrapper.d.ts.map +1 -1
- package/lib/password-hashers/scrypt-wrapper.js +25 -5
- package/lib/password-hashers/scrypt-wrapper.js.map +1 -1
- package/lib/signature/ed25519-wrapper.d.ts +2 -2
- package/lib/signature/ed25519-wrapper.d.ts.map +1 -1
- package/lib/signature/ed25519-wrapper.js +25 -5
- package/lib/signature/ed25519-wrapper.js.map +1 -1
- package/lib/signature/index.d.ts +1 -1
- package/lib/signature/index.d.ts.map +1 -1
- package/lib/signature/index.js +5 -2
- package/lib/signature/index.js.map +1 -1
- package/lib/sponges/ascon-wrapper.d.ts.map +1 -1
- package/lib/sponges/ascon-wrapper.js +29 -6
- package/lib/sponges/ascon-wrapper.js.map +1 -1
- package/lib/sponges/index.d.ts +1 -1
- package/lib/sponges/index.d.ts.map +1 -1
- package/lib/sponges/index.js +5 -2
- package/lib/sponges/index.js.map +1 -1
- package/lib/symmetric/aes-wrapper.d.ts.map +1 -1
- package/lib/symmetric/aes-wrapper.js +49 -11
- package/lib/symmetric/aes-wrapper.js.map +1 -1
- package/lib/symmetric/index.d.ts +1 -1
- package/lib/symmetric/index.d.ts.map +1 -1
- package/lib/symmetric/index.js +5 -2
- package/lib/symmetric/index.js.map +1 -1
- package/package.json +2 -3
package/lib/hybrid/hpke.js
CHANGED
|
@@ -1,18 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.HpkeWrapper = void 0;
|
|
10
|
+
const index_1 = require("../../index");
|
|
11
|
+
const benchmark_method_1 = require("../decorators/benchmark-method");
|
|
12
|
+
class HpkeWrapper {
|
|
3
13
|
/**
|
|
4
14
|
* Generate a new HPKE key pair along with an info string
|
|
5
15
|
* @returns HpkeKeyResult
|
|
6
16
|
*/
|
|
7
17
|
generateKeyPair() {
|
|
8
|
-
return hpkeGenerateKeypair();
|
|
18
|
+
return (0, index_1.hpkeGenerateKeypair)();
|
|
9
19
|
}
|
|
10
20
|
/**
|
|
11
21
|
* Generate a new info string for HPKE
|
|
12
22
|
* @returns A byte array representing the info string
|
|
13
23
|
*/
|
|
14
24
|
generateInfoString() {
|
|
15
|
-
return generateInfoStr();
|
|
25
|
+
return (0, index_1.generateInfoStr)();
|
|
16
26
|
}
|
|
17
27
|
/**
|
|
18
28
|
* Encrypt a message using HPKE
|
|
@@ -22,7 +32,7 @@ export class HpkeWrapper {
|
|
|
22
32
|
* @returns HpkeEncryptResult
|
|
23
33
|
*/
|
|
24
34
|
encrypt(plaintext, publicKey, infoStr) {
|
|
25
|
-
return hpkeEncrypt(plaintext, publicKey, infoStr);
|
|
35
|
+
return (0, index_1.hpkeEncrypt)(plaintext, publicKey, infoStr);
|
|
26
36
|
}
|
|
27
37
|
/**
|
|
28
38
|
* Decrypt a message using HPKE
|
|
@@ -34,7 +44,20 @@ export class HpkeWrapper {
|
|
|
34
44
|
* @returns The decrypted message
|
|
35
45
|
*/
|
|
36
46
|
decrypt(ciphertext, privateKey, encapsulatedKey, tag, infoStr) {
|
|
37
|
-
return hpkeDecrypt(ciphertext, privateKey, encapsulatedKey, tag, infoStr);
|
|
47
|
+
return (0, index_1.hpkeDecrypt)(ciphertext, privateKey, encapsulatedKey, tag, infoStr);
|
|
38
48
|
}
|
|
39
49
|
}
|
|
50
|
+
exports.HpkeWrapper = HpkeWrapper;
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, benchmark_method_1.benchmarkMethod)()
|
|
53
|
+
], HpkeWrapper.prototype, "generateKeyPair", null);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, benchmark_method_1.benchmarkMethod)()
|
|
56
|
+
], HpkeWrapper.prototype, "generateInfoString", null);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, benchmark_method_1.benchmarkMethod)()
|
|
59
|
+
], HpkeWrapper.prototype, "encrypt", null);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, benchmark_method_1.benchmarkMethod)()
|
|
62
|
+
], HpkeWrapper.prototype, "decrypt", null);
|
|
40
63
|
//# sourceMappingURL=hpke.js.map
|
package/lib/hybrid/hpke.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hpke.js","sourceRoot":"","sources":["../../src-ts/hybrid/hpke.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"hpke.js","sourceRoot":"","sources":["../../src-ts/hybrid/hpke.ts"],"names":[],"mappings":";;;;;;;;;AAAA,uCAA6H;AAC7H,qEAAiE;AAEjE,MAAa,WAAW;IAEpB;;;OAGG;IAEI,eAAe;QAClB,OAAO,IAAA,2BAAmB,GAAE,CAAC;IACjC,CAAC;IAED;;;OAGG;IAEI,kBAAkB;QACrB,OAAO,IAAA,uBAAe,GAAE,CAAC;IAC7B,CAAC;IAED;;;;;;OAMG;IAEI,OAAO,CAAC,SAAmB,EAAE,SAAmB,EAAE,OAAiB;QACtE,OAAO,IAAA,mBAAW,EAAC,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;IAED;;;;;;;;OAQG;IAEI,OAAO,CAAC,UAAoB,EAAE,UAAoB,EAAE,eAAyB,EAAE,GAAa,EAAE,OAAiB;QAClH,OAAO,IAAA,mBAAW,EAAC,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC9E,CAAC;CACJ;AA7CD,kCA6CC;AAtCU;IADN,IAAA,kCAAe,GAAE;kDAGjB;AAOM;IADN,IAAA,kCAAe,GAAE;qDAGjB;AAUM;IADN,IAAA,kCAAe,GAAE;0CAGjB;AAYM;IADN,IAAA,kCAAe,GAAE;0CAGjB"}
|
package/lib/hybrid/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src-ts/hybrid/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src-ts/hybrid/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
package/lib/hybrid/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HpkeWrapper = void 0;
|
|
4
|
+
const hpke_1 = require("./hpke");
|
|
5
|
+
Object.defineProperty(exports, "HpkeWrapper", { enumerable: true, get: function () { return hpke_1.HpkeWrapper; } });
|
|
3
6
|
//# sourceMappingURL=index.js.map
|
package/lib/hybrid/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src-ts/hybrid/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src-ts/hybrid/index.ts"],"names":[],"mappings":";;;AAAA,iCAAqC;AAE5B,4FAFA,kBAAW,OAEA"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,42 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
export * from "./hashers
|
|
3
|
-
export * from "./
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./
|
|
6
|
-
export * from "./
|
|
7
|
-
export * from "./
|
|
8
|
-
export * from "./
|
|
9
|
-
export * from "./
|
|
10
|
-
export * from "./
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
publicKey: Array<number>;
|
|
14
|
-
}
|
|
15
|
-
export declare class CASRSADigitalSignatureResult {
|
|
16
|
-
publicKey: string;
|
|
17
|
-
privateKey: string;
|
|
18
|
-
signature: Array<number>;
|
|
19
|
-
}
|
|
20
|
-
export declare class CASRSAKeyPairResult {
|
|
21
|
-
privateKey: string;
|
|
22
|
-
publicKey: string;
|
|
23
|
-
}
|
|
24
|
-
export declare class CASSHAED25519DalekDigitalSignatureResult {
|
|
25
|
-
publicKey: Array<number>;
|
|
26
|
-
signature: Array<number>;
|
|
27
|
-
}
|
|
28
|
-
export declare class CASx25519SecretPublicKeyResult {
|
|
29
|
-
publicKey: Array<number>;
|
|
30
|
-
secretKey: Array<number>;
|
|
31
|
-
}
|
|
32
|
-
export declare class HpkeEncryptResult {
|
|
33
|
-
tag: Array<number>;
|
|
34
|
-
ciphertext: Array<number>;
|
|
35
|
-
encapsulatedKey: Array<number>;
|
|
36
|
-
}
|
|
37
|
-
export declare class HpkeKeyResult {
|
|
38
|
-
publicKey: Array<number>;
|
|
39
|
-
secretKey: Array<number>;
|
|
40
|
-
infoStr: Array<number>;
|
|
41
|
-
}
|
|
1
|
+
import CASConfiguration from "./cas-configuration";
|
|
2
|
+
export * from "./password-hashers";
|
|
3
|
+
export * from "./hashers";
|
|
4
|
+
export * from "./key_exchange";
|
|
5
|
+
export * from "./symmetric";
|
|
6
|
+
export * from "./asymmetric";
|
|
7
|
+
export * from "./digital-signature";
|
|
8
|
+
export * from "./sponges";
|
|
9
|
+
export * from "./message";
|
|
10
|
+
export * from "./signature";
|
|
11
|
+
export * from "./hybrid";
|
|
12
|
+
export { CASConfiguration };
|
|
42
13
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src-ts/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src-ts/index.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AAEnD,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,42 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
tag;
|
|
34
|
-
ciphertext;
|
|
35
|
-
encapsulatedKey;
|
|
36
|
-
}
|
|
37
|
-
export class HpkeKeyResult {
|
|
38
|
-
publicKey;
|
|
39
|
-
secretKey;
|
|
40
|
-
infoStr;
|
|
41
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.CASConfiguration = void 0;
|
|
21
|
+
const cas_configuration_1 = __importDefault(require("./cas-configuration"));
|
|
22
|
+
exports.CASConfiguration = cas_configuration_1.default;
|
|
23
|
+
__exportStar(require("./password-hashers"), exports);
|
|
24
|
+
__exportStar(require("./hashers"), exports);
|
|
25
|
+
__exportStar(require("./key_exchange"), exports);
|
|
26
|
+
__exportStar(require("./symmetric"), exports);
|
|
27
|
+
__exportStar(require("./asymmetric"), exports);
|
|
28
|
+
__exportStar(require("./digital-signature"), exports);
|
|
29
|
+
__exportStar(require("./sponges"), exports);
|
|
30
|
+
__exportStar(require("./message"), exports);
|
|
31
|
+
__exportStar(require("./signature"), exports);
|
|
32
|
+
__exportStar(require("./hybrid"), exports);
|
|
42
33
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src-ts/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src-ts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,4EAAmD;AAY1C,2BAZF,2BAAgB,CAYE;AAVzB,qDAAmC;AACnC,4CAA0B;AAC1B,iDAA+B;AAC/B,8CAA4B;AAC5B,+CAA6B;AAC7B,sDAAoC;AACpC,4CAA0B;AAC1B,4CAA0B;AAC1B,8CAA4B;AAC5B,2CAAyB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CASx25519SecretPublicKeyResult } from "
|
|
2
|
-
import { X25519Wrapper } from "./x25519
|
|
1
|
+
import { CASx25519SecretPublicKeyResult } from "../../index";
|
|
2
|
+
import { X25519Wrapper } from "./x25519";
|
|
3
3
|
export { X25519Wrapper, CASx25519SecretPublicKeyResult };
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src-ts/key_exchange/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src-ts/key_exchange/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,aAAa,EAAE,8BAA8B,EAAE,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.X25519Wrapper = void 0;
|
|
4
|
+
const x25519_1 = require("./x25519");
|
|
5
|
+
Object.defineProperty(exports, "X25519Wrapper", { enumerable: true, get: function () { return x25519_1.X25519Wrapper; } });
|
|
4
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src-ts/key_exchange/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src-ts/key_exchange/index.ts"],"names":[],"mappings":";;;AACA,qCAAyC;AAEhC,8FAFA,sBAAa,OAEA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"x25519.d.ts","sourceRoot":"","sources":["../../src-ts/key_exchange/x25519.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAyD,MAAM,
|
|
1
|
+
{"version":3,"file":"x25519.d.ts","sourceRoot":"","sources":["../../src-ts/key_exchange/x25519.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAyD,MAAM,aAAa,CAAA;AAGnH,qBAAa,aAAa;IACtB;;;;OAIG;IAEI,0BAA0B,IAAI,8BAA8B;IAInE;;;;;;OAMG;IAEI,oBAAoB,CAAC,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC;CAGjG"}
|
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.X25519Wrapper = void 0;
|
|
10
|
+
const index_1 = require("../../index");
|
|
11
|
+
const benchmark_method_1 = require("../decorators/benchmark-method");
|
|
12
|
+
class X25519Wrapper {
|
|
3
13
|
/**
|
|
4
14
|
* Generates and secret and public key to be used to create a shared secret with Diffie Hellman.
|
|
5
15
|
* User should share their public key with the other user and take the other user's public key and they can generate a Shared Secret.
|
|
6
16
|
* @returns X25519SecretPublicKeyResult
|
|
7
17
|
*/
|
|
8
18
|
generateSecretAndPublicKey() {
|
|
9
|
-
return x25519GenerateSecretAndPublicKey();
|
|
19
|
+
return (0, index_1.x25519GenerateSecretAndPublicKey)();
|
|
10
20
|
}
|
|
11
21
|
/**
|
|
12
22
|
* User takes their secret key and the other user's public key to generate a shared secret.
|
|
@@ -16,7 +26,14 @@ export class X25519Wrapper {
|
|
|
16
26
|
* @returns Array<number>
|
|
17
27
|
*/
|
|
18
28
|
generateSharedSecret(secretKey, publicKey) {
|
|
19
|
-
return x25519DiffieHellman(secretKey, publicKey);
|
|
29
|
+
return (0, index_1.x25519DiffieHellman)(secretKey, publicKey);
|
|
20
30
|
}
|
|
21
31
|
}
|
|
32
|
+
exports.X25519Wrapper = X25519Wrapper;
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, benchmark_method_1.benchmarkMethod)()
|
|
35
|
+
], X25519Wrapper.prototype, "generateSecretAndPublicKey", null);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, benchmark_method_1.benchmarkMethod)()
|
|
38
|
+
], X25519Wrapper.prototype, "generateSharedSecret", null);
|
|
22
39
|
//# sourceMappingURL=x25519.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"x25519.js","sourceRoot":"","sources":["../../src-ts/key_exchange/x25519.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"x25519.js","sourceRoot":"","sources":["../../src-ts/key_exchange/x25519.ts"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAmH;AACnH,qEAAiE;AAEjE,MAAa,aAAa;IACtB;;;;OAIG;IAEI,0BAA0B;QAC7B,OAAO,IAAA,wCAAgC,GAAE,CAAC;IAC9C,CAAC;IAED;;;;;;OAMG;IAEI,oBAAoB,CAAC,SAAwB,EAAE,SAAwB;QAC1E,OAAO,IAAA,2BAAmB,EAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACrD,CAAC;CACJ;AAtBD,sCAsBC;AAfU;IADN,IAAA,kCAAe,GAAE;+DAGjB;AAUM;IADN,IAAA,kCAAe,GAAE;yDAGjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmac.d.ts","sourceRoot":"","sources":["../../src-ts/message/hmac.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hmac.d.ts","sourceRoot":"","sources":["../../src-ts/message/hmac.ts"],"names":[],"mappings":"AAGA,qBAAa,WAAW;IAGb,aAAa,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC;IAWxE,eAAe,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,OAAO;CAYxG"}
|
package/lib/message/hmac.js
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.HmacWrapper = void 0;
|
|
10
|
+
const index_1 = require("../../index");
|
|
11
|
+
const benchmark_method_1 = require("../decorators/benchmark-method");
|
|
12
|
+
class HmacWrapper {
|
|
3
13
|
hmacSignBytes(key, message) {
|
|
4
14
|
if (key?.length === 0) {
|
|
5
15
|
throw new Error("Must provide an allocated key");
|
|
@@ -7,7 +17,7 @@ export class HmacWrapper {
|
|
|
7
17
|
if (message?.length === 0) {
|
|
8
18
|
throw new Error("Must provide an allocated message");
|
|
9
19
|
}
|
|
10
|
-
return hmacSign(key, message);
|
|
20
|
+
return (0, index_1.hmacSign)(key, message);
|
|
11
21
|
}
|
|
12
22
|
hmacVerifyBytes(key, message, signature) {
|
|
13
23
|
if (key?.length === 0) {
|
|
@@ -19,7 +29,14 @@ export class HmacWrapper {
|
|
|
19
29
|
if (signature?.length === 0) {
|
|
20
30
|
throw new Error("Must provide an allocated signature");
|
|
21
31
|
}
|
|
22
|
-
return hmacVerify(key, message, signature);
|
|
32
|
+
return (0, index_1.hmacVerify)(key, message, signature);
|
|
23
33
|
}
|
|
24
34
|
}
|
|
35
|
+
exports.HmacWrapper = HmacWrapper;
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, benchmark_method_1.benchmarkMethod)()
|
|
38
|
+
], HmacWrapper.prototype, "hmacSignBytes", null);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, benchmark_method_1.benchmarkMethod)()
|
|
41
|
+
], HmacWrapper.prototype, "hmacVerifyBytes", null);
|
|
25
42
|
//# sourceMappingURL=hmac.js.map
|
package/lib/message/hmac.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmac.js","sourceRoot":"","sources":["../../src-ts/message/hmac.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"hmac.js","sourceRoot":"","sources":["../../src-ts/message/hmac.ts"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAmD;AACnD,qEAAiE;AAEjE,MAAa,WAAW;IAGb,aAAa,CAAC,GAAkB,EAAE,OAAsB;QAC3D,IAAI,GAAG,EAAE,MAAM,KAAK,CAAC,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;QACrD,CAAC;QACD,IAAI,OAAO,EAAE,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;QACzD,CAAC;QACD,OAAO,IAAA,gBAAQ,EAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAClC,CAAC;IAGM,eAAe,CAAC,GAAkB,EAAE,OAAsB,EAAE,SAAwB;QACvF,IAAI,GAAG,EAAE,MAAM,KAAK,CAAC,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;QACrD,CAAC;QACD,IAAI,OAAO,EAAE,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;QACzD,CAAC;QACD,IAAG,SAAS,EAAE,MAAM,KAAG,CAAC,EAAE,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,IAAA,kBAAU,EAAC,GAAG,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;IAC/C,CAAC;CACJ;AA1BD,kCA0BC;AAvBU;IADN,IAAA,kCAAe,GAAE;gDASjB;AAGM;IADN,IAAA,kCAAe,GAAE;kDAYjB"}
|
package/lib/message/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src-ts/message/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src-ts/message/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
package/lib/message/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HmacWrapper = void 0;
|
|
4
|
+
const hmac_1 = require("./hmac");
|
|
5
|
+
Object.defineProperty(exports, "HmacWrapper", { enumerable: true, get: function () { return hmac_1.HmacWrapper; } });
|
|
3
6
|
//# sourceMappingURL=index.js.map
|
package/lib/message/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src-ts/message/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src-ts/message/index.ts"],"names":[],"mappings":";;;AAAA,iCAAqC;AAE5B,4FAFA,kBAAW,OAEA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"argon2-wrapper.d.ts","sourceRoot":"","sources":["../../src-ts/password-hashers/argon2-wrapper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"argon2-wrapper.d.ts","sourceRoot":"","sources":["../../src-ts/password-hashers/argon2-wrapper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,qBAAa,aAAc,YAAW,mBAAmB;IACvD;;;;OAIG;IAGI,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAO7C;;;;;;;OAOG;IAEI,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM;IAO9G;;;;;OAKG;IACI,MAAM,CAAC,cAAc,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,OAAO;CAQzE"}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.Argon2Wrapper = void 0;
|
|
10
|
+
const benchmark_method_1 = require("../decorators/benchmark-method");
|
|
11
|
+
const index_1 = require("./../../index");
|
|
12
|
+
class Argon2Wrapper {
|
|
3
13
|
/**
|
|
4
14
|
* Hashes a password with Argon2
|
|
5
15
|
* @param password
|
|
@@ -9,7 +19,7 @@ export class Argon2Wrapper {
|
|
|
9
19
|
if (!password) {
|
|
10
20
|
throw new Error("You must provide a password to hash with Argon2");
|
|
11
21
|
}
|
|
12
|
-
return argon2Hash(password);
|
|
22
|
+
return (0, index_1.argon2Hash)(password);
|
|
13
23
|
}
|
|
14
24
|
/**
|
|
15
25
|
* Hashes a password with Argon2 using custom parameters
|
|
@@ -23,7 +33,7 @@ export class Argon2Wrapper {
|
|
|
23
33
|
if (!password) {
|
|
24
34
|
throw new Error("You must provide a password to hash with Argon2");
|
|
25
35
|
}
|
|
26
|
-
return argon2HashParams(memoryCost, timeCost, parallelism, password);
|
|
36
|
+
return (0, index_1.argon2HashParams)(memoryCost, timeCost, parallelism, password);
|
|
27
37
|
}
|
|
28
38
|
/**
|
|
29
39
|
* Verifies that a password is the same as the hashed password with Argon2.
|
|
@@ -35,7 +45,14 @@ export class Argon2Wrapper {
|
|
|
35
45
|
if (!hashedPassword || !passwordToVerify) {
|
|
36
46
|
throw new Error("You must provide a hashed password and a plaintext password to verify with Argon2");
|
|
37
47
|
}
|
|
38
|
-
return argon2Verify(hashedPassword, passwordToVerify);
|
|
48
|
+
return (0, index_1.argon2Verify)(hashedPassword, passwordToVerify);
|
|
39
49
|
}
|
|
40
50
|
}
|
|
51
|
+
exports.Argon2Wrapper = Argon2Wrapper;
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, benchmark_method_1.benchmarkMethod)()
|
|
54
|
+
], Argon2Wrapper.prototype, "hashPassword", null);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, benchmark_method_1.benchmarkMethod)()
|
|
57
|
+
], Argon2Wrapper.prototype, "hashPasswordParams", null);
|
|
41
58
|
//# sourceMappingURL=argon2-wrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"argon2-wrapper.js","sourceRoot":"","sources":["../../src-ts/password-hashers/argon2-wrapper.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"argon2-wrapper.js","sourceRoot":"","sources":["../../src-ts/password-hashers/argon2-wrapper.ts"],"names":[],"mappings":";;;;;;;;;AAAA,qEAAiE;AACjE,yCAA0E;AAG1E,MAAa,aAAa;IACxB;;;;OAIG;IAGI,YAAY,CAAC,QAAgB;QAClC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;QACrE,CAAC;QACD,OAAO,IAAA,kBAAU,EAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;IAED;;;;;;;OAOG;IAEI,kBAAkB,CAAC,QAAgB,EAAE,UAAkB,EAAE,QAAgB,EAAE,WAAmB;QACnG,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;QACrE,CAAC;QACD,OAAO,IAAA,wBAAgB,EAAC,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;IACvE,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,cAAsB,EAAE,gBAAwB;QAC5D,IAAI,CAAC,cAAc,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACzC,MAAM,IAAI,KAAK,CACb,mFAAmF,CACpF,CAAC;QACJ,CAAC;QACD,OAAO,IAAA,oBAAY,EAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;IACxD,CAAC;CACF;AA7CD,sCA6CC;AArCQ;IADN,IAAA,kCAAe,GAAE;iDAMjB;AAWM;IADN,IAAA,kCAAe,GAAE;uDAMjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bcrypt-wrapper.d.ts","sourceRoot":"","sources":["../../src-ts/password-hashers/bcrypt-wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"bcrypt-wrapper.d.ts","sourceRoot":"","sources":["../../src-ts/password-hashers/bcrypt-wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAI7D,qBAAa,aAAc,YAAW,mBAAmB;IAEvD;;;;OAIG;IAEI,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAO7C;;;;;OAKG;IAEI,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM;IAOjE;;;;;OAKG;IAEI,MAAM,CACX,cAAc,EAAE,MAAM,EACtB,gBAAgB,EAAE,MAAM,GACvB,OAAO;CAQX"}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.BCryptWrapper = void 0;
|
|
10
|
+
const index_1 = require("./../../index");
|
|
11
|
+
const benchmark_method_1 = require("../decorators/benchmark-method");
|
|
12
|
+
class BCryptWrapper {
|
|
3
13
|
/**
|
|
4
14
|
* Hashes a password with BCrypt
|
|
5
15
|
* @param password
|
|
@@ -9,7 +19,7 @@ export class BCryptWrapper {
|
|
|
9
19
|
if (!password) {
|
|
10
20
|
throw new Error("You must provide a password to hash with BCrypt");
|
|
11
21
|
}
|
|
12
|
-
return bcryptHash(password);
|
|
22
|
+
return (0, index_1.bcryptHash)(password);
|
|
13
23
|
}
|
|
14
24
|
/**
|
|
15
25
|
* Hashes a password with BCrypt using custom cost
|
|
@@ -21,7 +31,7 @@ export class BCryptWrapper {
|
|
|
21
31
|
if (!password) {
|
|
22
32
|
throw new Error("You must provide a password to hash with BCrypt");
|
|
23
33
|
}
|
|
24
|
-
return bcryptHashParams(cost, password);
|
|
34
|
+
return (0, index_1.bcryptHashParams)(cost, password);
|
|
25
35
|
}
|
|
26
36
|
/**
|
|
27
37
|
* Verifies that a password is the same as the hashed password with BCrypt.
|
|
@@ -33,7 +43,17 @@ export class BCryptWrapper {
|
|
|
33
43
|
if (!hashedPassword || !passwordToVerify) {
|
|
34
44
|
throw new Error("You must provide a hashed password and a plaintext password to verify with BCrypt");
|
|
35
45
|
}
|
|
36
|
-
return bcryptVerify(hashedPassword, passwordToVerify);
|
|
46
|
+
return (0, index_1.bcryptVerify)(hashedPassword, passwordToVerify);
|
|
37
47
|
}
|
|
38
48
|
}
|
|
49
|
+
exports.BCryptWrapper = BCryptWrapper;
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, benchmark_method_1.benchmarkMethod)()
|
|
52
|
+
], BCryptWrapper.prototype, "hashPassword", null);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, benchmark_method_1.benchmarkMethod)()
|
|
55
|
+
], BCryptWrapper.prototype, "hashPasswordParams", null);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, benchmark_method_1.benchmarkMethod)()
|
|
58
|
+
], BCryptWrapper.prototype, "verify", null);
|
|
39
59
|
//# sourceMappingURL=bcrypt-wrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bcrypt-wrapper.js","sourceRoot":"","sources":["../../src-ts/password-hashers/bcrypt-wrapper.ts"],"names":[],"mappings":"AACA,
|
|
1
|
+
{"version":3,"file":"bcrypt-wrapper.js","sourceRoot":"","sources":["../../src-ts/password-hashers/bcrypt-wrapper.ts"],"names":[],"mappings":";;;;;;;;;AACA,yCAA2E;AAC3E,qEAAiE;AAEjE,MAAa,aAAa;IAExB;;;;OAIG;IAEI,YAAY,CAAC,QAAgB;QAClC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;QACrE,CAAC;QACD,OAAO,IAAA,kBAAU,EAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;IAED;;;;;OAKG;IAEI,kBAAkB,CAAC,QAAgB,EAAE,IAAY;QACtD,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;QACrE,CAAC;QACD,OAAO,IAAA,wBAAgB,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAED;;;;;OAKG;IAEI,MAAM,CACX,cAAsB,EACtB,gBAAwB;QAExB,IAAI,CAAC,cAAc,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACzC,MAAM,IAAI,KAAK,CACb,mFAAmF,CACpF,CAAC;QACJ,CAAC;QACD,OAAO,IAAA,oBAAY,EAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;IACxD,CAAC;CACF;AA/CD,sCA+CC;AAvCQ;IADN,IAAA,kCAAe,GAAE;iDAMjB;AASM;IADN,IAAA,kCAAe,GAAE;uDAMjB;AASM;IADN,IAAA,kCAAe,GAAE;2CAWjB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Argon2Wrapper } from "./argon2-wrapper
|
|
2
|
-
import { BCryptWrapper } from "./bcrypt-wrapper
|
|
3
|
-
import { ScryptWrapper } from "./scrypt-wrapper
|
|
4
|
-
import { PasswordHasherType } from "./password-hasher-type
|
|
5
|
-
import { PasswordHasherFactory } from "./password-hasher-factory
|
|
1
|
+
import { Argon2Wrapper } from "./argon2-wrapper";
|
|
2
|
+
import { BCryptWrapper } from "./bcrypt-wrapper";
|
|
3
|
+
import { ScryptWrapper } from "./scrypt-wrapper";
|
|
4
|
+
import { PasswordHasherType } from "./password-hasher-type";
|
|
5
|
+
import { PasswordHasherFactory } from "./password-hasher-factory";
|
|
6
6
|
export { Argon2Wrapper, BCryptWrapper, PasswordHasherFactory, PasswordHasherType, ScryptWrapper, };
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src-ts/password-hashers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src-ts/password-hashers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAElE,OAAO,EACL,aAAa,EACb,aAAa,EACb,qBAAqB,EACrB,kBAAkB,EAClB,aAAa,GACd,CAAC"}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ScryptWrapper = exports.PasswordHasherType = exports.PasswordHasherFactory = exports.BCryptWrapper = exports.Argon2Wrapper = void 0;
|
|
4
|
+
const argon2_wrapper_1 = require("./argon2-wrapper");
|
|
5
|
+
Object.defineProperty(exports, "Argon2Wrapper", { enumerable: true, get: function () { return argon2_wrapper_1.Argon2Wrapper; } });
|
|
6
|
+
const bcrypt_wrapper_1 = require("./bcrypt-wrapper");
|
|
7
|
+
Object.defineProperty(exports, "BCryptWrapper", { enumerable: true, get: function () { return bcrypt_wrapper_1.BCryptWrapper; } });
|
|
8
|
+
const scrypt_wrapper_1 = require("./scrypt-wrapper");
|
|
9
|
+
Object.defineProperty(exports, "ScryptWrapper", { enumerable: true, get: function () { return scrypt_wrapper_1.ScryptWrapper; } });
|
|
10
|
+
const password_hasher_type_1 = require("./password-hasher-type");
|
|
11
|
+
Object.defineProperty(exports, "PasswordHasherType", { enumerable: true, get: function () { return password_hasher_type_1.PasswordHasherType; } });
|
|
12
|
+
const password_hasher_factory_1 = require("./password-hasher-factory");
|
|
13
|
+
Object.defineProperty(exports, "PasswordHasherFactory", { enumerable: true, get: function () { return password_hasher_factory_1.PasswordHasherFactory; } });
|
|
7
14
|
//# sourceMappingURL=index.js.map
|