@lindorm/aes 0.2.0 → 0.3.1

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.
Files changed (159) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/classes/AesKit.d.ts +0 -1
  3. package/dist/classes/AesKit.d.ts.map +1 -1
  4. package/dist/classes/AesKit.js +7 -11
  5. package/dist/classes/AesKit.js.map +1 -1
  6. package/dist/constants/private/format.d.ts +2 -0
  7. package/dist/constants/private/format.d.ts.map +1 -0
  8. package/dist/constants/private/format.js +5 -0
  9. package/dist/constants/private/format.js.map +1 -0
  10. package/dist/constants/version.d.ts +1 -1
  11. package/dist/constants/version.js +1 -1
  12. package/dist/types/aes-data.d.ts +2 -3
  13. package/dist/types/aes-data.d.ts.map +1 -1
  14. package/dist/types/aes-encryption-data.d.ts +2 -3
  15. package/dist/types/aes-encryption-data.d.ts.map +1 -1
  16. package/dist/types/aes-kit.d.ts +0 -2
  17. package/dist/types/aes-kit.d.ts.map +1 -1
  18. package/dist/types/private/aes-string.d.ts +2 -1
  19. package/dist/types/private/aes-string.d.ts.map +1 -1
  20. package/dist/types/private/auth-tag.d.ts +0 -2
  21. package/dist/types/private/auth-tag.d.ts.map +1 -1
  22. package/dist/types/private/content-encryption-key.d.ts +4 -1
  23. package/dist/types/private/content-encryption-key.d.ts.map +1 -1
  24. package/dist/types/private/index.d.ts +1 -0
  25. package/dist/types/private/index.d.ts.map +1 -1
  26. package/dist/types/private/index.js +1 -0
  27. package/dist/types/private/index.js.map +1 -1
  28. package/dist/types/private/key-wrap.d.ts +22 -0
  29. package/dist/types/private/key-wrap.d.ts.map +1 -0
  30. package/dist/types/private/key-wrap.js +3 -0
  31. package/dist/types/private/key-wrap.js.map +1 -0
  32. package/dist/utils/private/aes-cipher.d.ts +4 -4
  33. package/dist/utils/private/aes-cipher.d.ts.map +1 -1
  34. package/dist/utils/private/aes-cipher.js +10 -10
  35. package/dist/utils/private/aes-cipher.js.map +1 -1
  36. package/dist/utils/private/aes-data/auth-tag-hmac.d.ts +2 -3
  37. package/dist/utils/private/aes-data/auth-tag-hmac.d.ts.map +1 -1
  38. package/dist/utils/private/aes-data/auth-tag-hmac.js +8 -8
  39. package/dist/utils/private/aes-data/auth-tag-hmac.js.map +1 -1
  40. package/dist/utils/private/aes-data/auth-tag.d.ts +2 -3
  41. package/dist/utils/private/aes-data/auth-tag.d.ts.map +1 -1
  42. package/dist/utils/private/aes-data/auth-tag.js +7 -7
  43. package/dist/utils/private/aes-data/auth-tag.js.map +1 -1
  44. package/dist/utils/private/aes-data/get-initialisation-vector.d.ts +1 -2
  45. package/dist/utils/private/aes-data/get-initialisation-vector.d.ts.map +1 -1
  46. package/dist/utils/private/aes-data/get-initialisation-vector.js +3 -3
  47. package/dist/utils/private/aes-data/get-initialisation-vector.js.map +1 -1
  48. package/dist/utils/private/aes-data/split-content-encryption-key.d.ts +1 -2
  49. package/dist/utils/private/aes-data/split-content-encryption-key.d.ts.map +1 -1
  50. package/dist/utils/private/aes-data/split-content-encryption-key.js +3 -3
  51. package/dist/utils/private/aes-data/split-content-encryption-key.js.map +1 -1
  52. package/dist/utils/private/aes-data.d.ts +2 -2
  53. package/dist/utils/private/aes-data.d.ts.map +1 -1
  54. package/dist/utils/private/aes-data.js +22 -18
  55. package/dist/utils/private/aes-data.js.map +1 -1
  56. package/dist/utils/private/calculate/calculate-aes-encryption.d.ts +1 -1
  57. package/dist/utils/private/calculate/calculate-aes-encryption.d.ts.map +1 -1
  58. package/dist/utils/private/calculate/calculate-aes-encryption.js +3 -3
  59. package/dist/utils/private/calculate/calculate-aes-encryption.js.map +1 -1
  60. package/dist/utils/private/calculate/calculate-content-encryption-key-size.d.ts +1 -1
  61. package/dist/utils/private/calculate/calculate-content-encryption-key-size.d.ts.map +1 -1
  62. package/dist/utils/private/calculate/calculate-content-encryption-key-size.js +3 -3
  63. package/dist/utils/private/calculate/calculate-content-encryption-key-size.js.map +1 -1
  64. package/dist/utils/private/calculate/calculate-key-wrap-encryption.d.ts +2 -2
  65. package/dist/utils/private/calculate/calculate-key-wrap-encryption.d.ts.map +1 -1
  66. package/dist/utils/private/calculate/calculate-key-wrap-encryption.js +12 -3
  67. package/dist/utils/private/calculate/calculate-key-wrap-encryption.js.map +1 -1
  68. package/dist/utils/private/calculate/calculate-key-wrap-size.d.ts +1 -1
  69. package/dist/utils/private/calculate/calculate-key-wrap-size.d.ts.map +1 -1
  70. package/dist/utils/private/calculate/calculate-key-wrap-size.js +9 -3
  71. package/dist/utils/private/calculate/calculate-key-wrap-size.js.map +1 -1
  72. package/dist/utils/private/calculate/calculate-pbkdf-hash.d.ts +1 -1
  73. package/dist/utils/private/calculate/calculate-pbkdf-hash.d.ts.map +1 -1
  74. package/dist/utils/private/calculate/calculate-pbkdf-hash.js +3 -3
  75. package/dist/utils/private/calculate/calculate-pbkdf-hash.js.map +1 -1
  76. package/dist/utils/private/calculate/calculate-rsa-oaep-hash.d.ts +1 -1
  77. package/dist/utils/private/calculate/calculate-rsa-oaep-hash.d.ts.map +1 -1
  78. package/dist/utils/private/calculate/calculate-rsa-oaep-hash.js +3 -3
  79. package/dist/utils/private/calculate/calculate-rsa-oaep-hash.js.map +1 -1
  80. package/dist/utils/private/decode-aes-string.d.ts +1 -1
  81. package/dist/utils/private/decode-aes-string.d.ts.map +1 -1
  82. package/dist/utils/private/decode-aes-string.js +14 -13
  83. package/dist/utils/private/decode-aes-string.js.map +1 -1
  84. package/dist/utils/private/diffie-hellman/diffie-hellman-key-wrap.d.ts +2 -2
  85. package/dist/utils/private/diffie-hellman/diffie-hellman-key-wrap.d.ts.map +1 -1
  86. package/dist/utils/private/diffie-hellman/diffie-hellman-key-wrap.js +19 -16
  87. package/dist/utils/private/diffie-hellman/diffie-hellman-key-wrap.js.map +1 -1
  88. package/dist/utils/private/diffie-hellman/diffie-hellman.d.ts +2 -2
  89. package/dist/utils/private/diffie-hellman/diffie-hellman.d.ts.map +1 -1
  90. package/dist/utils/private/diffie-hellman/diffie-hellman.js +11 -11
  91. package/dist/utils/private/diffie-hellman/diffie-hellman.js.map +1 -1
  92. package/dist/utils/private/diffie-hellman/shared-secret.d.ts +2 -3
  93. package/dist/utils/private/diffie-hellman/shared-secret.d.ts.map +1 -1
  94. package/dist/utils/private/diffie-hellman/shared-secret.js +7 -7
  95. package/dist/utils/private/diffie-hellman/shared-secret.js.map +1 -1
  96. package/dist/utils/private/encode-aes-string.d.ts +1 -1
  97. package/dist/utils/private/encode-aes-string.d.ts.map +1 -1
  98. package/dist/utils/private/encode-aes-string.js +13 -11
  99. package/dist/utils/private/encode-aes-string.js.map +1 -1
  100. package/dist/utils/private/get-key/get-decryption-key.d.ts +1 -1
  101. package/dist/utils/private/get-key/get-decryption-key.d.ts.map +1 -1
  102. package/dist/utils/private/get-key/get-decryption-key.js +7 -7
  103. package/dist/utils/private/get-key/get-decryption-key.js.map +1 -1
  104. package/dist/utils/private/get-key/get-encryption-key.d.ts +1 -1
  105. package/dist/utils/private/get-key/get-encryption-key.d.ts.map +1 -1
  106. package/dist/utils/private/get-key/get-encryption-key.js +7 -7
  107. package/dist/utils/private/get-key/get-encryption-key.js.map +1 -1
  108. package/dist/utils/private/key-derivation/hkdf.d.ts +1 -2
  109. package/dist/utils/private/key-derivation/hkdf.d.ts.map +1 -1
  110. package/dist/utils/private/key-derivation/hkdf.js +3 -3
  111. package/dist/utils/private/key-derivation/hkdf.js.map +1 -1
  112. package/dist/utils/private/key-derivation/pbkdf.d.ts +1 -2
  113. package/dist/utils/private/key-derivation/pbkdf.d.ts.map +1 -1
  114. package/dist/utils/private/key-derivation/pbkdf.js +3 -3
  115. package/dist/utils/private/key-derivation/pbkdf.js.map +1 -1
  116. package/dist/utils/private/key-types/get-ec-keys.d.ts +2 -2
  117. package/dist/utils/private/key-types/get-ec-keys.d.ts.map +1 -1
  118. package/dist/utils/private/key-types/get-ec-keys.js +15 -9
  119. package/dist/utils/private/key-types/get-ec-keys.js.map +1 -1
  120. package/dist/utils/private/key-types/get-oct-keys.d.ts +2 -2
  121. package/dist/utils/private/key-types/get-oct-keys.d.ts.map +1 -1
  122. package/dist/utils/private/key-types/get-oct-keys.js +18 -12
  123. package/dist/utils/private/key-types/get-oct-keys.js.map +1 -1
  124. package/dist/utils/private/key-types/get-okp-keys.d.ts +2 -2
  125. package/dist/utils/private/key-types/get-okp-keys.d.ts.map +1 -1
  126. package/dist/utils/private/key-types/get-okp-keys.js +22 -7
  127. package/dist/utils/private/key-types/get-okp-keys.js.map +1 -1
  128. package/dist/utils/private/key-types/get-rsa-keys.d.ts +2 -2
  129. package/dist/utils/private/key-types/get-rsa-keys.d.ts.map +1 -1
  130. package/dist/utils/private/key-types/get-rsa-keys.js +8 -8
  131. package/dist/utils/private/key-types/get-rsa-keys.js.map +1 -1
  132. package/dist/utils/private/key-wrap/ecb-key-wrap.d.ts +4 -0
  133. package/dist/utils/private/key-wrap/ecb-key-wrap.d.ts.map +1 -0
  134. package/dist/utils/private/key-wrap/ecb-key-wrap.js +66 -0
  135. package/dist/utils/private/key-wrap/ecb-key-wrap.js.map +1 -0
  136. package/dist/utils/private/key-wrap/gcm-key-wrap.d.ts +4 -0
  137. package/dist/utils/private/key-wrap/gcm-key-wrap.d.ts.map +1 -0
  138. package/dist/utils/private/key-wrap/gcm-key-wrap.js +36 -0
  139. package/dist/utils/private/key-wrap/gcm-key-wrap.js.map +1 -0
  140. package/dist/utils/private/key-wrap/key-wrap.d.ts +3 -15
  141. package/dist/utils/private/key-wrap/key-wrap.d.ts.map +1 -1
  142. package/dist/utils/private/key-wrap/key-wrap.js +42 -59
  143. package/dist/utils/private/key-wrap/key-wrap.js.map +1 -1
  144. package/dist/utils/private/oct/get-oct-dir-keys.d.ts +2 -2
  145. package/dist/utils/private/oct/get-oct-dir-keys.d.ts.map +1 -1
  146. package/dist/utils/private/oct/get-oct-dir-keys.js +7 -7
  147. package/dist/utils/private/oct/get-oct-dir-keys.js.map +1 -1
  148. package/dist/utils/private/oct/get-oct-key-key-wrap.d.ts +4 -0
  149. package/dist/utils/private/oct/get-oct-key-key-wrap.d.ts.map +1 -0
  150. package/dist/utils/private/oct/{get-oct-key-wrap-keys.js → get-oct-key-key-wrap.js} +18 -15
  151. package/dist/utils/private/oct/get-oct-key-key-wrap.js.map +1 -0
  152. package/dist/utils/private/oct/get-oct-pbkdf-key-wrap-keys.d.ts +2 -2
  153. package/dist/utils/private/oct/get-oct-pbkdf-key-wrap-keys.d.ts.map +1 -1
  154. package/dist/utils/private/oct/get-oct-pbkdf-key-wrap-keys.js +16 -17
  155. package/dist/utils/private/oct/get-oct-pbkdf-key-wrap-keys.js.map +1 -1
  156. package/package.json +6 -6
  157. package/dist/utils/private/oct/get-oct-key-wrap-keys.d.ts +0 -4
  158. package/dist/utils/private/oct/get-oct-key-wrap-keys.d.ts.map +0 -1
  159. package/dist/utils/private/oct/get-oct-key-wrap-keys.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,16 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.3.1](https://github.com/lindorm-io/monorepo/compare/@lindorm/aes@0.3.0...@lindorm/aes@0.3.1) (2024-09-20)
7
+
8
+ **Note:** Version bump only for package @lindorm/aes
9
+
10
+ # [0.3.0](https://github.com/lindorm-io/monorepo/compare/@lindorm/aes@0.2.0...@lindorm/aes@0.3.0) (2024-05-20)
11
+
12
+ ### Features
13
+
14
+ - add gcm keywrap ([8eefa5d](https://github.com/lindorm-io/monorepo/commit/8eefa5dd2914faba842c0a050a9317d2b6f5b197))
15
+
6
16
  # [0.2.0](https://github.com/lindorm-io/monorepo/compare/@lindorm/aes@0.1.3...@lindorm/aes@0.2.0) (2024-05-19)
7
17
 
8
18
  ### Bug Fixes
@@ -1,7 +1,6 @@
1
1
  import { AesEncryptionData, AesKitOptions, DecryptAesDataOptions } from "../types";
2
2
  export declare class AesKit {
3
3
  private readonly encryption;
4
- private readonly format;
5
4
  private readonly kryptos;
6
5
  constructor(options: AesKitOptions);
7
6
  encrypt(data: string, mode?: "cipher"): string;
@@ -1 +1 @@
1
- {"version":3,"file":"AesKit.d.ts","sourceRoot":"","sources":["../../src/classes/AesKit.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AASnF,qBAAa,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAoB;IAC/C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAW;gBAEhB,OAAO,EAAE,aAAa;IAMlC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM;IAC9C,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,iBAAiB;IA2BxD,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAC7B,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,qBAAqB,EAAE,SAAS,CAAC,GAAG,MAAM;IAmB7D,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO;IAQ7C,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;CAOlD"}
1
+ {"version":3,"file":"AesKit.d.ts","sourceRoot":"","sources":["../../src/classes/AesKit.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AASnF,qBAAa,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAoB;IAC/C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAW;gBAEhB,OAAO,EAAE,aAAa;IAKlC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM;IAC9C,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,iBAAiB;IAyBxD,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAC7B,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,qBAAqB,EAAE,SAAS,CAAC,GAAG,MAAM;IAmB7D,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO;IAQ7C,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;CAOlD"}
@@ -7,27 +7,23 @@ const aes_cipher_1 = require("../utils/private/aes-cipher");
7
7
  const aes_data_1 = require("../utils/private/aes-data");
8
8
  class AesKit {
9
9
  encryption;
10
- format;
11
10
  kryptos;
12
11
  constructor(options) {
13
- this.encryption = options.encryption || "A256GCM";
14
- this.format = options.format || "base64url";
15
12
  this.kryptos = options.kryptos;
13
+ this.encryption = options.encryption ?? options.kryptos.encryption ?? "A256GCM";
16
14
  }
17
15
  encrypt(data, mode = "cipher") {
18
16
  switch (mode) {
19
17
  case "cipher":
20
- return (0, aes_cipher_1._encryptAesCipher)({
18
+ return (0, aes_cipher_1.encryptAesCipher)({
21
19
  data: data,
22
20
  encryption: this.encryption,
23
- format: this.format,
24
21
  kryptos: this.kryptos,
25
22
  });
26
23
  case "object":
27
- return (0, aes_data_1._encryptAesData)({
24
+ return (0, aes_data_1.encryptAesData)({
28
25
  data: data,
29
26
  encryption: this.encryption,
30
- format: this.format,
31
27
  kryptos: this.kryptos,
32
28
  });
33
29
  default:
@@ -36,13 +32,13 @@ class AesKit {
36
32
  }
37
33
  decrypt(data) {
38
34
  if ((0, is_1.isString)(data)) {
39
- return (0, aes_cipher_1._decryptAesCipher)({
35
+ return (0, aes_cipher_1.decryptAesCipher)({
40
36
  cipher: data,
41
37
  kryptos: this.kryptos,
42
38
  });
43
39
  }
44
40
  if ((0, is_1.isObject)(data)) {
45
- return (0, aes_data_1._decryptAesData)({
41
+ return (0, aes_data_1.decryptAesData)({
46
42
  ...data,
47
43
  kryptos: this.kryptos,
48
44
  });
@@ -50,14 +46,14 @@ class AesKit {
50
46
  throw new errors_1.AesError("Invalid decryption type");
51
47
  }
52
48
  verify(data, cipher) {
53
- return (0, aes_cipher_1._verifyAesCipher)({
49
+ return (0, aes_cipher_1.verifyAesCipher)({
54
50
  cipher,
55
51
  data,
56
52
  kryptos: this.kryptos,
57
53
  });
58
54
  }
59
55
  assert(data, cipher) {
60
- return (0, aes_cipher_1._assertAesCipher)({
56
+ return (0, aes_cipher_1.assertAesCipher)({
61
57
  cipher,
62
58
  data,
63
59
  kryptos: this.kryptos,
@@ -1 +1 @@
1
- {"version":3,"file":"AesKit.js","sourceRoot":"","sources":["../../src/classes/AesKit.ts"],"names":[],"mappings":";;;AAAA,oCAAiD;AAGjD,sCAAqC;AAErC,4DAKqC;AACrC,wDAA6E;AAE7E,MAAa,MAAM;IACA,UAAU,CAAoB;IAC9B,MAAM,CAAe;IACrB,OAAO,CAAW;IAEnC,YAAmB,OAAsB;QACvC,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,SAAS,CAAC;QAClD,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,WAAW,CAAC;QAC5C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IACjC,CAAC;IAIM,OAAO,CACZ,IAAY,EACZ,OAA4B,QAAQ;QAEpC,QAAQ,IAAI,EAAE,CAAC;YACb,KAAK,QAAQ;gBACX,OAAO,IAAA,8BAAiB,EAAC;oBACvB,IAAI,EAAE,IAAI;oBACV,UAAU,EAAE,IAAI,CAAC,UAAU;oBAC3B,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,OAAO,EAAE,IAAI,CAAC,OAAO;iBACtB,CAAC,CAAC;YAEL,KAAK,QAAQ;gBACX,OAAO,IAAA,0BAAe,EAAC;oBACrB,IAAI,EAAE,IAA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AEM,MAAM,CAAC,IAAY,EAAE,MAAc;QACxC,OAAO,IAAA,4BAAe,EAAC;YACrB,MAAM;YACN,IAAI;YACJ,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAC,CAAC;IACL,CAAC;CACF;AAtED,wBAsEC"}
@@ -0,0 +1,2 @@
1
+ export declare const B64U: "base64url";
2
+ //# sourceMappingURL=format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../src/constants/private/format.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,aAAuB,CAAC"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.B64U = void 0;
4
+ exports.B64U = "base64url";
5
+ //# sourceMappingURL=format.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.js","sourceRoot":"","sources":["../../../src/constants/private/format.ts"],"names":[],"mappings":";;;AAAa,QAAA,IAAI,GAAG,WAAoB,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const LATEST_AES_VERSION = 7;
1
+ export declare const LATEST_AES_VERSION = 8;
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LATEST_AES_VERSION = void 0;
4
- exports.LATEST_AES_VERSION = 7;
4
+ exports.LATEST_AES_VERSION = 8;
5
5
  //# sourceMappingURL=version.js.map
@@ -1,11 +1,8 @@
1
- /// <reference types="node" />
2
1
  import { IKryptos, KryptosEncryption } from "@lindorm/kryptos";
3
- import { BufferFormat } from "@lindorm/types";
4
2
  import { PublicEncryptionJwk } from "./types";
5
3
  export type EncryptAesDataOptions = {
6
4
  data: Buffer | string;
7
5
  encryption?: KryptosEncryption;
8
- format?: BufferFormat;
9
6
  kryptos: IKryptos;
10
7
  };
11
8
  export type DecryptAesDataOptions = {
@@ -17,7 +14,9 @@ export type DecryptAesDataOptions = {
17
14
  kryptos: IKryptos;
18
15
  pbkdfIterations?: number;
19
16
  pbkdfSalt?: Buffer;
17
+ publicEncryptionIv?: Buffer;
20
18
  publicEncryptionJwk?: PublicEncryptionJwk;
21
19
  publicEncryptionKey?: Buffer;
20
+ publicEncryptionTag?: Buffer;
22
21
  };
23
22
  //# sourceMappingURL=aes-data.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"aes-data.d.ts","sourceRoot":"","sources":["../../src/types/aes-data.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,OAAO,EAAE,QAAQ,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,iBAAiB,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,OAAO,EAAE,QAAQ,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC"}
1
+ {"version":3,"file":"aes-data.d.ts","sourceRoot":"","sources":["../../src/types/aes-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,OAAO,EAAE,QAAQ,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,iBAAiB,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,OAAO,EAAE,QAAQ,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC"}
@@ -1,20 +1,19 @@
1
- /// <reference types="node" />
2
1
  import { KryptosAlgorithm, KryptosEncryption } from "@lindorm/kryptos";
3
- import { BufferFormat } from "@lindorm/types";
4
2
  import { PublicEncryptionJwk } from "./types";
5
3
  export type AesEncryptionData = {
6
4
  algorithm: KryptosAlgorithm;
7
5
  authTag: Buffer;
8
6
  content: Buffer;
9
7
  encryption: KryptosEncryption;
10
- format: BufferFormat;
11
8
  hkdfSalt: Buffer | undefined;
12
9
  initialisationVector: Buffer;
13
10
  keyId: Buffer;
14
11
  pbkdfIterations: number | undefined;
15
12
  pbkdfSalt: Buffer | undefined;
13
+ publicEncryptionIv: Buffer | undefined;
16
14
  publicEncryptionJwk: PublicEncryptionJwk | undefined;
17
15
  publicEncryptionKey: Buffer | undefined;
16
+ publicEncryptionTag: Buffer | undefined;
18
17
  version: number;
19
18
  };
20
19
  //# sourceMappingURL=aes-encryption-data.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"aes-encryption-data.d.ts","sourceRoot":"","sources":["../../src/types/aes-encryption-data.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,EAAE,gBAAgB,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,iBAAiB,CAAC;IAC9B,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,mBAAmB,EAAE,mBAAmB,GAAG,SAAS,CAAC;IACrD,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC"}
1
+ {"version":3,"file":"aes-encryption-data.d.ts","sourceRoot":"","sources":["../../src/types/aes-encryption-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,EAAE,gBAAgB,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,iBAAiB,CAAC;IAC9B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,mBAAmB,EAAE,mBAAmB,GAAG,SAAS,CAAC;IACrD,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC"}
@@ -1,8 +1,6 @@
1
1
  import { IKryptos, KryptosEncryption } from "@lindorm/kryptos";
2
- import { BufferFormat } from "@lindorm/types";
3
2
  export type AesKitOptions = {
4
3
  encryption?: KryptosEncryption;
5
- format?: BufferFormat;
6
4
  kryptos: IKryptos;
7
5
  };
8
6
  //# sourceMappingURL=aes-kit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"aes-kit.d.ts","sourceRoot":"","sources":["../../src/types/aes-kit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,MAAM,aAAa,GAAG;IAC1B,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,OAAO,EAAE,QAAQ,CAAC;CACnB,CAAC"}
1
+ {"version":3,"file":"aes-kit.d.ts","sourceRoot":"","sources":["../../src/types/aes-kit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE/D,MAAM,MAAM,aAAa,GAAG;IAC1B,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,OAAO,EAAE,QAAQ,CAAC;CACnB,CAAC"}
@@ -1,7 +1,6 @@
1
1
  import { KryptosAlgorithm, KryptosCurve, KryptosType } from "@lindorm/kryptos";
2
2
  export type AesStringValues = {
3
3
  v: string;
4
- f: string;
5
4
  alg: KryptosAlgorithm;
6
5
  crv: KryptosCurve | undefined;
7
6
  hks: string | undefined;
@@ -10,7 +9,9 @@ export type AesStringValues = {
10
9
  kty: KryptosType | undefined;
11
10
  p2c: string | undefined;
12
11
  p2s: string | undefined;
12
+ pei: string | undefined;
13
13
  pek: string | undefined;
14
+ pet: string | undefined;
14
15
  tag: string;
15
16
  x: string | undefined;
16
17
  y: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"aes-string.d.ts","sourceRoot":"","sources":["../../../src/types/private/aes-string.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/E,MAAM,MAAM,eAAe,GAAG;IAC5B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,GAAG,EAAE,gBAAgB,CAAC;IACtB,GAAG,EAAE,YAAY,GAAG,SAAS,CAAC;IAC9B,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,WAAW,GAAG,SAAS,CAAC;IAC7B,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvB,CAAC"}
1
+ {"version":3,"file":"aes-string.d.ts","sourceRoot":"","sources":["../../../src/types/private/aes-string.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/E,MAAM,MAAM,eAAe,GAAG;IAC5B,CAAC,EAAE,MAAM,CAAC;IACV,GAAG,EAAE,gBAAgB,CAAC;IACtB,GAAG,EAAE,YAAY,GAAG,SAAS,CAAC;IAC9B,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,WAAW,GAAG,SAAS,CAAC;IAC7B,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvB,CAAC"}
@@ -1,5 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  import { KryptosEncryption } from "@lindorm/kryptos";
4
2
  import { Cipher, CipherGCM, Decipher, DecipherGCM } from "crypto";
5
3
  export type GetAuthTagOptions = {
@@ -1 +1 @@
1
- {"version":3,"file":"auth-tag.d.ts","sourceRoot":"","sources":["../../../src/types/private/auth-tag.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAElE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,iBAAiB,CAAC;IAC9B,oBAAoB,EAAE,MAAM,CAAC;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AM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,iBAAiB,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,oBAAoB,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC"}
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { IKryptos, KryptosEncryption } from "@lindorm/kryptos";
3
2
  import { PublicEncryptionJwk } from "../types";
4
3
  export type CreateCekOptions = {
@@ -10,8 +9,10 @@ export type CreateCekResult = {
10
9
  hkdfSalt?: Buffer;
11
10
  pbkdfIterations?: number;
12
11
  pbkdfSalt?: Buffer;
12
+ publicEncryptionIv?: Buffer;
13
13
  publicEncryptionJwk?: PublicEncryptionJwk;
14
14
  publicEncryptionKey?: Buffer;
15
+ publicEncryptionTag?: Buffer;
15
16
  };
16
17
  export type DecryptCekOptions = {
17
18
  encryption: KryptosEncryption;
@@ -19,8 +20,10 @@ export type DecryptCekOptions = {
19
20
  kryptos: IKryptos;
20
21
  pbkdfIterations?: number;
21
22
  pbkdfSalt?: Buffer;
23
+ publicEncryptionIv?: Buffer;
22
24
  publicEncryptionJwk?: PublicEncryptionJwk;
23
25
  publicEncryptionKey?: Buffer;
26
+ publicEncryptionTag?: Buffer;
24
27
  };
25
28
  export type DecryptCekResult = {
26
29
  contentEncryptionKey: Buffer;
@@ -1 +1 @@
1
- {"version":3,"file":"content-encryption-key.d.ts","sourceRoot":"","sources":["../../../src/types/private/content-encryption-key.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,EAAE,iBAAiB,CAAC;IAC9B,OAAO,EA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EAAE,mBAAmB,CAAC;IAC1C,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,EAAE,iBAAiB,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,QAAQ,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,oBAAoB,EAAE,MAAM,CAAC;CAC9B,CAAC"}
@@ -2,4 +2,5 @@ export * from "./aes-key-derivation";
2
2
  export * from "./aes-string";
3
3
  export * from "./auth-tag";
4
4
  export * from "./content-encryption-key";
5
+ export * from "./key-wrap";
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/private/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/private/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,0BAA0B,CAAC;AACzC,cAAc,YAAY,CAAC"}
@@ -18,4 +18,5 @@ __exportStar(require("./aes-key-derivation"), exports);
18
18
  __exportStar(require("./aes-string"), exports);
19
19
  __exportStar(require("./auth-tag"), exports);
20
20
  __exportStar(require("./content-encryption-key"), exports);
21
+ __exportStar(require("./key-wrap"), exports);
21
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/private/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,+CAA6B;AAC7B,6CAA2B;AAC3B,2DAAyC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/private/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,+CAA6B;AAC7B,6CAA2B;AAC3B,2DAAyC;AACzC,6CAA2B"}
@@ -0,0 +1,22 @@
1
+ import { IKryptos } from "@lindorm/kryptos";
2
+ export type KeyWrapOptions = {
3
+ contentEncryptionKey: Buffer;
4
+ keyEncryptionKey: Buffer;
5
+ kryptos: IKryptos;
6
+ };
7
+ export type KeyWrapResult = {
8
+ publicEncryptionIv?: Buffer;
9
+ publicEncryptionKey: Buffer;
10
+ publicEncryptionTag?: Buffer;
11
+ };
12
+ export type KeyUnwrapOptions = {
13
+ keyEncryptionKey: Buffer;
14
+ kryptos: IKryptos;
15
+ publicEncryptionIv?: Buffer;
16
+ publicEncryptionKey: Buffer;
17
+ publicEncryptionTag?: Buffer;
18
+ };
19
+ export type KeyUnwrapResult = {
20
+ contentEncryptionKey: Buffer;
21
+ };
22
+ //# sourceMappingURL=key-wrap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"key-wrap.d.ts","sourceRoot":"","sources":["../../../src/types/private/key-wrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,MAAM,MAAM,cAAc,GAAG;IAC3B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,QAAQ,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,QAAQ,CAAC;IAClB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,oBAAoB,EAAE,MAAM,CAAC;CAC9B,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=key-wrap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"key-wrap.js","sourceRoot":"","sources":["../../../src/types/private/key-wrap.ts"],"names":[],"mappings":""}
@@ -1,6 +1,6 @@
1
1
  import { DecryptAesCipherOptions, EncryptAesCipherOptions, VerifyAesCipherOptions } from "../../types";
2
- export declare const _encryptAesCipher: (options: EncryptAesCipherOptions) => string;
3
- export declare const _decryptAesCipher: ({ cipher, kryptos }: DecryptAesCipherOptions) => string;
4
- export declare const _verifyAesCipher: ({ cipher, data, kryptos }: VerifyAesCipherOptions) => boolean;
5
- export declare const _assertAesCipher: ({ cipher, data, kryptos }: VerifyAesCipherOptions) => void;
2
+ export declare const encryptAesCipher: (options: EncryptAesCipherOptions) => string;
3
+ export declare const decryptAesCipher: ({ cipher, kryptos }: DecryptAesCipherOptions) => string;
4
+ export declare const verifyAesCipher: ({ cipher, data, kryptos, }: VerifyAesCipherOptions) => boolean;
5
+ export declare const assertAesCipher: ({ cipher, data, kryptos, }: VerifyAesCipherOptions) => void;
6
6
  //# sourceMappingURL=aes-cipher.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"aes-cipher.d.ts","sourceRoot":"","sources":["../../../src/utils/private/aes-cipher.ts"],"names":[],"mappings":"AACA,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACvB,MAAM,aAAa,CAAC;AAKrB,eAAO,MAAM,iBAAiB,YAAa,uBAAuB,KAAG,MACzB,CAAC;AAE7C,eAAO,MAAM,iBAAiB,wBAAyB,uBAAuB,KAAG,MACtB,CAAC;AAE5D,eAAO,MAAM,gBAAgB,8BAA+B,sBAAsB,KAAG,OACpC,CAAC;AAElD,eAAO,MAAM,gBAAgB,8BAA+B,sBAAsB,KAAG,IAGpF,CAAC"}
1
+ {"version":3,"file":"aes-cipher.d.ts","sourceRoot":"","sources":["../../../src/utils/private/aes-cipher.ts"],"names":[],"mappings":"AACA,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACvB,MAAM,aAAa,CAAC;AAKrB,eAAO,MAAM,gBAAgB,YAAa,uBAAuB,KAAG,MAC1B,CAAC;AAE3C,eAAO,MAAM,gBAAgB,wBAAyB,uBAAuB,KAAG,MACvB,CAAC;AAE1D,eAAO,MAAM,eAAe,+BAIzB,sBAAsB,KAAG,OAAyD,CAAC;AAEtF,eAAO,MAAM,eAAe,+BAIzB,sBAAsB,KAAG,IAG3B,CAAC"}
@@ -1,20 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports._assertAesCipher = exports._verifyAesCipher = exports._decryptAesCipher = exports._encryptAesCipher = void 0;
3
+ exports.assertAesCipher = exports.verifyAesCipher = exports.decryptAesCipher = exports.encryptAesCipher = void 0;
4
4
  const errors_1 = require("../../errors");
5
5
  const aes_data_1 = require("./aes-data");
6
6
  const decode_aes_string_1 = require("./decode-aes-string");
7
7
  const encode_aes_string_1 = require("./encode-aes-string");
8
- const _encryptAesCipher = (options) => (0, encode_aes_string_1._encodeAesString)((0, aes_data_1._encryptAesData)(options));
9
- exports._encryptAesCipher = _encryptAesCipher;
10
- const _decryptAesCipher = ({ cipher, kryptos }) => (0, aes_data_1._decryptAesData)({ ...(0, decode_aes_string_1._decodeAesString)(cipher), kryptos });
11
- exports._decryptAesCipher = _decryptAesCipher;
12
- const _verifyAesCipher = ({ cipher, data, kryptos }) => (0, exports._decryptAesCipher)({ cipher, kryptos }) === data;
13
- exports._verifyAesCipher = _verifyAesCipher;
14
- const _assertAesCipher = ({ cipher, data, kryptos }) => {
15
- if ((0, exports._verifyAesCipher)({ cipher, data, kryptos }))
8
+ const encryptAesCipher = (options) => (0, encode_aes_string_1.encodeAesString)((0, aes_data_1.encryptAesData)(options));
9
+ exports.encryptAesCipher = encryptAesCipher;
10
+ const decryptAesCipher = ({ cipher, kryptos }) => (0, aes_data_1.decryptAesData)({ ...(0, decode_aes_string_1.decodeAesString)(cipher), kryptos });
11
+ exports.decryptAesCipher = decryptAesCipher;
12
+ const verifyAesCipher = ({ cipher, data, kryptos, }) => (0, exports.decryptAesCipher)({ cipher, kryptos }) === data;
13
+ exports.verifyAesCipher = verifyAesCipher;
14
+ const assertAesCipher = ({ cipher, data, kryptos, }) => {
15
+ if ((0, exports.verifyAesCipher)({ cipher, data, kryptos }))
16
16
  return;
17
17
  throw new errors_1.AesError("Invalid AES cipher");
18
18
  };
19
- exports._assertAesCipher = _assertAesCipher;
19
+ exports.assertAesCipher = assertAesCipher;
20
20
  //# sourceMappingURL=aes-cipher.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"aes-cipher.js","sourceRoot":"","sources":["../../../src/utils/private/aes-cipher.ts"],"names":[],"mappings":";;;AAAA,yCAAwC;AAMxC,yCAA8D;AAC9D,2DAAuD;AACvD,2DAAuD;AAEhD,MAAM,iBAAiB,GAAG,CAAC,OAAgC,EAAU,EAAE,CAC5E,IAAA,oCAAgB,EAAC,IAAA,0BAAe,EAAC,OAAO,CAAC,CAAC,CAAC;AADhC,QAAA,iBAAiB,qBACe;AAEtC,MAAM,iBAAiB,GAAG,CAAC,EAAE,MAAM,EAAE,OAAO,EAA2B,EAAU,EAAE,CACxF,IAAA,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,OAAO,EAAE,CAAC,KAAK,IAAI,CAAC;AAJzE,QAAA,eAAe,mBAI0D;AAE/E,MAAM,eAAe,GAAG,CAAC,EAC9B,MAAM,EACN,IAAI,EACJ,OAAO,GACgB,EAAQ,EAAE;IACjC,IAAI,IAAA,uBAAe,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QAAE,OAAO;IACvD,MAAM,IAAI,iBAAQ,CAAC,oBAAoB,CAAC,CAAC;AAC3C,CAAC,CAAC;AAPW,QAAA,eAAe,mBAO1B"}
@@ -1,5 +1,4 @@
1
- /// <reference types="node" />
2
1
  import { CreateHmacAuthTag, VerifyHmacAuthTag } from "../../../types/private/auth-tag";
3
- export declare const _createHmacAuthTag: ({ content, hashKey, initialisationVector, encryption, }: CreateHmacAuthTag) => Buffer;
4
- export declare const _assertHmacAuthTag: ({ authTag, content, encryption, hashKey, initialisationVector, }: VerifyHmacAuthTag) => void;
2
+ export declare const createHmacAuthTag: ({ content, hashKey, initialisationVector, encryption, }: CreateHmacAuthTag) => Buffer;
3
+ export declare const assertHmacAuthTag: ({ authTag, content, encryption, hashKey, initialisationVector, }: VerifyHmacAuthTag) => void;
5
4
  //# sourceMappingURL=auth-tag-hmac.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth-tag-hmac.d.ts","sourceRoot":"","sources":["../../../../src/utils/private/aes-data/auth-tag-hmac.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAkBvF,eAAO,MAAM,kBAAkB,4DAK5B,iBAAiB,KAAG,MAOtB,CAAC;AAEF,eAAO,MAAM,kBAAkB,qEAM5B,iBAAiB,KAAG,IAWtB,CAAC"}
1
+ {"version":3,"file":"auth-tag-hmac.d.ts","sourceRoot":"","sources":["../../../../src/utils/private/aes-data/auth-tag-hmac.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAkBvF,eAAO,MAAM,iBAAiB,4DAK3B,iBAAiB,KAAG,MAOtB,CAAC;AAEF,eAAO,MAAM,iBAAiB,qEAM3B,iBAAiB,KAAG,IAWtB,CAAC"}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports._assertHmacAuthTag = exports._createHmacAuthTag = void 0;
3
+ exports.assertHmacAuthTag = exports.createHmacAuthTag = void 0;
4
4
  const crypto_1 = require("crypto");
5
5
  const errors_1 = require("../../../errors");
6
- const _shaHash = (encryption) => {
6
+ const shaHash = (encryption) => {
7
7
  switch (encryption) {
8
8
  case "A128CBC-HS256":
9
9
  return "SHA256";
@@ -15,15 +15,15 @@ const _shaHash = (encryption) => {
15
15
  throw new errors_1.AesError("Unexpected algorithm");
16
16
  }
17
17
  };
18
- const _createHmacAuthTag = ({ content, hashKey, initialisationVector, encryption, }) => {
19
- const hmac = (0, crypto_1.createHmac)(_shaHash(encryption), hashKey);
18
+ const createHmacAuthTag = ({ content, hashKey, initialisationVector, encryption, }) => {
19
+ const hmac = (0, crypto_1.createHmac)(shaHash(encryption), hashKey);
20
20
  hmac.update(initialisationVector);
21
21
  hmac.update(content);
22
22
  return hmac.digest();
23
23
  };
24
- exports._createHmacAuthTag = _createHmacAuthTag;
25
- const _assertHmacAuthTag = ({ authTag, content, encryption, hashKey, initialisationVector, }) => {
26
- const generated = (0, exports._createHmacAuthTag)({
24
+ exports.createHmacAuthTag = createHmacAuthTag;
25
+ const assertHmacAuthTag = ({ authTag, content, encryption, hashKey, initialisationVector, }) => {
26
+ const generated = (0, exports.createHmacAuthTag)({
27
27
  content,
28
28
  encryption,
29
29
  hashKey,
@@ -33,5 +33,5 @@ const _assertHmacAuthTag = ({ authTag, content, encryption, hashKey, initialisat
33
33
  return;
34
34
  throw new errors_1.AesError("Auth tag verification failed");
35
35
  };
36
- exports._assertHmacAuthTag = _assertHmacAuthTag;
36
+ exports.assertHmacAuthTag = assertHmacAuthTag;
37
37
  //# sourceMappingURL=auth-tag-hmac.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth-tag-hmac.js","sourceRoot":"","sources":["../../../../src/utils/private/aes-data/auth-tag-hmac.ts"],"names":[],"mappings":";;;AAEA,mCAAoC;AACpC,4CAA2C;AAG3C,MAAM,QAAQ,GAAG,CAAC,UAA6B,EAAgB,EAAE;IAC/D,QAAQ,UAAU,EAAE,CAAC;QACnB,KAAK,eAAe;YAClB,OAAO,QAAQ,CAAC;QAElB,KAAK,eAAe;YAClB,OAAO,QAAQ,CAAC;QAElB,KAAK,eAAe;YAClB,OAAO,QAAQ,CAAC;QAElB;YACE,MAAM,IAAI,iBAAQ,CAAC,sBAAsB,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC,CAAC;AAEK,MAAM,kBAAkB,GAAG,CAAC,EACjC,OAAO,EACP,OAAO,EACP,oBAAoB,EACpB,UAAU,GACQ,EAAU,EAAE;IAC9B,MAAM,IAAI,GAAG,IAAA,mBAAU,EAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,CAAC;IAEvD,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;IAClC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAErB,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;AACvB,CAAC,CAAC;AAZW,QAAA,kBAAkB,sBAY7B;AAEK,MAAM,kBAAkB,GAAG,CAAC,EACjC,OAAO,EACP,OAAO,EACP,UAAU,EACV,OAAO,EACP,oBAAoB,GACF,EAAQ,EAAE;IAC5B,MAAM,SAAS,GAAG,IAAA,0BAAkB,EAAC;QACnC,OAAO;QACP,UAAU;QACV,OAAO;QACP,oBAAoB;KACrB,CAAC,CAAC;IAEH,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO;IAErD,MAAM,IAAI,iBAAQ,CAAC,8BAA8B,CAA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CAAC,CAAC;AAjBW,QAAA,iBAAiB,qBAiB5B"}
@@ -1,5 +1,4 @@
1
- /// <reference types="node" />
2
1
  import { GetAuthTagOptions, SetAuthTagOptions } from "../../../types/private";
3
- export declare const _createAuthTag: ({ encryption, cipher, content, hashKey, initialisationVector, }: GetAuthTagOptions) => Buffer;
4
- export declare const _assertAuthTag: ({ authTag, content, hashKey, decipher, encryption, initialisationVector, }: SetAuthTagOptions) => void;
2
+ export declare const createAuthTag: ({ encryption, cipher, content, hashKey, initialisationVector, }: GetAuthTagOptions) => Buffer;
3
+ export declare const assertAuthTag: ({ authTag, content, hashKey, decipher, encryption, initialisationVector, }: SetAuthTagOptions) => void;
5
4
  //# sourceMappingURL=auth-tag.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth-tag.d.ts","sourceRoot":"","sources":["../../../../src/utils/private/aes-data/auth-tag.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAG9E,eAAO,MAAM,cAAc,oEAMxB,iBAAiB,KAAG,MAoBtB,CAAC;AAEF,eAAO,MAAM,cAAc,+EAOxB,iBAAiB,KAAG,IA2BtB,CAAC"}
1
+ {"version":3,"file":"auth-tag.d.ts","sourceRoot":"","sources":["../../../../src/utils/private/aes-data/auth-tag.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAG9E,eAAO,MAAM,aAAa,oEAMvB,iBAAiB,KAAG,MAoBtB,CAAC;AAEF,eAAO,MAAM,aAAa,+EAOvB,iBAAiB,KAAG,IA2BtB,CAAC"}
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports._assertAuthTag = exports._createAuthTag = void 0;
3
+ exports.assertAuthTag = exports.createAuthTag = void 0;
4
4
  const errors_1 = require("../../../errors");
5
5
  const auth_tag_hmac_1 = require("./auth-tag-hmac");
6
- const _createAuthTag = ({ encryption, cipher, content, hashKey, initialisationVector, }) => {
6
+ const createAuthTag = ({ encryption, cipher, content, hashKey, initialisationVector, }) => {
7
7
  switch (encryption) {
8
8
  case "A128CBC-HS256":
9
9
  case "A192CBC-HS384":
10
10
  case "A256CBC-HS512":
11
- return (0, auth_tag_hmac_1._createHmacAuthTag)({
11
+ return (0, auth_tag_hmac_1.createHmacAuthTag)({
12
12
  content,
13
13
  encryption,
14
14
  hashKey,
@@ -22,8 +22,8 @@ const _createAuthTag = ({ encryption, cipher, content, hashKey, initialisationVe
22
22
  throw new errors_1.AesError("Unexpected algorithm");
23
23
  }
24
24
  };
25
- exports._createAuthTag = _createAuthTag;
26
- const _assertAuthTag = ({ authTag, content, hashKey, decipher, encryption, initialisationVector, }) => {
25
+ exports.createAuthTag = createAuthTag;
26
+ const assertAuthTag = ({ authTag, content, hashKey, decipher, encryption, initialisationVector, }) => {
27
27
  if (!authTag) {
28
28
  throw new errors_1.AesError("Auth tag is missing");
29
29
  }
@@ -31,7 +31,7 @@ const _assertAuthTag = ({ authTag, content, hashKey, decipher, encryption, initi
31
31
  case "A128CBC-HS256":
32
32
  case "A192CBC-HS384":
33
33
  case "A256CBC-HS512":
34
- (0, auth_tag_hmac_1._assertHmacAuthTag)({
34
+ (0, auth_tag_hmac_1.assertHmacAuthTag)({
35
35
  authTag,
36
36
  content,
37
37
  encryption,
@@ -48,5 +48,5 @@ const _assertAuthTag = ({ authTag, content, hashKey, decipher, encryption, initi
48
48
  throw new errors_1.AesError("Unexpected algorithm");
49
49
  }
50
50
  };
51
- exports._assertAuthTag = _assertAuthTag;
51
+ exports.assertAuthTag = assertAuthTag;
52
52
  //# sourceMappingURL=auth-tag.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth-tag.js","sourceRoot":"","sources":["../../../../src/utils/private/aes-data/auth-tag.ts"],"names":[],"mappings":";;;AACA,4CAA2C;AAE3C,mDAAyE;AAElE,MAAM,cAAc,GAAG,CA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AC;AACH,CAAC,CAAC;AAlCW,QAAA,aAAa,iBAkCxB"}
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { KryptosEncryption } from "@lindorm/kryptos";
3
- export declare const _getInitialisationVector: (encryption: KryptosEncryption) => Buffer;
2
+ export declare const getInitialisationVector: (encryption: KryptosEncryption) => Buffer;
4
3
  //# sourceMappingURL=get-initialisation-vector.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-initialisation-vector.d.ts","sourceRoot":"","sources":["../../../../src/utils/private/aes-data/get-initialisation-vector.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAIrD,eAAO,MAAM,wBAAwB,eAAgB,iBAAiB,KAAG,MAiBxE,CAAC"}
1
+ {"version":3,"file":"get-initialisation-vector.d.ts","sourceRoot":"","sources":["../../../../src/utils/private/aes-data/get-initialisation-vector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAIrD,eAAO,MAAM,uBAAuB,eAAgB,iBAAiB,KAAG,MAiBvE,CAAC"}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports._getInitialisationVector = void 0;
3
+ exports.getInitialisationVector = void 0;
4
4
  const crypto_1 = require("crypto");
5
5
  const errors_1 = require("../../../errors");
6
- const _getInitialisationVector = (encryption) => {
6
+ const getInitialisationVector = (encryption) => {
7
7
  switch (encryption) {
8
8
  case "A128CBC-HS256":
9
9
  case "A192CBC-HS384":
@@ -19,5 +19,5 @@ const _getInitialisationVector = (encryption) => {
19
19
  });
20
20
  }
21
21
  };
22
- exports._getInitialisationVector = _getInitialisationVector;
22
+ exports.getInitialisationVector = getInitialisationVector;
23
23
  //# sourceMappingURL=get-initialisation-vector.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-initialisation-vector.js","sourceRoot":"","sources":["../../../../src/utils/private/aes-data/get-initialisation-vector.ts"],"names":[],"mappings":";;;AACA,mCAAqC;AACrC,4CAA2C;AAEpC,MAAM,wBAAwB,GAAG,CAAC,UAA6B,EAAU,EAAE;IAChF,QAAQ,UAAU,EAAE,CAAC;QACnB,KAAK,eAAe,CAAC;QACrB,KAAK,eAAe,CAAC;QACrB,KAAK,eAAe;YAClB,OAAO,IAAA,oBAAW,EAAC,EAAE,CAAC,CAAC;QAEzB,KAAK,SAAS,CAAC;QACf,KAAK,SAAS,CAAC;QACf,KAAK,SAAS;YACZ,OAAO,IAAA,oBAAW,EAAC,EAAE,CAAC,CAAC;QAEzB;YACE,MAAM,IAAI,iBAAQ,CAAC,sBAAsB,EAAE;gBACzC,KAAK,EAAE,EAAE,UAAU,EAAE;aACtB,CAAC,CAAC;IACP,CAAC;AACH,CAAC,CAAC;AAjBW,QAAA,wBAAwB,4BAiBnC"}
1
+ {"version":3,"file":"get-initialisation-vector.js","sourceRoot":"","sources":["../../../../src/utils/private/aes-data/get-initialisation-vector.ts"],"names":[],"mappings":";;;AACA,mCAAqC;AACrC,4CAA2C;AAEpC,MAAM,uBAAuB,GAAG,CAAC,UAA6B,EAAU,EAAE;IAC/E,QAAQ,UAAU,EAAE,CAAC;QACnB,KAAK,eAAe,CAAC;QACrB,KAAK,eAAe,CAAC;QACrB,KAAK,eAAe;YAClB,OAAO,IAAA,oBAAW,EAAC,EAAE,CAAC,CAAC;QAEzB,KAAK,SAAS,CAAC;QACf,KAAK,SAAS,CAAC;QACf,KAAK,SAAS;YACZ,OAAO,IAAA,oBAAW,EAAC,EAAE,CAAC,CAAC;QAEzB;YACE,MAAM,IAAI,iBAAQ,CAAC,sBAAsB,EAAE;gBACzC,KAAK,EAAE,EAAE,UAAU,EAAE;aACtB,CAAC,CAAC;IACP,CAAC;AACH,CAAC,CAAC;AAjBW,QAAA,uBAAuB,2BAiBlC"}
@@ -1,9 +1,8 @@
1
- /// <reference types="node" />
2
1
  import { KryptosEncryption } from "@lindorm/kryptos";
3
2
  type Result = {
4
3
  encryptionKey: Buffer;
5
4
  hashKey: Buffer;
6
5
  };
7
- export declare const _splitContentEncryptionKey: (encryption: KryptosEncryption, contentEncryptionKey: Buffer) => Result;
6
+ export declare const splitContentEncryptionKey: (encryption: KryptosEncryption, contentEncryptionKey: Buffer) => Result;
8
7
  export {};
9
8
  //# sourceMappingURL=split-content-encryption-key.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"split-content-encryption-key.d.ts","sourceRoot":"","sources":["../../../../src/utils/private/aes-data/split-content-encryption-key.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAIrD,KAAK,MAAM,GAAG;IACZ,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAqBF,eAAO,MAAM,0BAA0B,eACzB,iBAAiB,wBACP,MAAM,KAC3B,MAcF,CAAC"}
1
+ {"version":3,"file":"split-content-encryption-key.d.ts","sourceRoot":"","sources":["../../../../src/utils/private/aes-data/split-content-encryption-key.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAIrD,KAAK,MAAM,GAAG;IACZ,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAqBF,eAAO,MAAM,yBAAyB,eACxB,iBAAiB,wBACP,MAAM,KAC3B,MAcF,CAAC"}