@batalabs/virlow-crypto 3.79.0 → 3.81.0

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.
@@ -0,0 +1,40 @@
1
+ /**
2
+ * One place for the attachment format, shared by the web app and mcp-core so
3
+ * a file written by either opens in the other, and so a future format change
4
+ * (the key envelope) is made once.
5
+ *
6
+ * The format is the one the web app has always written: the file is a note
7
+ * whose title is the filename and whose content is the base64 of the bytes.
8
+ * `encryptedData` is "v2:<ivB64>:<ciphertextB64>" with its own IV; `iv` is
9
+ * the filename's IV, stored in the row's iv column.
10
+ */
11
+ export declare const LEGACY_ATTACHMENT_MESSAGE = "This file uses an older format. Open it in the Virlow app.";
12
+ /** v1 content shares the column IV with the filename and is only readable by
13
+ * the web app's inline fallback, which can still derive the legacy key. */
14
+ export declare class LegacyAttachmentError extends Error {
15
+ constructor();
16
+ }
17
+ export interface EncryptedAttachment {
18
+ encryptedTitle: string;
19
+ /** "v2:<ivB64>:<ciphertextB64>" */
20
+ encryptedData: string;
21
+ /** IV of encryptedTitle (the row's iv column). */
22
+ iv: string;
23
+ }
24
+ /** base64 never contains ':', so the prefix is unambiguous. */
25
+ export declare function isV2Attachment(encryptedData: string): boolean;
26
+ export declare function encryptAttachment(key: CryptoKey, filename: string, bytes: Uint8Array | ArrayBuffer): Promise<EncryptedAttachment>;
27
+ /**
28
+ * A new encrypted filename under a fresh IV, for a rename. Safe only for v2
29
+ * content, which carries its own IV; the API refuses it for anything else.
30
+ */
31
+ export declare function encryptAttachmentName(key: CryptoKey, filename: string): Promise<{
32
+ encryptedTitle: string;
33
+ iv: string;
34
+ }>;
35
+ export declare function decryptAttachmentData(key: CryptoKey, encryptedData: string): Promise<Uint8Array>;
36
+ export declare function decryptAttachment(key: CryptoKey, enc: EncryptedAttachment): Promise<{
37
+ filename: string;
38
+ bytes: Uint8Array;
39
+ }>;
40
+ //# sourceMappingURL=attachments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachments.d.ts","sourceRoot":"","sources":["../src/attachments.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAEH,eAAO,MAAM,yBAAyB,+DAA+D,CAAC;AAEtG;2EAC2E;AAC3E,qBAAa,qBAAsB,SAAQ,KAAK;;CAK/C;AAED,MAAM,WAAW,mBAAmB;IAClC,cAAc,EAAE,MAAM,CAAC;IACvB,mCAAmC;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,kDAAkD;IAClD,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,+DAA+D;AAC/D,wBAAgB,cAAc,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,SAAS,EACd,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,UAAU,GAAG,WAAW,GAC9B,OAAO,CAAC,mBAAmB,CAAC,CAG9B;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,SAAS,EACd,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;IAAE,cAAc,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,CAQjD;AAED,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CActG;AAED,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,SAAS,EACd,GAAG,EAAE,mBAAmB,GACvB,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,UAAU,CAAA;CAAE,CAAC,CAMlD"}
@@ -0,0 +1,59 @@
1
+ import { base64ToArrayBuffer, base64ToBytes, bytesToBase64 } from './base64.js';
2
+ import { ENCRYPTION_CONFIG } from './constants.js';
3
+ import { decryptTitleField, encryptNoteFields } from './notes.js';
4
+ /**
5
+ * One place for the attachment format, shared by the web app and mcp-core so
6
+ * a file written by either opens in the other, and so a future format change
7
+ * (the key envelope) is made once.
8
+ *
9
+ * The format is the one the web app has always written: the file is a note
10
+ * whose title is the filename and whose content is the base64 of the bytes.
11
+ * `encryptedData` is "v2:<ivB64>:<ciphertextB64>" with its own IV; `iv` is
12
+ * the filename's IV, stored in the row's iv column.
13
+ */
14
+ export const LEGACY_ATTACHMENT_MESSAGE = 'This file uses an older format. Open it in the Virlow app.';
15
+ /** v1 content shares the column IV with the filename and is only readable by
16
+ * the web app's inline fallback, which can still derive the legacy key. */
17
+ export class LegacyAttachmentError extends Error {
18
+ constructor() {
19
+ super(LEGACY_ATTACHMENT_MESSAGE);
20
+ this.name = 'LegacyAttachmentError';
21
+ }
22
+ }
23
+ /** base64 never contains ':', so the prefix is unambiguous. */
24
+ export function isV2Attachment(encryptedData) {
25
+ return encryptedData.startsWith('v2:');
26
+ }
27
+ export async function encryptAttachment(key, filename, bytes) {
28
+ const fields = await encryptNoteFields(key, filename, bytesToBase64(bytes));
29
+ return { encryptedTitle: fields.encryptedTitle, encryptedData: fields.encryptedContent, iv: fields.iv };
30
+ }
31
+ /**
32
+ * A new encrypted filename under a fresh IV, for a rename. Safe only for v2
33
+ * content, which carries its own IV; the API refuses it for anything else.
34
+ */
35
+ export async function encryptAttachmentName(key, filename) {
36
+ const iv = crypto.getRandomValues(new Uint8Array(ENCRYPTION_CONFIG.IV_LENGTH));
37
+ const ciphertext = await crypto.subtle.encrypt({ name: ENCRYPTION_CONFIG.ALGORITHM, iv }, key, new TextEncoder().encode(filename));
38
+ return { encryptedTitle: bytesToBase64(ciphertext), iv: bytesToBase64(iv) };
39
+ }
40
+ export async function decryptAttachmentData(key, encryptedData) {
41
+ if (!isV2Attachment(encryptedData))
42
+ throw new LegacyAttachmentError();
43
+ const rest = encryptedData.slice(3);
44
+ const sep = rest.indexOf(':');
45
+ if (sep === -1) {
46
+ throw new Error('Malformed attachment ciphertext: missing the IV separator');
47
+ }
48
+ const iv = base64ToBytes(rest.slice(0, sep));
49
+ const plain = await crypto.subtle.decrypt({ name: ENCRYPTION_CONFIG.ALGORITHM, iv: iv }, key, base64ToArrayBuffer(rest.slice(sep + 1)));
50
+ return base64ToBytes(new TextDecoder().decode(plain));
51
+ }
52
+ export async function decryptAttachment(key, enc) {
53
+ // Content first: a legacy file fails with the clear message, not a GCM error
54
+ // from its placeholder title.
55
+ const bytes = await decryptAttachmentData(key, enc.encryptedData);
56
+ const filename = await decryptTitleField(key, enc.encryptedTitle, enc.iv);
57
+ return { filename, bytes };
58
+ }
59
+ //# sourceMappingURL=attachments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachments.js","sourceRoot":"","sources":["../src/attachments.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * One place for the attachment format, shared by the web app and mcp-core so
3
+ * a file written by either opens in the other, and so a future format change
4
+ * (the key envelope) is made once.
5
+ *
6
+ * The format is the one the web app has always written: the file is a note
7
+ * whose title is the filename and whose content is the base64 of the bytes.
8
+ * `encryptedData` is "v2:<ivB64>:<ciphertextB64>" with its own IV; `iv` is
9
+ * the filename's IV, stored in the row's iv column.
10
+ */
11
+ export declare const LEGACY_ATTACHMENT_MESSAGE = "This file uses an older format. Open it in the Virlow app.";
12
+ /** v1 content shares the column IV with the filename and is only readable by
13
+ * the web app's inline fallback, which can still derive the legacy key. */
14
+ export declare class LegacyAttachmentError extends Error {
15
+ constructor();
16
+ }
17
+ export interface EncryptedAttachment {
18
+ encryptedTitle: string;
19
+ /** "v2:<ivB64>:<ciphertextB64>" */
20
+ encryptedData: string;
21
+ /** IV of encryptedTitle (the row's iv column). */
22
+ iv: string;
23
+ }
24
+ /** base64 never contains ':', so the prefix is unambiguous. */
25
+ export declare function isV2Attachment(encryptedData: string): boolean;
26
+ export declare function encryptAttachment(key: CryptoKey, filename: string, bytes: Uint8Array | ArrayBuffer): Promise<EncryptedAttachment>;
27
+ /**
28
+ * A new encrypted filename under a fresh IV, for a rename. Safe only for v2
29
+ * content, which carries its own IV; the API refuses it for anything else.
30
+ */
31
+ export declare function encryptAttachmentName(key: CryptoKey, filename: string): Promise<{
32
+ encryptedTitle: string;
33
+ iv: string;
34
+ }>;
35
+ export declare function decryptAttachmentData(key: CryptoKey, encryptedData: string): Promise<Uint8Array>;
36
+ export declare function decryptAttachment(key: CryptoKey, enc: EncryptedAttachment): Promise<{
37
+ filename: string;
38
+ bytes: Uint8Array;
39
+ }>;
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LegacyAttachmentError = exports.LEGACY_ATTACHMENT_MESSAGE = void 0;
4
+ exports.isV2Attachment = isV2Attachment;
5
+ exports.encryptAttachment = encryptAttachment;
6
+ exports.encryptAttachmentName = encryptAttachmentName;
7
+ exports.decryptAttachmentData = decryptAttachmentData;
8
+ exports.decryptAttachment = decryptAttachment;
9
+ const base64_js_1 = require("./base64.js");
10
+ const constants_js_1 = require("./constants.js");
11
+ const notes_js_1 = require("./notes.js");
12
+ /**
13
+ * One place for the attachment format, shared by the web app and mcp-core so
14
+ * a file written by either opens in the other, and so a future format change
15
+ * (the key envelope) is made once.
16
+ *
17
+ * The format is the one the web app has always written: the file is a note
18
+ * whose title is the filename and whose content is the base64 of the bytes.
19
+ * `encryptedData` is "v2:<ivB64>:<ciphertextB64>" with its own IV; `iv` is
20
+ * the filename's IV, stored in the row's iv column.
21
+ */
22
+ exports.LEGACY_ATTACHMENT_MESSAGE = 'This file uses an older format. Open it in the Virlow app.';
23
+ /** v1 content shares the column IV with the filename and is only readable by
24
+ * the web app's inline fallback, which can still derive the legacy key. */
25
+ class LegacyAttachmentError extends Error {
26
+ constructor() {
27
+ super(exports.LEGACY_ATTACHMENT_MESSAGE);
28
+ this.name = 'LegacyAttachmentError';
29
+ }
30
+ }
31
+ exports.LegacyAttachmentError = LegacyAttachmentError;
32
+ /** base64 never contains ':', so the prefix is unambiguous. */
33
+ function isV2Attachment(encryptedData) {
34
+ return encryptedData.startsWith('v2:');
35
+ }
36
+ async function encryptAttachment(key, filename, bytes) {
37
+ const fields = await (0, notes_js_1.encryptNoteFields)(key, filename, (0, base64_js_1.bytesToBase64)(bytes));
38
+ return { encryptedTitle: fields.encryptedTitle, encryptedData: fields.encryptedContent, iv: fields.iv };
39
+ }
40
+ /**
41
+ * A new encrypted filename under a fresh IV, for a rename. Safe only for v2
42
+ * content, which carries its own IV; the API refuses it for anything else.
43
+ */
44
+ async function encryptAttachmentName(key, filename) {
45
+ const iv = crypto.getRandomValues(new Uint8Array(constants_js_1.ENCRYPTION_CONFIG.IV_LENGTH));
46
+ const ciphertext = await crypto.subtle.encrypt({ name: constants_js_1.ENCRYPTION_CONFIG.ALGORITHM, iv }, key, new TextEncoder().encode(filename));
47
+ return { encryptedTitle: (0, base64_js_1.bytesToBase64)(ciphertext), iv: (0, base64_js_1.bytesToBase64)(iv) };
48
+ }
49
+ async function decryptAttachmentData(key, encryptedData) {
50
+ if (!isV2Attachment(encryptedData))
51
+ throw new LegacyAttachmentError();
52
+ const rest = encryptedData.slice(3);
53
+ const sep = rest.indexOf(':');
54
+ if (sep === -1) {
55
+ throw new Error('Malformed attachment ciphertext: missing the IV separator');
56
+ }
57
+ const iv = (0, base64_js_1.base64ToBytes)(rest.slice(0, sep));
58
+ const plain = await crypto.subtle.decrypt({ name: constants_js_1.ENCRYPTION_CONFIG.ALGORITHM, iv: iv }, key, (0, base64_js_1.base64ToArrayBuffer)(rest.slice(sep + 1)));
59
+ return (0, base64_js_1.base64ToBytes)(new TextDecoder().decode(plain));
60
+ }
61
+ async function decryptAttachment(key, enc) {
62
+ // Content first: a legacy file fails with the clear message, not a GCM error
63
+ // from its placeholder title.
64
+ const bytes = await decryptAttachmentData(key, enc.encryptedData);
65
+ const filename = await (0, notes_js_1.decryptTitleField)(key, enc.encryptedTitle, enc.iv);
66
+ return { filename, bytes };
67
+ }
@@ -3,5 +3,6 @@ export { decryptBytesBlob, decryptStringBlob, encryptBytesBlob, encryptStringBlo
3
3
  export { ENCRYPTION_CONFIG, VERIFIER_CONSTANT } from './constants.js';
4
4
  export { deriveMasterKey, importMasterKey } from './keys.js';
5
5
  export { decryptNoteFields, decryptTitleField, encryptNoteFields, type EncryptedNoteFields, } from './notes.js';
6
+ export { LEGACY_ATTACHMENT_MESSAGE, LegacyAttachmentError, decryptAttachment, decryptAttachmentData, encryptAttachment, encryptAttachmentName, isV2Attachment, type EncryptedAttachment, } from './attachments.js';
6
7
  export { canDecryptWithKey, createVerifierBlob, verifyVerifierBlob, type VerifierBlob, } from './verifier.js';
7
8
  export declare const PACKAGE_NAME = "@batalabs/virlow-crypto";
package/dist/cjs/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PACKAGE_NAME = exports.verifyVerifierBlob = exports.createVerifierBlob = exports.canDecryptWithKey = exports.encryptNoteFields = exports.decryptTitleField = exports.decryptNoteFields = exports.importMasterKey = exports.deriveMasterKey = exports.VERIFIER_CONSTANT = exports.ENCRYPTION_CONFIG = exports.encryptStringBlob = exports.encryptBytesBlob = exports.decryptStringBlob = exports.decryptBytesBlob = exports.bytesToBase64 = exports.base64ToBytes = exports.base64ToArrayBuffer = void 0;
3
+ exports.PACKAGE_NAME = exports.verifyVerifierBlob = exports.createVerifierBlob = exports.canDecryptWithKey = exports.isV2Attachment = exports.encryptAttachmentName = exports.encryptAttachment = exports.decryptAttachmentData = exports.decryptAttachment = exports.LegacyAttachmentError = exports.LEGACY_ATTACHMENT_MESSAGE = exports.encryptNoteFields = exports.decryptTitleField = exports.decryptNoteFields = exports.importMasterKey = exports.deriveMasterKey = exports.VERIFIER_CONSTANT = exports.ENCRYPTION_CONFIG = exports.encryptStringBlob = exports.encryptBytesBlob = exports.decryptStringBlob = exports.decryptBytesBlob = exports.bytesToBase64 = exports.base64ToBytes = exports.base64ToArrayBuffer = void 0;
4
4
  var base64_js_1 = require("./base64.js");
5
5
  Object.defineProperty(exports, "base64ToArrayBuffer", { enumerable: true, get: function () { return base64_js_1.base64ToArrayBuffer; } });
6
6
  Object.defineProperty(exports, "base64ToBytes", { enumerable: true, get: function () { return base64_js_1.base64ToBytes; } });
@@ -20,6 +20,14 @@ var notes_js_1 = require("./notes.js");
20
20
  Object.defineProperty(exports, "decryptNoteFields", { enumerable: true, get: function () { return notes_js_1.decryptNoteFields; } });
21
21
  Object.defineProperty(exports, "decryptTitleField", { enumerable: true, get: function () { return notes_js_1.decryptTitleField; } });
22
22
  Object.defineProperty(exports, "encryptNoteFields", { enumerable: true, get: function () { return notes_js_1.encryptNoteFields; } });
23
+ var attachments_js_1 = require("./attachments.js");
24
+ Object.defineProperty(exports, "LEGACY_ATTACHMENT_MESSAGE", { enumerable: true, get: function () { return attachments_js_1.LEGACY_ATTACHMENT_MESSAGE; } });
25
+ Object.defineProperty(exports, "LegacyAttachmentError", { enumerable: true, get: function () { return attachments_js_1.LegacyAttachmentError; } });
26
+ Object.defineProperty(exports, "decryptAttachment", { enumerable: true, get: function () { return attachments_js_1.decryptAttachment; } });
27
+ Object.defineProperty(exports, "decryptAttachmentData", { enumerable: true, get: function () { return attachments_js_1.decryptAttachmentData; } });
28
+ Object.defineProperty(exports, "encryptAttachment", { enumerable: true, get: function () { return attachments_js_1.encryptAttachment; } });
29
+ Object.defineProperty(exports, "encryptAttachmentName", { enumerable: true, get: function () { return attachments_js_1.encryptAttachmentName; } });
30
+ Object.defineProperty(exports, "isV2Attachment", { enumerable: true, get: function () { return attachments_js_1.isV2Attachment; } });
23
31
  var verifier_js_1 = require("./verifier.js");
24
32
  Object.defineProperty(exports, "canDecryptWithKey", { enumerable: true, get: function () { return verifier_js_1.canDecryptWithKey; } });
25
33
  Object.defineProperty(exports, "createVerifierBlob", { enumerable: true, get: function () { return verifier_js_1.createVerifierBlob; } });
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export { decryptBytesBlob, decryptStringBlob, encryptBytesBlob, encryptStringBlo
3
3
  export { ENCRYPTION_CONFIG, VERIFIER_CONSTANT } from './constants.js';
4
4
  export { deriveMasterKey, importMasterKey } from './keys.js';
5
5
  export { decryptNoteFields, decryptTitleField, encryptNoteFields, type EncryptedNoteFields, } from './notes.js';
6
+ export { LEGACY_ATTACHMENT_MESSAGE, LegacyAttachmentError, decryptAttachment, decryptAttachmentData, encryptAttachment, encryptAttachmentName, isV2Attachment, type EncryptedAttachment, } from './attachments.js';
6
7
  export { canDecryptWithKey, createVerifierBlob, verifyVerifierBlob, type VerifierBlob, } from './verifier.js';
7
8
  export declare const PACKAGE_NAME = "@batalabs/virlow-crypto";
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,KAAK,mBAAmB,GACzB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,YAAY,GAClB,MAAM,eAAe,CAAC;AACvB,eAAO,MAAM,YAAY,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,KAAK,mBAAmB,GACzB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,KAAK,mBAAmB,GACzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,YAAY,GAClB,MAAM,eAAe,CAAC;AACvB,eAAO,MAAM,YAAY,4BAA4B,CAAC"}
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@ export { decryptBytesBlob, decryptStringBlob, encryptBytesBlob, encryptStringBlo
3
3
  export { ENCRYPTION_CONFIG, VERIFIER_CONSTANT } from './constants.js';
4
4
  export { deriveMasterKey, importMasterKey } from './keys.js';
5
5
  export { decryptNoteFields, decryptTitleField, encryptNoteFields, } from './notes.js';
6
+ export { LEGACY_ATTACHMENT_MESSAGE, LegacyAttachmentError, decryptAttachment, decryptAttachmentData, encryptAttachment, encryptAttachmentName, isV2Attachment, } from './attachments.js';
6
7
  export { canDecryptWithKey, createVerifierBlob, verifyVerifierBlob, } from './verifier.js';
7
8
  export const PACKAGE_NAME = '@batalabs/virlow-crypto';
8
9
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,GAElB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,GAEnB,MAAM,eAAe,CAAC;AACvB,MAAM,CAAC,MAAM,YAAY,GAAG,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,GAElB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,GAEf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,GAEnB,MAAM,eAAe,CAAC;AACvB,MAAM,CAAC,MAAM,YAAY,GAAG,yBAAyB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@batalabs/virlow-crypto",
3
- "version": "3.79.0",
3
+ "version": "3.81.0",
4
4
  "type": "module",
5
5
  "description": "Virlow client-side encryption primitives (PBKDF2 + AES-256-GCM). Framework-free; browser and Node 20+.",
6
6
  "license": "UNLICENSED",