@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
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports._splitContentEncryptionKey = void 0;
3
+ exports.splitContentEncryptionKey = void 0;
4
4
  const errors_1 = require("../../../errors");
5
5
  const encryptionKeyLength = (encryption) => {
6
6
  switch (encryption) {
@@ -17,7 +17,7 @@ const encryptionKeyLength = (encryption) => {
17
17
  throw new errors_1.AesError("Unexpected algorithm");
18
18
  }
19
19
  };
20
- const _splitContentEncryptionKey = (encryption, contentEncryptionKey) => {
20
+ const splitContentEncryptionKey = (encryption, contentEncryptionKey) => {
21
21
  const keyLength = encryptionKeyLength(encryption);
22
22
  const encryptionKey = contentEncryptionKey.subarray(0, keyLength);
23
23
  const hashKey = contentEncryptionKey.subarray(keyLength);
@@ -27,5 +27,5 @@ const _splitContentEncryptionKey = (encryption, contentEncryptionKey) => {
27
27
  }
28
28
  return { encryptionKey, hashKey };
29
29
  };
30
- exports._splitContentEncryptionKey = _splitContentEncryptionKey;
30
+ exports.splitContentEncryptionKey = splitContentEncryptionKey;
31
31
  //# sourceMappingURL=split-content-encryption-key.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"split-content-encryption-key.js","sourceRoot":"","sources":["../../../../src/utils/private/aes-data/split-content-encryption-key.ts"],"names":[],"mappings":";;;AAEA,4CAA2C;AAO3C,MAAM,mBAAmB,GAAG,CAAC,UAA6B,EAAgB,EAAE;IAC1E,QAAQ,UAAU,EAAE,CAAC;QACnB,KAAK,eAAe,CAAC;QACrB,KAAK,SAAS;YACZ,OAAO,EAAE,CAAC;QAEZ,KAAK,eAAe,CAAC;QACrB,KAAK,SAAS;YACZ,OAAO,EAAE,CAAC;QAEZ,KAAK,eAAe,CAAC;QACrB,KAAK,SAAS;YACZ,OAAO,EAAE,CAAC;QAEZ;YACE,MAAM,IAAI,iBAAQ,CAAC,sBAAsB,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC,CAAC;AAEK,MAAM,0BAA0B,GAAG,CACxC,UAA6B,EAC7B,oBAA4B,EACpB,EAAE;IACV,MAAM,SAAS,GAAG,mBAAmB,CAAC,UAAU,CAAC,CAAC;IAElD,MAAM,aAAa,GAAG,oBAAoB,CAAC,QAAQ,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IAClE,MAAM,OAAO,GAAG,oBAAoB,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IAEzD,IACE,OAAO,CAAC,MAAM;QACd,CAAC,UAAU,KAAK,SAAS,IAAI,UAAU,KAAK,SAAS,IAAI,UAAU,KAAK,SAAS,CAAC,EAClF,CAAC;QACD,MAAM,IAAI,iBAAQ,CAAC,qBAAqB,CAAC,CAAC;IAC5C,CAAC;IAED,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC;AACpC,CAAC,CAAC;AAjBW,QAAA,0BAA0B,8BAiBrC"}
1
+ {"version":3,"file":"split-content-encryption-key.js","sourceRoot":"","sources":["../../../../src/utils/private/aes-data/split-content-encryption-key.ts"],"names":[],"mappings":";;;AAEA,4CAA2C;AAO3C,MAAM,mBAAmB,GAAG,CAAC,UAA6B,EAAgB,EAAE;IAC1E,QAAQ,UAAU,EAAE,CAAC;QACnB,KAAK,eAAe,CAAC;QACrB,KAAK,SAAS;YACZ,OAAO,EAAE,CAAC;QAEZ,KAAK,eAAe,CAAC;QACrB,KAAK,SAAS;YACZ,OAAO,EAAE,CAAC;QAEZ,KAAK,eAAe,CAAC;QACrB,KAAK,SAAS;YACZ,OAAO,EAAE,CAAC;QAEZ;YACE,MAAM,IAAI,iBAAQ,CAAC,sBAAsB,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC,CAAC;AAEK,MAAM,yBAAyB,GAAG,CACvC,UAA6B,EAC7B,oBAA4B,EACpB,EAAE;IACV,MAAM,SAAS,GAAG,mBAAmB,CAAC,UAAU,CAAC,CAAC;IAElD,MAAM,aAAa,GAAG,oBAAoB,CAAC,QAAQ,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IAClE,MAAM,OAAO,GAAG,oBAAoB,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IAEzD,IACE,OAAO,CAAC,MAAM;QACd,CAAC,UAAU,KAAK,SAAS,IAAI,UAAU,KAAK,SAAS,IAAI,UAAU,KAAK,SAAS,CAAC,EAClF,CAAC;QACD,MAAM,IAAI,iBAAQ,CAAC,qBAAqB,CAAC,CAAC;IAC5C,CAAC;IAED,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC;AACpC,CAAC,CAAC;AAjBW,QAAA,yBAAyB,6BAiBpC"}
@@ -1,4 +1,4 @@
1
1
  import { AesEncryptionData, DecryptAesDataOptions, EncryptAesDataOptions } from "../../types";
2
- export declare const _encryptAesData: (options: EncryptAesDataOptions) => AesEncryptionData;
3
- export declare const _decryptAesData: (options: DecryptAesDataOptions) => string;
2
+ export declare const encryptAesData: (options: EncryptAesDataOptions) => AesEncryptionData;
3
+ export declare const decryptAesData: (options: DecryptAesDataOptions) => string;
4
4
  //# sourceMappingURL=aes-data.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"aes-data.d.ts","sourceRoot":"","sources":["../../../src/utils/private/aes-data.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAQrB,eAAO,MAAM,eAAe,YAAa,qBAAqB,KAAG,iBAkDhE,CAAC;AAEF,eAAO,MAAM,eAAe,YAAa,qBAAqB,KAAG,MA0ChE,CAAC"}
1
+ {"version":3,"file":"aes-data.d.ts","sourceRoot":"","sources":["../../../src/utils/private/aes-data.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAQrB,eAAO,MAAM,cAAc,YAAa,qBAAqB,KAAG,iBAqD/D,CAAC;AAEF,eAAO,MAAM,cAAc,YAAa,qBAAqB,KAAG,MA8C/D,CAAC"}
@@ -1,27 +1,28 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports._decryptAesData = exports._encryptAesData = void 0;
3
+ exports.decryptAesData = exports.encryptAesData = void 0;
4
4
  const crypto_1 = require("crypto");
5
5
  const constants_1 = require("../../constants");
6
+ const format_1 = require("../../constants/private/format");
6
7
  const auth_tag_1 = require("./aes-data/auth-tag");
7
8
  const get_initialisation_vector_1 = require("./aes-data/get-initialisation-vector");
8
9
  const split_content_encryption_key_1 = require("./aes-data/split-content-encryption-key");
9
10
  const calculate_aes_encryption_1 = require("./calculate/calculate-aes-encryption");
10
11
  const get_decryption_key_1 = require("./get-key/get-decryption-key");
11
12
  const get_encryption_key_1 = require("./get-key/get-encryption-key");
12
- const _encryptAesData = (options) => {
13
- const { data, encryption = "A256GCM", format = "base64url", kryptos } = options;
14
- const { contentEncryptionKey, hkdfSalt, pbkdfIterations, pbkdfSalt, publicEncryptionJwk, publicEncryptionKey, } = (0, get_encryption_key_1._getEncryptionKey)({
13
+ const encryptAesData = (options) => {
14
+ const { data, encryption = "A256GCM", kryptos } = options;
15
+ const { contentEncryptionKey, hkdfSalt, pbkdfIterations, pbkdfSalt, publicEncryptionIv, publicEncryptionJwk, publicEncryptionKey, publicEncryptionTag, } = (0, get_encryption_key_1.getEncryptionKey)({
15
16
  encryption,
16
17
  kryptos,
17
18
  });
18
- const { encryptionKey, hashKey } = (0, split_content_encryption_key_1._splitContentEncryptionKey)(encryption, contentEncryptionKey);
19
- const aesEncryption = (0, calculate_aes_encryption_1._calculateAesEncryption)(encryption);
20
- const initialisationVector = (0, get_initialisation_vector_1._getInitialisationVector)(encryption);
19
+ const { encryptionKey, hashKey } = (0, split_content_encryption_key_1.splitContentEncryptionKey)(encryption, contentEncryptionKey);
20
+ const aesEncryption = (0, calculate_aes_encryption_1.calculateAesEncryption)(encryption);
21
+ const initialisationVector = (0, get_initialisation_vector_1.getInitialisationVector)(encryption);
21
22
  const cipher = (0, crypto_1.createCipheriv)(aesEncryption, encryptionKey, initialisationVector);
22
23
  const buffer = Buffer.isBuffer(data) ? data : Buffer.from(data);
23
24
  const content = Buffer.concat([cipher.update(buffer), cipher.final()]);
24
- const authTag = (0, auth_tag_1._createAuthTag)({
25
+ const authTag = (0, auth_tag_1.createAuthTag)({
25
26
  cipher,
26
27
  content,
27
28
  hashKey,
@@ -33,33 +34,36 @@ const _encryptAesData = (options) => {
33
34
  authTag,
34
35
  content,
35
36
  encryption,
36
- format,
37
37
  hkdfSalt,
38
38
  initialisationVector,
39
- keyId: Buffer.from(kryptos.id, format),
39
+ keyId: Buffer.from(kryptos.id, format_1.B64U),
40
40
  pbkdfIterations,
41
41
  pbkdfSalt,
42
+ publicEncryptionIv,
42
43
  publicEncryptionJwk,
43
44
  publicEncryptionKey,
45
+ publicEncryptionTag,
44
46
  version: constants_1.LATEST_AES_VERSION,
45
47
  };
46
48
  };
47
- exports._encryptAesData = _encryptAesData;
48
- const _decryptAesData = (options) => {
49
- const { authTag, content, encryption, hkdfSalt, initialisationVector, kryptos, pbkdfIterations, pbkdfSalt, publicEncryptionJwk, publicEncryptionKey, } = options;
50
- const { contentEncryptionKey } = (0, get_decryption_key_1._getDecryptionKey)({
49
+ exports.encryptAesData = encryptAesData;
50
+ const decryptAesData = (options) => {
51
+ const { authTag, content, encryption, hkdfSalt, initialisationVector, kryptos, pbkdfIterations, pbkdfSalt, publicEncryptionIv, publicEncryptionJwk, publicEncryptionKey, publicEncryptionTag, } = options;
52
+ const { contentEncryptionKey } = (0, get_decryption_key_1.getDecryptionKey)({
51
53
  encryption,
52
54
  hkdfSalt,
53
55
  kryptos,
54
56
  pbkdfIterations,
55
57
  pbkdfSalt,
58
+ publicEncryptionIv,
56
59
  publicEncryptionJwk,
57
60
  publicEncryptionKey,
61
+ publicEncryptionTag,
58
62
  });
59
- const { encryptionKey, hashKey } = (0, split_content_encryption_key_1._splitContentEncryptionKey)(encryption, contentEncryptionKey);
60
- const aesEncryption = (0, calculate_aes_encryption_1._calculateAesEncryption)(encryption);
63
+ const { encryptionKey, hashKey } = (0, split_content_encryption_key_1.splitContentEncryptionKey)(encryption, contentEncryptionKey);
64
+ const aesEncryption = (0, calculate_aes_encryption_1.calculateAesEncryption)(encryption);
61
65
  const decipher = (0, crypto_1.createDecipheriv)(aesEncryption, encryptionKey, initialisationVector);
62
- (0, auth_tag_1._assertAuthTag)({
66
+ (0, auth_tag_1.assertAuthTag)({
63
67
  authTag,
64
68
  content,
65
69
  hashKey,
@@ -69,5 +73,5 @@ const _decryptAesData = (options) => {
69
73
  });
70
74
  return Buffer.concat([decipher.update(content), decipher.final()]).toString("utf-8");
71
75
  };
72
- exports._decryptAesData = _decryptAesData;
76
+ exports.decryptAesData = decryptAesData;
73
77
  //# sourceMappingURL=aes-data.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"aes-data.js","sourceRoot":"","sources":["../../../src/utils/private/aes-data.ts"],"names":[],"mappings":";;;AAAA,mCAA0D;AAC1D,+CAAqD;AAMrD,kDAAqE;AACrE,oFAAgF;AAChF,0FAAqF;AACrF,mFAA+E;AAC/E,qEAAiE;AACjE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AAA,cAAc,kBA8CzB"}
@@ -1,4 +1,4 @@
1
1
  import { KryptosEncryption } from "@lindorm/kryptos";
2
2
  import { AesEncryption } from "../../../types";
3
- export declare const _calculateAesEncryption: (encryption: KryptosEncryption) => AesEncryption;
3
+ export declare const calculateAesEncryption: (encryption: KryptosEncryption) => AesEncryption;
4
4
  //# sourceMappingURL=calculate-aes-encryption.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"calculate-aes-encryption.d.ts","sourceRoot":"","sources":["../../../../src/utils/private/calculate/calculate-aes-encryption.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,eAAO,MAAM,uBAAuB,eAAgB,iBAAiB,KAAG,aAuBvE,CAAC"}
1
+ {"version":3,"file":"calculate-aes-encryption.d.ts","sourceRoot":"","sources":["../../../../src/utils/private/calculate/calculate-aes-encryption.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,eAAO,MAAM,sBAAsB,eAAgB,iBAAiB,KAAG,aAuBtE,CAAC"}
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports._calculateAesEncryption = void 0;
3
+ exports.calculateAesEncryption = void 0;
4
4
  const errors_1 = require("../../../errors");
5
- const _calculateAesEncryption = (encryption) => {
5
+ const calculateAesEncryption = (encryption) => {
6
6
  switch (encryption) {
7
7
  case "A128CBC-HS256":
8
8
  return "aes-128-cbc";
@@ -20,5 +20,5 @@ const _calculateAesEncryption = (encryption) => {
20
20
  throw new errors_1.AesError("Unsupported encryption algorithm");
21
21
  }
22
22
  };
23
- exports._calculateAesEncryption = _calculateAesEncryption;
23
+ exports.calculateAesEncryption = calculateAesEncryption;
24
24
  //# sourceMappingURL=calculate-aes-encryption.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"calculate-aes-encryption.js","sourceRoot":"","sources":["../../../../src/utils/private/calculate/calculate-aes-encryption.ts"],"names":[],"mappings":";;;AACA,4CAA2C;AAGpC,MAAM,uBAAuB,GAAG,CAAC,UAA6B,EAAiB,EAAE;IACtF,QAAQ,UAAU,EAAE,CAAC;QACnB,KAAK,eAAe;YAClB,OAAO,aAAa,CAAC;QAEvB,KAAK,eAAe;YAClB,OAAO,aAAa,CAAC;QAEvB,KAAK,eAAe;YAClB,OAAO,aAAa,CAAC;QAEvB,KAAK,SAAS;YACZ,OAAO,aAAa,CAAC;QAEvB,KAAK,SAAS;YACZ,OAAO,aAAa,CAAC;QAEvB,KAAK,SAAS;YACZ,OAAO,aAAa,CAAC;QAEvB;YACE,MAAM,IAAI,iBAAQ,CAAC,kCAAkC,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC,CAAC;AAvBW,QAAA,uBAAuB,2BAuBlC"}
1
+ {"version":3,"file":"calculate-aes-encryption.js","sourceRoot":"","sources":["../../../../src/utils/private/calculate/calculate-aes-encryption.ts"],"names":[],"mappings":";;;AACA,4CAA2C;AAGpC,MAAM,sBAAsB,GAAG,CAAC,UAA6B,EAAiB,EAAE;IACrF,QAAQ,UAAU,EAAE,CAAC;QACnB,KAAK,eAAe;YAClB,OAAO,aAAa,CAAC;QAEvB,KAAK,eAAe;YAClB,OAAO,aAAa,CAAC;QAEvB,KAAK,eAAe;YAClB,OAAO,aAAa,CAAC;QAEvB,KAAK,SAAS;YACZ,OAAO,aAAa,CAAC;QAEvB,KAAK,SAAS;YACZ,OAAO,aAAa,CAAC;QAEvB,KAAK,SAAS;YACZ,OAAO,aAAa,CAAC;QAEvB;YACE,MAAM,IAAI,iBAAQ,CAAC,kCAAkC,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC,CAAC;AAvBW,QAAA,sBAAsB,0BAuBjC"}
@@ -1,4 +1,4 @@
1
1
  import { KryptosEncryption } from "@lindorm/kryptos";
2
2
  import { AesKeyLength } from "@lindorm/types";
3
- export declare const _calculateContentEncryptionKeySize: (encryption: KryptosEncryption) => AesKeyLength;
3
+ export declare const calculateContentEncryptionKeySize: (encryption: KryptosEncryption) => AesKeyLength;
4
4
  //# sourceMappingURL=calculate-content-encryption-key-size.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"calculate-content-encryption-key-size.d.ts","sourceRoot":"","sources":["../../../../src/utils/private/calculate/calculate-content-encryption-key-size.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,eAAO,MAAM,kCAAkC,eACjC,iBAAiB,KAC5B,YAuBF,CAAC"}
1
+ {"version":3,"file":"calculate-content-encryption-key-size.d.ts","sourceRoot":"","sources":["../../../../src/utils/private/calculate/calculate-content-encryption-key-size.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,eAAO,MAAM,iCAAiC,eAChC,iBAAiB,KAC5B,YAuBF,CAAC"}
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports._calculateContentEncryptionKeySize = void 0;
3
+ exports.calculateContentEncryptionKeySize = void 0;
4
4
  const errors_1 = require("../../../errors");
5
- const _calculateContentEncryptionKeySize = (encryption) => {
5
+ const calculateContentEncryptionKeySize = (encryption) => {
6
6
  switch (encryption) {
7
7
  case "A128GCM":
8
8
  return 16;
@@ -20,5 +20,5 @@ const _calculateContentEncryptionKeySize = (encryption) => {
20
20
  throw new errors_1.AesError("Unsupported encryption", { debug: { encryption } });
21
21
  }
22
22
  };
23
- exports._calculateContentEncryptionKeySize = _calculateContentEncryptionKeySize;
23
+ exports.calculateContentEncryptionKeySize = calculateContentEncryptionKeySize;
24
24
  //# sourceMappingURL=calculate-content-encryption-key-size.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"calculate-content-encryption-key-size.js","sourceRoot":"","sources":["../../../../src/utils/private/calculate/calculate-content-encryption-key-size.ts"],"names":[],"mappings":";;;AAEA,4CAA2C;AAEpC,MAAM,kCAAkC,GAAG,CAChD,UAA6B,EACf,EAAE;IAChB,QAAQ,UAAU,EAAE,CAAC;QACnB,KAAK,SAAS;YACZ,OAAO,EAAE,CAAC;QAEZ,KAAK,SAAS;YACZ,OAAO,EAAE,CAAC;QAEZ,KAAK,SAAS;YACZ,OAAO,EAAE,CAAC;QAEZ,KAAK,eAAe;YAClB,OAAO,EAAE,CAAC;QAEZ,KAAK,eAAe;YAClB,OAAO,EAAE,CAAC;QAEZ,KAAK,eAAe;YAClB,OAAO,EAAE,CAAC;QAEZ;YACE,MAAM,IAAI,iBAAQ,CAAC,wBAAwB,EAAE,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,EAAE,CAAC,CAAC;IAC5E,CAAC;AACH,CAAC,CAAC;AAzBW,QAAA,kCAAkC,sCAyB7C"}
1
+ {"version":3,"file":"calculate-content-encryption-key-size.js","sourceRoot":"","sources":["../../../../src/utils/private/calculate/calculate-content-encryption-key-size.ts"],"names":[],"mappings":";;;AAEA,4CAA2C;AAEpC,MAAM,iCAAiC,GAAG,CAC/C,UAA6B,EACf,EAAE;IAChB,QAAQ,UAAU,EAAE,CAAC;QACnB,KAAK,SAAS;YACZ,OAAO,EAAE,CAAC;QAEZ,KAAK,SAAS;YACZ,OAAO,EAAE,CAAC;QAEZ,KAAK,SAAS;YACZ,OAAO,EAAE,CAAC;QAEZ,KAAK,eAAe;YAClB,OAAO,EAAE,CAAC;QAEZ,KAAK,eAAe;YAClB,OAAO,EAAE,CAAC;QAEZ,KAAK,eAAe;YAClB,OAAO,EAAE,CAAC;QAEZ;YACE,MAAM,IAAI,iBAAQ,CAAC,wBAAwB,EAAE,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,EAAE,CAAC,CAAC;IAC5E,CAAC;AACH,CAAC,CAAC;AAzBW,QAAA,iCAAiC,qCAyB5C"}
@@ -1,5 +1,5 @@
1
1
  import { IKryptos } from "@lindorm/kryptos";
2
- type KeywrapEncryption = "aes-128-ecb" | "aes-192-ecb" | "aes-256-ecb";
3
- export declare const _calculateKeyWrapEncryption: (kryptos: IKryptos) => KeywrapEncryption;
2
+ type KeywrapEncryption = "aes-128-ecb" | "aes-192-ecb" | "aes-256-ecb" | "aes-128-gcm" | "aes-192-gcm" | "aes-256-gcm";
3
+ export declare const calculateKeyWrapEncryption: (kryptos: IKryptos) => KeywrapEncryption;
4
4
  export {};
5
5
  //# sourceMappingURL=calculate-key-wrap-encryption.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"calculate-key-wrap-encryption.d.ts","sourceRoot":"","sources":["../../../../src/utils/private/calculate/calculate-key-wrap-encryption.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,KAAK,iBAAiB,GAAG,aAAa,GAAG,aAAa,GAAG,aAAa,CAAC;AAEvE,eAAO,MAAM,2BAA2B,YAAa,QAAQ,KAAG,iBAoB/D,CAAC"}
1
+ {"version":3,"file":"calculate-key-wrap-encryption.d.ts","sourceRoot":"","sources":["../../../../src/utils/private/calculate/calculate-key-wrap-encryption.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,KAAK,iBAAiB,GAClB,aAAa,GACb,aAAa,GACb,aAAa,GACb,aAAa,GACb,aAAa,GACb,aAAa,CAAC;AAElB,eAAO,MAAM,0BAA0B,YAAa,QAAQ,KAAG,iBAgC9D,CAAC"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports._calculateKeyWrapEncryption = void 0;
4
- const _calculateKeyWrapEncryption = (kryptos) => {
3
+ exports.calculateKeyWrapEncryption = void 0;
4
+ const calculateKeyWrapEncryption = (kryptos) => {
5
5
  switch (kryptos.algorithm) {
6
6
  case "A128KW":
7
7
  case "ECDH-ES+A128KW":
@@ -15,9 +15,18 @@ const _calculateKeyWrapEncryption = (kryptos) => {
15
15
  case "ECDH-ES+A256KW":
16
16
  case "PBES2-HS512+A256KW":
17
17
  return "aes-256-ecb";
18
+ case "A128GCMKW":
19
+ case "ECDH-ES+A128GCMKW":
20
+ return "aes-128-gcm";
21
+ case "A192GCMKW":
22
+ case "ECDH-ES+A192GCMKW":
23
+ return "aes-192-gcm";
24
+ case "A256GCMKW":
25
+ case "ECDH-ES+A256GCMKW":
26
+ return "aes-256-gcm";
18
27
  default:
19
28
  throw new Error("Unsupported keywrap encryption");
20
29
  }
21
30
  };
22
- exports._calculateKeyWrapEncryption = _calculateKeyWrapEncryption;
31
+ exports.calculateKeyWrapEncryption = calculateKeyWrapEncryption;
23
32
  //# sourceMappingURL=calculate-key-wrap-encryption.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"calculate-key-wrap-encryption.js","sourceRoot":"","sources":["../../../../src/utils/private/calculate/calculate-key-wrap-encryption.ts"],"names":[],"mappings":";;;AAIO,MAAM,2BAA2B,GAAG,CAAC,OAAiB,EAAqB,EAAE;IAClF,QAAQ,OAAO,CAAC,SAAS,EAAE,CAAC;QAC1B,KAAK,QAAQ,CAAC;QACd,KAAK,gBAAgB,CAAC;QACtB,KAAK,oBAAoB;YACvB,OAAO,aAAa,CAAC;QAEvB,KAAK,QAAQ,CAAC;QACd,KAAK,gBAAgB,CAAC;QACtB,KAAK,oBAAoB;YACvB,OAAO,aAAa,CAAC;QAEvB,KAAK,QAAQ,CAAC;QACd,KAAK,gBAAgB,CAAC;QACtB,KAAK,oBAAoB;YACvB,OAAO,aAAa,CAAC;QAEvB;YACE,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACtD,CAAC;AACH,CAAC,CAAC;AApBW,QAAA,2BAA2B,+BAoBtC"}
1
+ {"version":3,"file":"calculate-key-wrap-encryption.js","sourceRoot":"","sources":["../../../../src/utils/private/calculate/calculate-key-wrap-encryption.ts"],"names":[],"mappings":";;;AAUO,MAAM,0BAA0B,GAAG,CAAC,OAAiB,EAAqB,EAAE;IACjF,QAAQ,OAAO,CAAC,SAAS,EAAE,CAAC;QAC1B,KAAK,QAAQ,CAAC;QACd,KAAK,gBAAgB,CAAC;QACtB,KAAK,oBAAoB;YACvB,OAAO,aAAa,CAAC;QAEvB,KAAK,QAAQ,CAAC;QACd,KAAK,gBAAgB,CAAC;QACtB,KAAK,oBAAoB;YACvB,OAAO,aAAa,CAAC;QAEvB,KAAK,QAAQ,CAAC;QACd,KAAK,gBAAgB,CAAC;QACtB,KAAK,oBAAoB;YACvB,OAAO,aAAa,CAAC;QAEvB,KAAK,WAAW,CAAC;QACjB,KAAK,mBAAmB;YACtB,OAAO,aAAa,CAAC;QAEvB,KAAK,WAAW,CAAC;QACjB,KAAK,mBAAmB;YACtB,OAAO,aAAa,CAAC;QAEvB,KAAK,WAAW,CAAC;QACjB,KAAK,mBAAmB;YACtB,OAAO,aAAa,CAAC;QAEvB;YACE,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACtD,CAAC;AACH,CAAC,CAAC;AAhCW,QAAA,0BAA0B,8BAgCrC"}
@@ -1,4 +1,4 @@
1
1
  import { KryptosAlgorithm } from "@lindorm/kryptos";
2
2
  import { AesKeyLength } from "@lindorm/types";
3
- export declare const _calculateKeyWrapSize: (algorithm: KryptosAlgorithm) => AesKeyLength;
3
+ export declare const calculateKeyWrapSize: (algorithm: KryptosAlgorithm) => AesKeyLength;
4
4
  //# sourceMappingURL=calculate-key-wrap-size.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"calculate-key-wrap-size.d.ts","sourceRoot":"","sources":["../../../../src/utils/private/calculate/calculate-key-wrap-size.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,eAAO,MAAM,qBAAqB,cAAe,gBAAgB,KAAG,YAoBnE,CAAC"}
1
+ {"version":3,"file":"calculate-key-wrap-size.d.ts","sourceRoot":"","sources":["../../../../src/utils/private/calculate/calculate-key-wrap-size.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,eAAO,MAAM,oBAAoB,cAAe,gBAAgB,KAAG,YA0BlE,CAAC"}
@@ -1,24 +1,30 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports._calculateKeyWrapSize = void 0;
3
+ exports.calculateKeyWrapSize = void 0;
4
4
  const errors_1 = require("../../../errors");
5
- const _calculateKeyWrapSize = (algorithm) => {
5
+ const calculateKeyWrapSize = (algorithm) => {
6
6
  switch (algorithm) {
7
7
  case "A128KW":
8
+ case "A128GCMKW":
8
9
  case "ECDH-ES+A128KW":
10
+ case "ECDH-ES+A128GCMKW":
9
11
  case "PBES2-HS256+A128KW":
10
12
  return 16;
11
13
  case "A192KW":
14
+ case "A192GCMKW":
12
15
  case "ECDH-ES+A192KW":
16
+ case "ECDH-ES+A192GCMKW":
13
17
  case "PBES2-HS384+A192KW":
14
18
  return 24;
15
19
  case "A256KW":
20
+ case "A256GCMKW":
16
21
  case "ECDH-ES+A256KW":
22
+ case "ECDH-ES+A256GCMKW":
17
23
  case "PBES2-HS512+A256KW":
18
24
  return 32;
19
25
  default:
20
26
  throw new errors_1.AesError("Unsupported algorithm", { debug: { algorithm } });
21
27
  }
22
28
  };
23
- exports._calculateKeyWrapSize = _calculateKeyWrapSize;
29
+ exports.calculateKeyWrapSize = calculateKeyWrapSize;
24
30
  //# sourceMappingURL=calculate-key-wrap-size.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"calculate-key-wrap-size.js","sourceRoot":"","sources":["../../../../src/utils/private/calculate/calculate-key-wrap-size.ts"],"names":[],"mappings":";;;AAEA,4CAA2C;AAEpC,MAAM,qBAAqB,GAAG,CAAC,SAA2B,EAAgB,EAAE;IACjF,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,QAAQ,CAAC;QACd,KAAK,gBAAgB,CAAC;QACtB,KAAK,oBAAoB;YACvB,OAAO,EAAE,CAAC;QAEZ,KAAK,QAAQ,CAAC;QACd,KAAK,gBAAgB,CAAC;QACtB,KAAK,oBAAoB;YACvB,OAAO,EAAE,CAAC;QAEZ,KAAK,QAAQ,CAAC;QACd,KAAK,gBAAgB,CAAC;QACtB,KAAK,oBAAoB;YACvB,OAAO,EAAE,CAAC;QAEZ;YACE,MAAM,IAAI,iBAAQ,CAAC,uBAAuB,EAAE,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC;IAC1E,CAAC;AACH,CAAC,CAAC;AApBW,QAAA,qBAAqB,yBAoBhC"}
1
+ {"version":3,"file":"calculate-key-wrap-size.js","sourceRoot":"","sources":["../../../../src/utils/private/calculate/calculate-key-wrap-size.ts"],"names":[],"mappings":";;;AAEA,4CAA2C;AAEpC,MAAM,oBAAoB,GAAG,CAAC,SAA2B,EAAgB,EAAE;IAChF,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,QAAQ,CAAC;QACd,KAAK,WAAW,CAAC;QACjB,KAAK,gBAAgB,CAAC;QACtB,KAAK,mBAAmB,CAAC;QACzB,KAAK,oBAAoB;YACvB,OAAO,EAAE,CAAC;QAEZ,KAAK,QAAQ,CAAC;QACd,KAAK,WAAW,CAAC;QACjB,KAAK,gBAAgB,CAAC;QACtB,KAAK,mBAAmB,CAAC;QACzB,KAAK,oBAAoB;YACvB,OAAO,EAAE,CAAC;QAEZ,KAAK,QAAQ,CAAC;QACd,KAAK,WAAW,CAAC;QACjB,KAAK,gBAAgB,CAAC;QACtB,KAAK,mBAAmB,CAAC;QACzB,KAAK,oBAAoB;YACvB,OAAO,EAAE,CAAC;QAEZ;YACE,MAAM,IAAI,iBAAQ,CAAC,uBAAuB,EAAE,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC;IAC1E,CAAC;AACH,CAAC,CAAC;AA1BW,QAAA,oBAAoB,wBA0B/B"}
@@ -1,4 +1,4 @@
1
1
  import { IKryptos } from "@lindorm/kryptos";
2
2
  import { ShaAlgorithm } from "@lindorm/types";
3
- export declare const _calculatePbkdfAlgorithm: (kryptos: IKryptos) => ShaAlgorithm;
3
+ export declare const calculatePbkdfAlgorithm: (kryptos: IKryptos) => ShaAlgorithm;
4
4
  //# sourceMappingURL=calculate-pbkdf-hash.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"calculate-pbkdf-hash.d.ts","sourceRoot":"","sources":["../../../../src/utils/private/calculate/calculate-pbkdf-hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,eAAO,MAAM,wBAAwB,YAAa,QAAQ,KAAG,YAc5D,CAAC"}
1
+ {"version":3,"file":"calculate-pbkdf-hash.d.ts","sourceRoot":"","sources":["../../../../src/utils/private/calculate/calculate-pbkdf-hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,eAAO,MAAM,uBAAuB,YAAa,QAAQ,KAAG,YAc3D,CAAC"}
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports._calculatePbkdfAlgorithm = void 0;
3
+ exports.calculatePbkdfAlgorithm = void 0;
4
4
  const errors_1 = require("../../../errors");
5
- const _calculatePbkdfAlgorithm = (kryptos) => {
5
+ const calculatePbkdfAlgorithm = (kryptos) => {
6
6
  switch (kryptos.algorithm) {
7
7
  case "PBES2-HS256+A128KW":
8
8
  return "SHA256";
@@ -14,5 +14,5 @@ const _calculatePbkdfAlgorithm = (kryptos) => {
14
14
  throw new errors_1.AesError("Unsupported PBKDF2 algorithm");
15
15
  }
16
16
  };
17
- exports._calculatePbkdfAlgorithm = _calculatePbkdfAlgorithm;
17
+ exports.calculatePbkdfAlgorithm = calculatePbkdfAlgorithm;
18
18
  //# sourceMappingURL=calculate-pbkdf-hash.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"calculate-pbkdf-hash.js","sourceRoot":"","sources":["../../../../src/utils/private/calculate/calculate-pbkdf-hash.ts"],"names":[],"mappings":";;;AAEA,4CAA2C;AAEpC,MAAM,wBAAwB,GAAG,CAAC,OAAiB,EAAgB,EAAE;IAC1E,QAAQ,OAAO,CAAC,SAAS,EAAE,CAAC;QAC1B,KAAK,oBAAoB;YACvB,OAAO,QAAQ,CAAC;QAElB,KAAK,oBAAoB;YACvB,OAAO,QAAQ,CAAC;QAElB,KAAK,oBAAoB;YACvB,OAAO,QAAQ,CAAC;QAElB;YACE,MAAM,IAAI,iBAAQ,CAAC,8BAA8B,CAAC,CAAC;IACvD,CAAC;AACH,CAAC,CAAC;AAdW,QAAA,wBAAwB,4BAcnC"}
1
+ {"version":3,"file":"calculate-pbkdf-hash.js","sourceRoot":"","sources":["../../../../src/utils/private/calculate/calculate-pbkdf-hash.ts"],"names":[],"mappings":";;;AAEA,4CAA2C;AAEpC,MAAM,uBAAuB,GAAG,CAAC,OAAiB,EAAgB,EAAE;IACzE,QAAQ,OAAO,CAAC,SAAS,EAAE,CAAC;QAC1B,KAAK,oBAAoB;YACvB,OAAO,QAAQ,CAAC;QAElB,KAAK,oBAAoB;YACvB,OAAO,QAAQ,CAAC;QAElB,KAAK,oBAAoB;YACvB,OAAO,QAAQ,CAAC;QAElB;YACE,MAAM,IAAI,iBAAQ,CAAC,8BAA8B,CAAC,CAAC;IACvD,CAAC;AACH,CAAC,CAAC;AAdW,QAAA,uBAAuB,2BAclC"}
@@ -1,4 +1,4 @@
1
1
  import { KryptosAlgorithm } from "@lindorm/kryptos";
2
2
  import { ShaAlgorithm } from "@lindorm/types";
3
- export declare const _calculateRsaOaepHash: (algorithm: KryptosAlgorithm) => ShaAlgorithm;
3
+ export declare const calculateRsaOaepHash: (algorithm: KryptosAlgorithm) => ShaAlgorithm;
4
4
  //# sourceMappingURL=calculate-rsa-oaep-hash.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"calculate-rsa-oaep-hash.d.ts","sourceRoot":"","sources":["../../../../src/utils/private/calculate/calculate-rsa-oaep-hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,eAAO,MAAM,qBAAqB,cAAe,gBAAgB,KAAG,YAmBnE,CAAC"}
1
+ {"version":3,"file":"calculate-rsa-oaep-hash.d.ts","sourceRoot":"","sources":["../../../../src/utils/private/calculate/calculate-rsa-oaep-hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,eAAO,MAAM,oBAAoB,cAAe,gBAAgB,KAAG,YAmBlE,CAAC"}
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports._calculateRsaOaepHash = void 0;
3
+ exports.calculateRsaOaepHash = void 0;
4
4
  const errors_1 = require("../../../errors");
5
- const _calculateRsaOaepHash = (algorithm) => {
5
+ const calculateRsaOaepHash = (algorithm) => {
6
6
  switch (algorithm) {
7
7
  case "RSA-OAEP":
8
8
  return "SHA1";
@@ -18,5 +18,5 @@ const _calculateRsaOaepHash = (algorithm) => {
18
18
  });
19
19
  }
20
20
  };
21
- exports._calculateRsaOaepHash = _calculateRsaOaepHash;
21
+ exports.calculateRsaOaepHash = calculateRsaOaepHash;
22
22
  //# sourceMappingURL=calculate-rsa-oaep-hash.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"calculate-rsa-oaep-hash.js","sourceRoot":"","sources":["../../../../src/utils/private/calculate/calculate-rsa-oaep-hash.ts"],"names":[],"mappings":";;;AAEA,4CAA2C;AAEpC,MAAM,qBAAqB,GAAG,CAAC,SAA2B,EAAgB,EAAE;IACjF,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,UAAU;YACb,OAAO,MAAM,CAAC;QAEhB,KAAK,cAAc;YACjB,OAAO,QAAQ,CAAC;QAElB,KAAK,cAAc;YACjB,OAAO,QAAQ,CAAC;QAElB,KAAK,cAAc;YACjB,OAAO,QAAQ,CAAC;QAElB;YACE,MAAM,IAAI,iBAAQ,CAAC,qCAAqC,EAAE;gBACxD,KAAK,EAAE,EAAE,SAAS,EAAE;aACrB,CAAC,CAAC;IACP,CAAC;AACH,CAAC,CAAC;AAnBW,QAAA,qBAAqB,yBAmBhC"}
1
+ {"version":3,"file":"calculate-rsa-oaep-hash.js","sourceRoot":"","sources":["../../../../src/utils/private/calculate/calculate-rsa-oaep-hash.ts"],"names":[],"mappings":";;;AAEA,4CAA2C;AAEpC,MAAM,oBAAoB,GAAG,CAAC,SAA2B,EAAgB,EAAE;IAChF,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,UAAU;YACb,OAAO,MAAM,CAAC;QAEhB,KAAK,cAAc;YACjB,OAAO,QAAQ,CAAC;QAElB,KAAK,cAAc;YACjB,OAAO,QAAQ,CAAC;QAElB,KAAK,cAAc;YACjB,OAAO,QAAQ,CAAC;QAElB;YACE,MAAM,IAAI,iBAAQ,CAAC,qCAAqC,EAAE;gBACxD,KAAK,EAAE,EAAE,SAAS,EAAE;aACrB,CAAC,CAAC;IACP,CAAC;AACH,CAAC,CAAC;AAnBW,QAAA,oBAAoB,wBAmB/B"}
@@ -1,3 +1,3 @@
1
1
  import { AesEncryptionData } from "../../types";
2
- export declare const _decodeAesString: (data: string) => AesEncryptionData;
2
+ export declare const decodeAesString: (data: string) => AesEncryptionData;
3
3
  //# sourceMappingURL=decode-aes-string.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"decode-aes-string.d.ts","sourceRoot":"","sources":["../../../src/utils/private/decode-aes-string.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAKhD,eAAO,MAAM,gBAAgB,SAAU,MAAM,KAAG,iBA6D/C,CAAC"}
1
+ {"version":3,"file":"decode-aes-string.d.ts","sourceRoot":"","sources":["../../../src/utils/private/decode-aes-string.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAKhD,eAAO,MAAM,eAAe,SAAU,MAAM,KAAG,iBAgE9C,CAAC"}
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports._decodeAesString = void 0;
3
+ exports.decodeAesString = void 0;
4
+ const format_1 = require("../../constants/private/format");
4
5
  const errors_1 = require("../../errors");
5
6
  const regex = /(?<key>[a-z0-9]+)=(?<value>.+)/g;
6
- const _decodeAesString = (data) => {
7
+ const decodeAesString = (data) => {
7
8
  const [_, enc, array, content] = data.split("$");
8
9
  const encryption = enc;
9
10
  const items = array.split(",");
@@ -17,25 +18,25 @@ const _decodeAesString = (data) => {
17
18
  }
18
19
  values[match.groups.key] = match.groups.value;
19
20
  }
20
- const { v, f, alg, iv, kid, tag, hks, p2c, p2s, pek, crv: curve, kty: keyType, x, y, } = values;
21
+ const { v, kid, alg, iv, tag, hks, p2c, p2s, pei, pek, pet, crv: curve, kty: keyType, x, y, } = values;
21
22
  const crv = curve;
22
- const format = f;
23
23
  const kty = keyType;
24
24
  return {
25
- authTag: Buffer.from(tag, format),
26
- content: Buffer.from(content, format),
25
+ authTag: Buffer.from(tag, format_1.B64U),
26
+ content: Buffer.from(content, format_1.B64U),
27
27
  encryption: encryption,
28
28
  algorithm: alg,
29
- format,
30
- hkdfSalt: hks ? Buffer.from(hks, format) : undefined,
31
- initialisationVector: Buffer.from(iv, format),
32
- keyId: Buffer.from(kid, format),
29
+ hkdfSalt: hks ? Buffer.from(hks, format_1.B64U) : undefined,
30
+ initialisationVector: Buffer.from(iv, format_1.B64U),
31
+ keyId: Buffer.from(kid, format_1.B64U),
33
32
  pbkdfIterations: p2c ? parseInt(p2c, 10) : undefined,
34
- pbkdfSalt: p2s ? Buffer.from(p2s, format) : undefined,
33
+ pbkdfSalt: p2s ? Buffer.from(p2s, format_1.B64U) : undefined,
35
34
  publicEncryptionJwk: crv && x && kty ? { crv, x, y, kty } : undefined,
36
- publicEncryptionKey: pek ? Buffer.from(pek, format) : undefined,
35
+ publicEncryptionIv: pei ? Buffer.from(pei, format_1.B64U) : undefined,
36
+ publicEncryptionKey: pek ? Buffer.from(pek, format_1.B64U) : undefined,
37
+ publicEncryptionTag: pet ? Buffer.from(pet, format_1.B64U) : undefined,
37
38
  version: parseInt(v, 10),
38
39
  };
39
40
  };
40
- exports._decodeAesString = _decodeAesString;
41
+ exports.decodeAesString = decodeAesString;
41
42
  //# sourceMappingURL=decode-aes-string.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"decode-aes-string.js","sourceRoot":"","sources":["../../../src/utils/private/decode-aes-string.ts"],"names":[],"mappings":";;;AAEA,yCAAwC;AAIxC,MAAM,KAAK,GAAG,iCAAiC,CAAC;AAEzC,MAAM,gBAAgB,GAAG,CAAC,IAAY,EAAqB,EAAE;IAClE,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAEjD,MAAM,UAAU,GAAG,GAAwB,CAAC;IAC5C,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC/B,MAAM,MAAM,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,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,aAAI,CAAC,CAAC,CAAC,CAAC,SAAS;QACnD,mBAAmB,EAAE,GAAG,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,SAAS;QACrE,kBAAkB,EAAE,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,aAAI,CAAC,CAAC,CAAC,CAAC,SAAS;QAC5D,mBAAmB,EAAE,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,aAAI,CAAC,CAAC,CAAC,CAAC,SAAS;QAC7D,mBAAmB,EAAE,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,aAAI,CAAC,CAAC,CAAC,CAAC,SAAS;QAC7D,OAAO,EAAE,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC;KACzB,CAAC;AACJ,CAAC,CAAC;AAhEW,QAAA,eAAe,mBAgE1B"}
@@ -1,4 +1,4 @@
1
1
  import { CreateCekOptions, CreateCekResult, DecryptCekOptions, DecryptCekResult } from "../../../types/private";
2
- export declare const _getDiffieHellmanKeyWrapEncryptionKey: ({ encryption, kryptos, }: CreateCekOptions) => CreateCekResult;
3
- export declare const _getDiffieHellmanKeyWrapDecryptionKey: ({ hkdfSalt, kryptos, publicEncryptionJwk, publicEncryptionKey, }: DecryptCekOptions) => DecryptCekResult;
2
+ export declare const getDiffieHellmanKeyWrapEncryptionKey: ({ encryption, kryptos, }: CreateCekOptions) => CreateCekResult;
3
+ export declare const getDiffieHellmanKeyWrapDecryptionKey: ({ hkdfSalt, kryptos, publicEncryptionJwk, publicEncryptionIv, publicEncryptionKey, publicEncryptionTag, }: DecryptCekOptions) => DecryptCekResult;
4
4
  //# sourceMappingURL=diffie-hellman-key-wrap.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"diffie-hellman-key-wrap.d.ts","sourceRoot":"","sources":["../../../../src/utils/private/diffie-hellman/diffie-hellman-key-wrap.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAOhC,eAAO,MAAM,qCAAqC,6BAG/C,gBAAgB,KAAG,eAuBrB,CAAC;AAEF,eAAO,MAAM,qCAAqC,qEAK/C,iBAAiB,KAAG,gBAoBtB,CAAC"}
1
+ {"version":3,"file":"diffie-hellman-key-wrap.d.ts","sourceRoot":"","sources":["../../../../src/utils/private/diffie-hellman/diffie-hellman-key-wrap.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAOhC,eAAO,MAAM,oCAAoC,6BAG9C,gBAAgB,KAAG,eAyBrB,CAAC;AAEF,eAAO,MAAM,oCAAoC,8GAO9C,iBAAiB,KAAG,gBAoBtB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports._getDiffieHellmanKeyWrapDecryptionKey = exports._getDiffieHellmanKeyWrapEncryptionKey = void 0;
3
+ exports.getDiffieHellmanKeyWrapDecryptionKey = exports.getDiffieHellmanKeyWrapEncryptionKey = void 0;
4
4
  const crypto_1 = require("crypto");
5
5
  const errors_1 = require("../../../errors");
6
6
  const calculate_content_encryption_key_size_1 = require("../calculate/calculate-content-encryption-key-size");
@@ -8,15 +8,15 @@ const calculate_key_wrap_size_1 = require("../calculate/calculate-key-wrap-size"
8
8
  const hkdf_1 = require("../key-derivation/hkdf");
9
9
  const key_wrap_1 = require("../key-wrap/key-wrap");
10
10
  const shared_secret_1 = require("./shared-secret");
11
- const _getDiffieHellmanKeyWrapEncryptionKey = ({ encryption, kryptos, }) => {
12
- const { publicEncryptionJwk, sharedSecret } = (0, shared_secret_1._generateSharedSecret)(kryptos);
13
- const cekSize = (0, calculate_content_encryption_key_size_1._calculateContentEncryptionKeySize)(encryption);
11
+ const getDiffieHellmanKeyWrapEncryptionKey = ({ encryption, kryptos, }) => {
12
+ const { publicEncryptionJwk, sharedSecret } = (0, shared_secret_1.generateSharedSecret)(kryptos);
13
+ const cekSize = (0, calculate_content_encryption_key_size_1.calculateContentEncryptionKeySize)(encryption);
14
14
  const contentEncryptionKey = (0, crypto_1.randomBytes)(cekSize);
15
- const { derivedKey, hkdfSalt } = (0, hkdf_1._hkdf)({
15
+ const { derivedKey, hkdfSalt } = (0, hkdf_1.hkdf)({
16
16
  derivationKey: sharedSecret,
17
- keyLength: (0, calculate_key_wrap_size_1._calculateKeyWrapSize)(kryptos.algorithm),
17
+ keyLength: (0, calculate_key_wrap_size_1.calculateKeyWrapSize)(kryptos.algorithm),
18
18
  });
19
- const publicEncryptionKey = (0, key_wrap_1._aesKeyWrap)({
19
+ const { publicEncryptionKey, publicEncryptionIv, publicEncryptionTag } = (0, key_wrap_1.keyWrap)({
20
20
  contentEncryptionKey,
21
21
  kryptos,
22
22
  keyEncryptionKey: derivedKey,
@@ -26,25 +26,28 @@ const _getDiffieHellmanKeyWrapEncryptionKey = ({ encryption, kryptos, }) => {
26
26
  hkdfSalt,
27
27
  publicEncryptionJwk,
28
28
  publicEncryptionKey,
29
+ publicEncryptionIv,
30
+ publicEncryptionTag,
29
31
  };
30
32
  };
31
- exports._getDiffieHellmanKeyWrapEncryptionKey = _getDiffieHellmanKeyWrapEncryptionKey;
32
- const _getDiffieHellmanKeyWrapDecryptionKey = ({ hkdfSalt, kryptos, publicEncryptionJwk, publicEncryptionKey, }) => {
33
+ exports.getDiffieHellmanKeyWrapEncryptionKey = getDiffieHellmanKeyWrapEncryptionKey;
34
+ const getDiffieHellmanKeyWrapDecryptionKey = ({ hkdfSalt, kryptos, publicEncryptionJwk, publicEncryptionIv, publicEncryptionKey, publicEncryptionTag, }) => {
33
35
  if (!publicEncryptionKey) {
34
36
  throw new errors_1.AesError("Missing publicEncryptionKey");
35
37
  }
36
- const sharedSecret = (0, shared_secret_1._calculateSharedSecret)({ kryptos, publicEncryptionJwk });
37
- const { derivedKey } = (0, hkdf_1._hkdf)({
38
+ const sharedSecret = (0, shared_secret_1.calculateSharedSecret)({ kryptos, publicEncryptionJwk });
39
+ const { derivedKey } = (0, hkdf_1.hkdf)({
38
40
  derivationKey: sharedSecret,
39
41
  hkdfSalt,
40
- keyLength: (0, calculate_key_wrap_size_1._calculateKeyWrapSize)(kryptos.algorithm),
42
+ keyLength: (0, calculate_key_wrap_size_1.calculateKeyWrapSize)(kryptos.algorithm),
41
43
  });
42
- const unwrappedKey = (0, key_wrap_1._aesKeyUnwrap)({
44
+ return (0, key_wrap_1.keyUnwrap)({
43
45
  keyEncryptionKey: derivedKey,
44
46
  kryptos,
45
- wrappedKey: publicEncryptionKey,
47
+ publicEncryptionIv,
48
+ publicEncryptionKey,
49
+ publicEncryptionTag,
46
50
  });
47
- return { contentEncryptionKey: unwrappedKey };
48
51
  };
49
- exports._getDiffieHellmanKeyWrapDecryptionKey = _getDiffieHellmanKeyWrapDecryptionKey;
52
+ exports.getDiffieHellmanKeyWrapDecryptionKey = getDiffieHellmanKeyWrapDecryptionKey;
50
53
  //# sourceMappingURL=diffie-hellman-key-wrap.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"diffie-hellman-key-wrap.js","sourceRoot":"","sources":["../../../../src/utils/private/diffie-hellman/diffie-hellman-key-wrap.ts"],"names":[],"mappings":";;;AAAA,mCAAqC;AACrC,4CAA2C;AAO3C,8GAAwG;AACxG,kFAA6E;AAC7E,iDAA+C;AAC/C,mDAAkE;AAClE,mDAAgF;AAEzE,MAAM,qCAAqC,GAAG,CAAC,EACpD,UAAU,EACV,OAAO,GACU,EAAmB,EAAE;IACtC,MAAM,EAAE,mBAAmB,EAAE,YAAY,EAAE,GAAG,IAAA,qCAAqB,EAAC,OAAO,CAAC,CAAC;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CAyBhD"}
1
+ {"version":3,"file":"diffie-hellman-key-wrap.js","sourceRoot":"","sources":["../../../../src/utils/private/diffie-hellman/diffie-hellman-key-wrap.ts"],"names":[],"mappings":";;;AAAA,mCAAqC;AACrC,4CAA2C;AAO3C,8GAAuG;AACvG,kFAA4E;AAC5E,iDAA8C;AAC9C,mDAA0D;AAC1D,mDAA8E;AAEvE,MAAM,oCAAoC,GAAG,CAAC,EACnD,UAAU,EACV,OAAO,GACU,EAAmB,EAAE;IACtC,MAAM,EAAE,mBAAmB,EAAE,YAAY,EAAE,GAAG,IAAA,oCAAoB,EAAC,OAAO,CAAC,CAAC;IAE5E,MAAM,OAAO,GAAG,IAAA,yEAAiC,EAAC,UAAU,CAAC,CAAC;IAC9D,MAAM,oBAAoB,GAAG,IAAA,oBAAW,EAAC,OAAO,CAAC,CAAC;IAElD,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,IAAA,WAAI,EAAC;QACpC,aAAa,EAAE,YAAY;QAC3B,SAAS,EAAE,IAAA,8CAAoB,EAAC,OAAO,CAAC,SAAS,CAAC;KACnD,CAAC,CAAC;IAEH,MAAM,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,GAAG,IAAA,kBAAO,EAAC;QAC/E,oBAAoB;QACpB,OAAO;QACP,gBAAgB,EAAE,UAAU;KAC7B,CAAC,CAAC;IAEH,OAAO;QACL,oBAAoB;QACpB,QAAQ;QACR,mBAAmB;QACnB,mBAAmB;QACnB,kBAAkB;QAClB,mBAAmB;KACpB,CAAC;AACJ,CAAC,CAAC;AA5BW,QAAA,oCAAoC,wCA4B/C;AAEK,MAAM,oCAAoC,GAAG,CAAC,EACnD,QAAQ,EACR,OAAO,EACP,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,GACD,EAAoB,EAAE;IACxC,IAAI,CAAC,mBAAmB,EAAE,CAAC;QACzB,MAAM,IAAI,iBAAQ,CAAC,6BAA6B,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,YAAY,GAAG,IAAA,qCAAqB,EAAC,EAAE,OAAO,EAAE,mBAAmB,EAAE,CAAC,CAAC;IAE7E,MAAM,EAAE,UAAU,EAAE,GAAG,IAAA,WAAI,EAAC;QAC1B,aAAa,EAAE,YAAY;QAC3B,QAAQ;QACR,SAAS,EAAE,IAAA,8CAAoB,EAAC,OAAO,CAAC,SAAS,CAAC;KACnD,CAAC,CAAC;IAEH,OAAO,IAAA,oBAAS,EAAC;QACf,gBAAgB,EAAE,UAAU;QAC5B,OAAO;QACP,kBAAkB;QAClB,mBAAmB;QACnB,mBAAmB;KACpB,CAAC,CAAC;AACL,CAAC,CAAC;AA3BW,QAAA,oCAAoC,wCA2B/C"}
@@ -1,4 +1,4 @@
1
1
  import { CreateCekOptions, CreateCekResult, DecryptCekOptions, DecryptCekResult } from "../../../types/private";
2
- export declare const _getDiffieHellmanEncryptionKey: ({ encryption, kryptos, }: CreateCekOptions) => CreateCekResult;
3
- export declare const _getDiffieHellmanDecryptionKey: ({ encryption, hkdfSalt, kryptos, publicEncryptionJwk, }: DecryptCekOptions) => DecryptCekResult;
2
+ export declare const getDiffieHellmanEncryptionKey: ({ encryption, kryptos, }: CreateCekOptions) => CreateCekResult;
3
+ export declare const getDiffieHellmanDecryptionKey: ({ encryption, hkdfSalt, kryptos, publicEncryptionJwk, }: DecryptCekOptions) => DecryptCekResult;
4
4
  //# sourceMappingURL=diffie-hellman.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"diffie-hellman.d.ts","sourceRoot":"","sources":["../../../../src/utils/private/diffie-hellman/diffie-hellman.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAKhC,eAAO,MAAM,8BAA8B,6BAGxC,gBAAgB,KAAG,eAcrB,CAAC;AAEF,eAAO,MAAM,8BAA8B,4DAKxC,iBAAiB,KAAG,gBAkBtB,CAAC"}
1
+ {"version":3,"file":"diffie-hellman.d.ts","sourceRoot":"","sources":["../../../../src/utils/private/diffie-hellman/diffie-hellman.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAKhC,eAAO,MAAM,6BAA6B,6BAGvC,gBAAgB,KAAG,eAcrB,CAAC;AAEF,eAAO,MAAM,6BAA6B,4DAKvC,iBAAiB,KAAG,gBAkBtB,CAAC"}