cas-typescript-sdk 1.0.53 → 1.0.54
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.darwin-x64.node +0 -0
- package/index.js +52 -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 +5 -9
- package/lib/asymmetric/RSAWrapper.js.map +1 -1
- package/lib/asymmetric/index.d.ts +2 -3
- package/lib/asymmetric/index.d.ts.map +1 -1
- package/lib/asymmetric/index.js +2 -5
- package/lib/asymmetric/index.js.map +1 -1
- 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 +4 -8
- 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 +1 -2
- 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 +7 -11
- 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 +6 -10
- 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 +6 -11
- 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 +6 -10
- package/lib/hashers/blake2-wrapper.js.map +1 -1
- package/lib/hashers/hasher-base.js +1 -2
- 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 +7 -11
- package/lib/hashers/hasher-factory.js.map +1 -1
- package/lib/hashers/hasher-type.js +2 -5
- 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 +5 -11
- 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 +6 -10
- package/lib/hashers/sha-wrapper.js.map +1 -1
- package/lib/hybrid/hpke.d.ts +1 -1
- package/lib/hybrid/hpke.d.ts.map +1 -1
- package/lib/hybrid/hpke.js +6 -10
- 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 +2 -5
- package/lib/hybrid/index.js.map +1 -1
- package/lib/index.d.ts +41 -10
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +41 -26
- 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 +3 -5
- 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 +4 -8
- package/lib/key_exchange/x25519.js.map +1 -1
- package/lib/message/hmac.js +4 -8
- 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 +2 -5
- 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 +5 -9
- 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 +5 -9
- 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 +6 -13
- package/lib/password-hashers/index.js.map +1 -1
- package/lib/password-hashers/password-hasher-base.js +1 -2
- 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 +10 -14
- package/lib/password-hashers/password-hasher-factory.js.map +1 -1
- package/lib/password-hashers/password-hasher-type.js +2 -5
- 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 +5 -9
- 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 +5 -9
- 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 +2 -5
- package/lib/signature/index.js.map +1 -1
- package/lib/sponges/ascon-wrapper.js +6 -10
- 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 +2 -5
- package/lib/sponges/index.js.map +1 -1
- package/lib/symmetric/aes-wrapper.js +11 -15
- 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 +2 -5
- package/lib/symmetric/index.js.map +1 -1
- package/package.json +3 -2
package/lib/message/hmac.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.HmacWrapper = void 0;
|
|
4
|
-
const index_1 = require("../../index");
|
|
5
|
-
class HmacWrapper {
|
|
1
|
+
import { hmacSign, hmacVerify } from "../../index.js";
|
|
2
|
+
export class HmacWrapper {
|
|
6
3
|
hmacSignBytes(key, message) {
|
|
7
4
|
if (key?.length === 0) {
|
|
8
5
|
throw new Error("Must provide an allocated key");
|
|
@@ -10,7 +7,7 @@ class HmacWrapper {
|
|
|
10
7
|
if (message?.length === 0) {
|
|
11
8
|
throw new Error("Must provide an allocated message");
|
|
12
9
|
}
|
|
13
|
-
return
|
|
10
|
+
return hmacSign(key, message);
|
|
14
11
|
}
|
|
15
12
|
hmacVerifyBytes(key, message, signature) {
|
|
16
13
|
if (key?.length === 0) {
|
|
@@ -22,8 +19,7 @@ class HmacWrapper {
|
|
|
22
19
|
if (signature?.length === 0) {
|
|
23
20
|
throw new Error("Must provide an allocated signature");
|
|
24
21
|
}
|
|
25
|
-
return
|
|
22
|
+
return hmacVerify(key, message, signature);
|
|
26
23
|
}
|
|
27
24
|
}
|
|
28
|
-
exports.HmacWrapper = HmacWrapper;
|
|
29
25
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"hmac.js","sourceRoot":"","sources":["../../src-ts/message/hmac.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEtD,MAAM,OAAO,WAAW;IACb,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,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAClC,CAAC;IAEM,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,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;IAC/C,CAAC;CACJ"}
|
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,WAAW,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
package/lib/message/index.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.HmacWrapper = void 0;
|
|
4
|
-
const hmac_1 = require("./hmac");
|
|
5
|
-
Object.defineProperty(exports, "HmacWrapper", { enumerable: true, get: function () { return hmac_1.HmacWrapper; } });
|
|
1
|
+
import { HmacWrapper } from "./hmac.js";
|
|
2
|
+
export { HmacWrapper };
|
|
6
3
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src-ts/message/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"argon2-wrapper.d.ts","sourceRoot":"","sources":["../../src-ts/password-hashers/argon2-wrapper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"argon2-wrapper.d.ts","sourceRoot":"","sources":["../../src-ts/password-hashers/argon2-wrapper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,qBAAa,aAAc,YAAW,mBAAmB;IACvD;;;;OAIG;IACI,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAO7C;;;;;;;OAOG;IACI,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,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.Argon2Wrapper = void 0;
|
|
4
|
-
const index_1 = require("./../../index");
|
|
5
|
-
class Argon2Wrapper {
|
|
1
|
+
import { argon2Hash, argon2HashParams, argon2Verify } from "./../../index.js";
|
|
2
|
+
export class Argon2Wrapper {
|
|
6
3
|
/**
|
|
7
4
|
* Hashes a password with Argon2
|
|
8
5
|
* @param password
|
|
@@ -12,7 +9,7 @@ class Argon2Wrapper {
|
|
|
12
9
|
if (!password) {
|
|
13
10
|
throw new Error("You must provide a password to hash with Argon2");
|
|
14
11
|
}
|
|
15
|
-
return
|
|
12
|
+
return argon2Hash(password);
|
|
16
13
|
}
|
|
17
14
|
/**
|
|
18
15
|
* Hashes a password with Argon2 using custom parameters
|
|
@@ -26,7 +23,7 @@ class Argon2Wrapper {
|
|
|
26
23
|
if (!password) {
|
|
27
24
|
throw new Error("You must provide a password to hash with Argon2");
|
|
28
25
|
}
|
|
29
|
-
return
|
|
26
|
+
return argon2HashParams(memoryCost, timeCost, parallelism, password);
|
|
30
27
|
}
|
|
31
28
|
/**
|
|
32
29
|
* Verifies that a password is the same as the hashed password with Argon2.
|
|
@@ -38,8 +35,7 @@ class Argon2Wrapper {
|
|
|
38
35
|
if (!hashedPassword || !passwordToVerify) {
|
|
39
36
|
throw new Error("You must provide a hashed password and a plaintext password to verify with Argon2");
|
|
40
37
|
}
|
|
41
|
-
return
|
|
38
|
+
return argon2Verify(hashedPassword, passwordToVerify);
|
|
42
39
|
}
|
|
43
40
|
}
|
|
44
|
-
exports.Argon2Wrapper = Argon2Wrapper;
|
|
45
41
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"argon2-wrapper.js","sourceRoot":"","sources":["../../src-ts/password-hashers/argon2-wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAG7E,MAAM,OAAO,aAAa;IACxB;;;;OAIG;IACI,YAAY,CAAC,QAAgB;QAClC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;QACrE,CAAC;QACD,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;IAED;;;;;;;OAOG;IACI,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,gBAAgB,CAAC,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,YAAY,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;IACxD,CAAC;CACF"}
|
|
@@ -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,2BAA2B,CAAC;AAGhE,qBAAa,aAAc,YAAW,mBAAmB;IAEvD;;;;OAIG;IACI,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAO7C;;;;;OAKG;IACI,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM;IAOjE;;;;;OAKG;IACI,MAAM,CACX,cAAc,EAAE,MAAM,EACtB,gBAAgB,EAAE,MAAM,GACvB,OAAO;CAQX"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.BCryptWrapper = void 0;
|
|
4
|
-
const index_1 = require("./../../index");
|
|
5
|
-
class BCryptWrapper {
|
|
1
|
+
import { bcryptHash, bcryptHashParams, bcryptVerify } from "./../../index.js";
|
|
2
|
+
export class BCryptWrapper {
|
|
6
3
|
/**
|
|
7
4
|
* Hashes a password with BCrypt
|
|
8
5
|
* @param password
|
|
@@ -12,7 +9,7 @@ class BCryptWrapper {
|
|
|
12
9
|
if (!password) {
|
|
13
10
|
throw new Error("You must provide a password to hash with BCrypt");
|
|
14
11
|
}
|
|
15
|
-
return
|
|
12
|
+
return bcryptHash(password);
|
|
16
13
|
}
|
|
17
14
|
/**
|
|
18
15
|
* Hashes a password with BCrypt using custom cost
|
|
@@ -24,7 +21,7 @@ class BCryptWrapper {
|
|
|
24
21
|
if (!password) {
|
|
25
22
|
throw new Error("You must provide a password to hash with BCrypt");
|
|
26
23
|
}
|
|
27
|
-
return
|
|
24
|
+
return bcryptHashParams(cost, password);
|
|
28
25
|
}
|
|
29
26
|
/**
|
|
30
27
|
* Verifies that a password is the same as the hashed password with BCrypt.
|
|
@@ -36,8 +33,7 @@ class BCryptWrapper {
|
|
|
36
33
|
if (!hashedPassword || !passwordToVerify) {
|
|
37
34
|
throw new Error("You must provide a hashed password and a plaintext password to verify with BCrypt");
|
|
38
35
|
}
|
|
39
|
-
return
|
|
36
|
+
return bcryptVerify(hashedPassword, passwordToVerify);
|
|
40
37
|
}
|
|
41
38
|
}
|
|
42
|
-
exports.BCryptWrapper = BCryptWrapper;
|
|
43
39
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"bcrypt-wrapper.js","sourceRoot":"","sources":["../../src-ts/password-hashers/bcrypt-wrapper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAE9E,MAAM,OAAO,aAAa;IAExB;;;;OAIG;IACI,YAAY,CAAC,QAAgB;QAClC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;QACrE,CAAC;QACD,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;IAED;;;;;OAKG;IACI,kBAAkB,CAAC,QAAgB,EAAE,IAAY;QACtD,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;QACrE,CAAC;QACD,OAAO,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAED;;;;;OAKG;IACI,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,YAAY,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;IACxD,CAAC;CACF"}
|
|
@@ -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.js";
|
|
2
|
+
import { BCryptWrapper } from "./bcrypt-wrapper.js";
|
|
3
|
+
import { ScryptWrapper } from "./scrypt-wrapper.js";
|
|
4
|
+
import { PasswordHasherType } from "./password-hasher-type.js";
|
|
5
|
+
import { PasswordHasherFactory } from "./password-hasher-factory.js";
|
|
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,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,EACL,aAAa,EACb,aAAa,EACb,qBAAqB,EACrB,kBAAkB,EAClB,aAAa,GACd,CAAC"}
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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; } });
|
|
1
|
+
import { Argon2Wrapper } from "./argon2-wrapper.js";
|
|
2
|
+
import { BCryptWrapper } from "./bcrypt-wrapper.js";
|
|
3
|
+
import { ScryptWrapper } from "./scrypt-wrapper.js";
|
|
4
|
+
import { PasswordHasherType } from "./password-hasher-type.js";
|
|
5
|
+
import { PasswordHasherFactory } from "./password-hasher-factory.js";
|
|
6
|
+
export { Argon2Wrapper, BCryptWrapper, PasswordHasherFactory, PasswordHasherType, ScryptWrapper, };
|
|
14
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src-ts/password-hashers/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src-ts/password-hashers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,EACL,aAAa,EACb,aAAa,EACb,qBAAqB,EACrB,kBAAkB,EAClB,aAAa,GACd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"password-hasher-factory.d.ts","sourceRoot":"","sources":["../../src-ts/password-hashers/password-hasher-factory.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"password-hasher-factory.d.ts","sourceRoot":"","sources":["../../src-ts/password-hashers/password-hasher-factory.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAG/D,qBAAa,qBAAqB;IAChC;;;;OAIG;IACH,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,kBAAkB,GAAG,GAAG;CAahD"}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const password_hasher_type_1 = require("./password-hasher-type");
|
|
7
|
-
const scrypt_wrapper_1 = require("./scrypt-wrapper");
|
|
8
|
-
class PasswordHasherFactory {
|
|
1
|
+
import { Argon2Wrapper } from "./argon2-wrapper.js";
|
|
2
|
+
import { BCryptWrapper } from "./bcrypt-wrapper.js";
|
|
3
|
+
import { PasswordHasherType } from "./password-hasher-type.js";
|
|
4
|
+
import { ScryptWrapper } from "./scrypt-wrapper.js";
|
|
5
|
+
export class PasswordHasherFactory {
|
|
9
6
|
/**
|
|
10
7
|
* Returns the appropriate hasher type based upon the type passed in.
|
|
11
8
|
* @param type
|
|
@@ -13,17 +10,16 @@ class PasswordHasherFactory {
|
|
|
13
10
|
*/
|
|
14
11
|
static getHasher(type) {
|
|
15
12
|
// Argon2 by default
|
|
16
|
-
let hasher = new
|
|
13
|
+
let hasher = new Argon2Wrapper();
|
|
17
14
|
switch (type) {
|
|
18
|
-
case
|
|
19
|
-
hasher = new
|
|
15
|
+
case PasswordHasherType.Bcrypt:
|
|
16
|
+
hasher = new BCryptWrapper();
|
|
20
17
|
break;
|
|
21
|
-
case
|
|
22
|
-
hasher = new
|
|
18
|
+
case PasswordHasherType.Scrypt:
|
|
19
|
+
hasher = new ScryptWrapper();
|
|
23
20
|
break;
|
|
24
21
|
}
|
|
25
22
|
return hasher;
|
|
26
23
|
}
|
|
27
24
|
}
|
|
28
|
-
exports.PasswordHasherFactory = PasswordHasherFactory;
|
|
29
25
|
//# sourceMappingURL=password-hasher-factory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"password-hasher-factory.js","sourceRoot":"","sources":["../../src-ts/password-hashers/password-hasher-factory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"password-hasher-factory.js","sourceRoot":"","sources":["../../src-ts/password-hashers/password-hasher-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,OAAO,qBAAqB;IAChC;;;;OAIG;IACH,MAAM,CAAC,SAAS,CAAC,IAAwB;QACvC,oBAAoB;QACpB,IAAI,MAAM,GAAG,IAAI,aAAa,EAAE,CAAC;QACjC,QAAQ,IAAI,EAAE,CAAC;YACb,KAAK,kBAAkB,CAAC,MAAM;gBAC5B,MAAM,GAAG,IAAI,aAAa,EAAE,CAAC;gBAC7B,MAAM;YACR,KAAK,kBAAkB,CAAC,MAAM;gBAC5B,MAAM,GAAG,IAAI,aAAa,EAAE,CAAC;gBAC7B,MAAM;QACV,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PasswordHasherType = void 0;
|
|
4
|
-
var PasswordHasherType;
|
|
1
|
+
export var PasswordHasherType;
|
|
5
2
|
(function (PasswordHasherType) {
|
|
6
3
|
PasswordHasherType[PasswordHasherType["Bcrypt"] = 1] = "Bcrypt";
|
|
7
4
|
PasswordHasherType[PasswordHasherType["Scrypt"] = 2] = "Scrypt";
|
|
8
5
|
PasswordHasherType[PasswordHasherType["Argon2"] = 3] = "Argon2";
|
|
9
|
-
})(PasswordHasherType || (
|
|
6
|
+
})(PasswordHasherType || (PasswordHasherType = {}));
|
|
10
7
|
//# sourceMappingURL=password-hasher-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"password-hasher-type.js","sourceRoot":"","sources":["../../src-ts/password-hashers/password-hasher-type.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"password-hasher-type.js","sourceRoot":"","sources":["../../src-ts/password-hashers/password-hasher-type.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC1B,+DAAU,CAAA;IACV,+DAAU,CAAA;IACV,+DAAU,CAAA;AACd,CAAC,EAJW,kBAAkB,KAAlB,kBAAkB,QAI7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scrypt-wrapper.d.ts","sourceRoot":"","sources":["../../src-ts/password-hashers/scrypt-wrapper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"scrypt-wrapper.d.ts","sourceRoot":"","sources":["../../src-ts/password-hashers/scrypt-wrapper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,qBAAa,aAAc,YAAW,mBAAmB;IAEvD;;;;OAIG;IACI,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAO7C;;;;;;;OAOG;IACI,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM;IAO5G;;;;;OAKG;IACI,MAAM,CAAC,cAAc,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,OAAO;CAQzE"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.ScryptWrapper = void 0;
|
|
4
|
-
const index_1 = require("../../index");
|
|
5
|
-
class ScryptWrapper {
|
|
1
|
+
import { scryptHash, scryptHashParams, scryptVerify } from "../../index.js";
|
|
2
|
+
export class ScryptWrapper {
|
|
6
3
|
/**
|
|
7
4
|
* Hashes a password with SCrypt
|
|
8
5
|
* @param password
|
|
@@ -12,7 +9,7 @@ class ScryptWrapper {
|
|
|
12
9
|
if (!password) {
|
|
13
10
|
throw new Error("You must provide a password to hash with Scrypt");
|
|
14
11
|
}
|
|
15
|
-
return
|
|
12
|
+
return scryptHash(password);
|
|
16
13
|
}
|
|
17
14
|
/**
|
|
18
15
|
* Hashes a password with SCrypt using custom parameters
|
|
@@ -26,7 +23,7 @@ class ScryptWrapper {
|
|
|
26
23
|
if (!password) {
|
|
27
24
|
throw new Error("You must provide a password to hash with Scrypt");
|
|
28
25
|
}
|
|
29
|
-
return
|
|
26
|
+
return scryptHashParams(password, cpuCost, blockSize, parallelism);
|
|
30
27
|
}
|
|
31
28
|
/**
|
|
32
29
|
* Verifies that a password is the same as the hashed password with SCrypt.
|
|
@@ -38,8 +35,7 @@ class ScryptWrapper {
|
|
|
38
35
|
if (!hashedPassword || !passwordToVerify) {
|
|
39
36
|
throw new Error("You must provide a hashed password and a plaintext password to verify with Scrypt");
|
|
40
37
|
}
|
|
41
|
-
return
|
|
38
|
+
return scryptVerify(hashedPassword, passwordToVerify);
|
|
42
39
|
}
|
|
43
40
|
}
|
|
44
|
-
exports.ScryptWrapper = ScryptWrapper;
|
|
45
41
|
//# sourceMappingURL=scrypt-wrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scrypt-wrapper.js","sourceRoot":"","sources":["../../src-ts/password-hashers/scrypt-wrapper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scrypt-wrapper.js","sourceRoot":"","sources":["../../src-ts/password-hashers/scrypt-wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAG3E,MAAM,OAAO,aAAa;IAExB;;;;OAIG;IACI,YAAY,CAAC,QAAgB;QAClC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;QACrE,CAAC;QACD,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;IAED;;;;;;;OAOG;IACI,kBAAkB,CAAC,QAAgB,EAAE,OAAe,EAAE,SAAiB,EAAE,WAAmB;QACjG,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;QACrE,CAAC;QACD,OAAO,gBAAgB,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;IACrE,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,YAAY,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;IACxD,CAAC;CACF"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CASED25519KeyPairResult } from "../index.js";
|
|
2
2
|
export declare class Ed25519Wrapper {
|
|
3
3
|
/**
|
|
4
4
|
* Generates a new Ed25519 key pair
|
|
5
5
|
*/
|
|
6
|
-
getKeyPair():
|
|
6
|
+
getKeyPair(): CASED25519KeyPairResult;
|
|
7
7
|
/**
|
|
8
8
|
* Signs a message with the given Ed25519 private key
|
|
9
9
|
* @param privateKey The private key to sign the message with
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ed25519-wrapper.d.ts","sourceRoot":"","sources":["../../src-ts/signature/ed25519-wrapper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ed25519-wrapper.d.ts","sourceRoot":"","sources":["../../src-ts/signature/ed25519-wrapper.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD,qBAAa,cAAc;IACzB;;OAEG;IACI,UAAU,IAAI,uBAAuB;IAI5C;;;;;OAKG;IACI,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE;IAIrE;;;;;;OAMG;IACI,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO;CAG3F"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.Ed25519Wrapper = void 0;
|
|
4
|
-
const index_1 = require("../../index");
|
|
5
|
-
class Ed25519Wrapper {
|
|
1
|
+
import { generateEd25519Keys, signEd25519, verifyEd25519, } from "../../index.js";
|
|
2
|
+
export class Ed25519Wrapper {
|
|
6
3
|
/**
|
|
7
4
|
* Generates a new Ed25519 key pair
|
|
8
5
|
*/
|
|
9
6
|
getKeyPair() {
|
|
10
|
-
return
|
|
7
|
+
return generateEd25519Keys();
|
|
11
8
|
}
|
|
12
9
|
/**
|
|
13
10
|
* Signs a message with the given Ed25519 private key
|
|
@@ -16,7 +13,7 @@ class Ed25519Wrapper {
|
|
|
16
13
|
* @returns The signature
|
|
17
14
|
*/
|
|
18
15
|
signMessage(privateKey, message) {
|
|
19
|
-
return
|
|
16
|
+
return signEd25519(privateKey, message);
|
|
20
17
|
}
|
|
21
18
|
/**
|
|
22
19
|
* Verifies a signature for a message with the given Ed25519 public key
|
|
@@ -26,8 +23,7 @@ class Ed25519Wrapper {
|
|
|
26
23
|
* @returns True if the signature is valid, false otherwise
|
|
27
24
|
*/
|
|
28
25
|
verifyMessage(publicKey, message, signature) {
|
|
29
|
-
return
|
|
26
|
+
return verifyEd25519(publicKey, message, signature);
|
|
30
27
|
}
|
|
31
28
|
}
|
|
32
|
-
exports.Ed25519Wrapper = Ed25519Wrapper;
|
|
33
29
|
//# sourceMappingURL=ed25519-wrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ed25519-wrapper.js","sourceRoot":"","sources":["../../src-ts/signature/ed25519-wrapper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ed25519-wrapper.js","sourceRoot":"","sources":["../../src-ts/signature/ed25519-wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,aAAa,GACd,MAAM,gBAAgB,CAAC;AAGxB,MAAM,OAAO,cAAc;IACzB;;OAEG;IACI,UAAU;QACf,OAAO,mBAAmB,EAAE,CAAC;IAC/B,CAAC;IAED;;;;;OAKG;IACI,WAAW,CAAC,UAAoB,EAAE,OAAiB;QACxD,OAAO,WAAW,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC1C,CAAC;IAED;;;;;;OAMG;IACI,aAAa,CAAC,SAAmB,EAAE,OAAiB,EAAE,SAAmB;QAC9E,OAAO,aAAa,CAAC,SAAS,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;IACtD,CAAC;CACF"}
|
package/lib/signature/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src-ts/signature/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src-ts/signature/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
package/lib/signature/index.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.Ed25519Wrapper = void 0;
|
|
4
|
-
const ed25519_wrapper_1 = require("./ed25519-wrapper");
|
|
5
|
-
Object.defineProperty(exports, "Ed25519Wrapper", { enumerable: true, get: function () { return ed25519_wrapper_1.Ed25519Wrapper; } });
|
|
1
|
+
import { Ed25519Wrapper } from "./ed25519-wrapper.js";
|
|
2
|
+
export { Ed25519Wrapper };
|
|
6
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src-ts/signature/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src-ts/signature/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.AsconWrapper = void 0;
|
|
4
|
-
const index_1 = require("../../index");
|
|
5
|
-
class AsconWrapper {
|
|
1
|
+
import { ascon128Decrypt, ascon128Encrypt, ascon128KeyGenerate, ascon128NonceGenerate, } from "../../index.js";
|
|
2
|
+
export class AsconWrapper {
|
|
6
3
|
/**
|
|
7
4
|
* Generates an Ascon 128 key
|
|
8
5
|
* @returns Array<number>
|
|
9
6
|
*/
|
|
10
7
|
ascon128Key() {
|
|
11
|
-
return
|
|
8
|
+
return ascon128KeyGenerate();
|
|
12
9
|
}
|
|
13
10
|
/**
|
|
14
11
|
* Generates and Ascon 128 nonce.
|
|
15
12
|
* @returns Array<number>
|
|
16
13
|
*/
|
|
17
14
|
ascon128Nonce() {
|
|
18
|
-
return
|
|
15
|
+
return ascon128NonceGenerate();
|
|
19
16
|
}
|
|
20
17
|
/**
|
|
21
18
|
* Encrypts with Ascon 128 using the key and nonce generated from ascon128Key() and ascon128Nonce() respectively.
|
|
@@ -34,7 +31,7 @@ class AsconWrapper {
|
|
|
34
31
|
if (!plaintext || plaintext.length === 0) {
|
|
35
32
|
throw new Error("Plaintext is required");
|
|
36
33
|
}
|
|
37
|
-
return
|
|
34
|
+
return ascon128Encrypt(key, nonce, plaintext);
|
|
38
35
|
}
|
|
39
36
|
/**
|
|
40
37
|
* Decrypts with Ascon 128 using the key and nonce generated from ascon128Key() and ascon128Nonce() respectively.
|
|
@@ -53,8 +50,7 @@ class AsconWrapper {
|
|
|
53
50
|
if (!ciphertext || ciphertext.length === 0) {
|
|
54
51
|
throw new Error("Ciphertext is required");
|
|
55
52
|
}
|
|
56
|
-
return
|
|
53
|
+
return ascon128Decrypt(key, nonce, ciphertext);
|
|
57
54
|
}
|
|
58
55
|
}
|
|
59
|
-
exports.AsconWrapper = AsconWrapper;
|
|
60
56
|
//# sourceMappingURL=ascon-wrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ascon-wrapper.js","sourceRoot":"","sources":["../../src-ts/sponges/ascon-wrapper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ascon-wrapper.js","sourceRoot":"","sources":["../../src-ts/sponges/ascon-wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AAExB,MAAM,OAAO,YAAY;IACvB;;;OAGG;IACH,WAAW;QACT,OAAO,mBAAmB,EAAE,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACH,aAAa;QACX,OAAO,qBAAqB,EAAE,CAAC;IACjC,CAAC;IAED;;;;;;OAMG;IACH,eAAe,CACb,GAAkB,EAClB,KAAoB,EACpB,SAAwB;QAExB,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;QACrC,CAAC;QACD,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;QACvC,CAAC;QACD,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzC,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;QAC3C,CAAC;QACD,OAAO,eAAe,CAAC,GAAG,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;IAChD,CAAC;IAEA;;;;;;MAME;IACH,eAAe,CACb,GAAkB,EAClB,KAAoB,EACpB,UAAyB;QAEzB,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;QACrC,CAAC;QACD,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;QACvC,CAAC;QACD,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3C,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAC5C,CAAC;QACD,OAAO,eAAe,CAAC,GAAG,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;IACjD,CAAC;CACF"}
|
package/lib/sponges/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src-ts/sponges/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src-ts/sponges/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAC,YAAY,EAAC,CAAA"}
|
package/lib/sponges/index.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.AsconWrapper = void 0;
|
|
4
|
-
const ascon_wrapper_1 = require("./ascon-wrapper");
|
|
5
|
-
Object.defineProperty(exports, "AsconWrapper", { enumerable: true, get: function () { return ascon_wrapper_1.AsconWrapper; } });
|
|
1
|
+
import { AsconWrapper } from "./ascon-wrapper.js";
|
|
2
|
+
export { AsconWrapper };
|
|
6
3
|
//# sourceMappingURL=index.js.map
|
package/lib/sponges/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src-ts/sponges/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src-ts/sponges/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAC,YAAY,EAAC,CAAA"}
|