@inco/js 0.8.0-devnet-26 → 0.8.0-devnet-28

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 (29) hide show
  1. package/README.md +26 -6
  2. package/dist/cjs/generated/es/inco/covalidator/compute/v1/server_pb.js +1 -1
  3. package/dist/cjs/generated/es/inco/covalidator/compute/v1/types_pb.js +1 -1
  4. package/dist/cjs/generated/es/inco/helioswrapper/v1/helioswrapper_pb.js +1 -1
  5. package/dist/cjs/generated/es/inco/kms/lite/v1/kms_service_pb.js +1 -1
  6. package/dist/cjs/generated/es/inco/kms/lite/v1/types_pb.js +1 -1
  7. package/dist/cjs/generated/es/inco/sealingfetcher/v1/sealingfetcher_pb.js +1 -1
  8. package/dist/cjs/lite/index.d.ts +2 -0
  9. package/dist/cjs/lite/index.js +4 -2
  10. package/dist/cjs/lite/lightning.d.ts +2 -2
  11. package/dist/cjs/lite/lightning.js +2 -2
  12. package/dist/cjs/lite/xwing.d.ts +2 -2
  13. package/dist/cjs/lite/xwing.js +2 -2
  14. package/dist/esm/generated/es/inco/covalidator/compute/v1/server_pb.js +1 -1
  15. package/dist/esm/generated/es/inco/covalidator/compute/v1/types_pb.js +1 -1
  16. package/dist/esm/generated/es/inco/helioswrapper/v1/helioswrapper_pb.js +1 -1
  17. package/dist/esm/generated/es/inco/kms/lite/v1/kms_service_pb.js +1 -1
  18. package/dist/esm/generated/es/inco/kms/lite/v1/types_pb.js +1 -1
  19. package/dist/esm/generated/es/inco/sealingfetcher/v1/sealingfetcher_pb.js +1 -1
  20. package/dist/esm/lite/index.d.ts +2 -0
  21. package/dist/esm/lite/index.js +2 -1
  22. package/dist/esm/lite/lightning.d.ts +2 -2
  23. package/dist/esm/lite/lightning.js +2 -2
  24. package/dist/esm/lite/xwing.d.ts +2 -2
  25. package/dist/esm/lite/xwing.js +2 -2
  26. package/dist/types/lite/index.d.ts +2 -0
  27. package/dist/types/lite/lightning.d.ts +2 -2
  28. package/dist/types/lite/xwing.d.ts +2 -2
  29. package/package.json +2 -2
package/README.md CHANGED
@@ -150,6 +150,8 @@ Requests attested decryption of one or more handles. Only handles approved via `
150
150
  **Three calling modes:**
151
151
 
152
152
  ```ts
153
+ import { generateXwingKeypair } from "@inco/js/lite";
154
+
153
155
  // Mode 1: Plaintext result (auto-generates ephemeral keypair internally)
154
156
  const attestations = await zap.attestedDecrypt(walletClient, [handle]);
155
157
  attestations[0].plaintext.value; // The decrypted value
@@ -163,12 +165,11 @@ const encrypted = await zap.attestedDecrypt(
163
165
  encrypted[0].encryptedPlaintext.ciphertext.value;
164
166
 
165
167
  // Mode 3: Reencrypt and decrypt locally
166
- const decrypted = await zap.attestedDecrypt(
167
- walletClient,
168
- [handle],
169
- keypair.encodePublicKey(),
170
- keypair,
171
- );
168
+ const keypair = await generateXwingKeypair();
169
+ const decrypted = await zap.attestedDecrypt(walletClient, [handle], {
170
+ reencryptPubKey: keypair.encodePublicKey(),
171
+ reencryptKeypair: keypair,
172
+ });
172
173
  decrypted[0].plaintext.value;
173
174
  ```
174
175
 
@@ -431,6 +432,25 @@ const deployment = getActiveLightningDeployment("baseSepolia");
431
432
  const deployments = getLightningDeployments(84532);
432
433
  ```
433
434
 
435
+ #### X-Wing Keypair (`@inco/js/lite`)
436
+
437
+ Generate an ephemeral X-Wing keypair for local reencryption (Mode 3 of `attestedDecrypt` and `attestedCompute`):
438
+
439
+ ```ts
440
+ import { generateXwingKeypair, type XwingKeypair } from "@inco/js/lite";
441
+
442
+ const keypair: XwingKeypair = await generateXwingKeypair();
443
+
444
+ // Pass the public key to the attested call and the keypair for local decryption
445
+ const decrypted = await zap.attestedDecrypt(walletClient, [handle], {
446
+ reencryptPubKey: keypair.encodePublicKey(),
447
+ reencryptKeypair: keypair,
448
+ });
449
+ decrypted[0].plaintext.value;
450
+ ```
451
+
452
+ X-Wing is a post-quantum hybrid KEM combining ML-KEM-768 and X25519. The generated keypair is ephemeral — generate a fresh one per request.
453
+
434
454
  ---
435
455
 
436
456
  ### Reencryption Module (`@inco/js/reencryption`)
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // @generated by protoc-gen-es v2.10.0 with parameter "target=ts"
2
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts"
3
3
  // @generated from file inco/covalidator/compute/v1/server.proto (package inco.covalidator.compute.v1, syntax proto3)
4
4
  /* eslint-disable */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // @generated by protoc-gen-es v2.10.0 with parameter "target=ts"
2
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts"
3
3
  // @generated from file inco/covalidator/compute/v1/types.proto (package inco.covalidator.compute.v1, syntax proto3)
4
4
  /* eslint-disable */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // @generated by protoc-gen-es v2.10.0 with parameter "target=ts"
2
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts"
3
3
  // @generated from file inco/helioswrapper/v1/helioswrapper.proto (package inco.helioswrapper.v1, syntax proto3)
4
4
  /* eslint-disable */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // @generated by protoc-gen-es v2.10.0 with parameter "target=ts"
2
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts"
3
3
  // @generated from file inco/kms/lite/v1/kms_service.proto (package inco.kms.lite.v1, syntax proto3)
4
4
  /* eslint-disable */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // @generated by protoc-gen-es v2.10.0 with parameter "target=ts"
2
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts"
3
3
  // @generated from file inco/kms/lite/v1/types.proto (package inco.kms.lite.v1, syntax proto3)
4
4
  /* eslint-disable */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // @generated by protoc-gen-es v2.10.0 with parameter "target=ts"
2
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts"
3
3
  // @generated from file inco/sealingfetcher/v1/sealingfetcher.proto (package inco.sealingfetcher.v1, syntax proto3)
4
4
  /* eslint-disable */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -9,3 +9,5 @@ export * from './attested-decrypt.js';
9
9
  export * from './deployments.js';
10
10
  export * from './lightning.js';
11
11
  export type { AttestedOpts, AttestedOptsDecrypted, AttestedOptsEncrypted, AttestedOptsEphemeral, AttestedRevealOpts, AttestedWithVoucherOpts, AttestedWithVoucherOptsDecrypted, AttestedWithVoucherOptsEncrypted, AttestedWithVoucherOptsEphemeral, } from './types.js';
12
+ export { generateXwingKeypair } from './xwing.js';
13
+ export type { XwingKeypair } from './xwing.js';
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.AttestedRevealError = exports.AttestedDecryptError = exports.AttestedComputeError = void 0;
17
+ exports.generateXwingKeypair = exports.AttestedRevealError = exports.AttestedDecryptError = exports.AttestedComputeError = void 0;
18
18
  var types_js_1 = require("../attestedcompute/types.js");
19
19
  Object.defineProperty(exports, "AttestedComputeError", { enumerable: true, get: function () { return types_js_1.AttestedComputeError; } });
20
20
  var types_js_2 = require("../attesteddecrypt/types.js");
@@ -26,4 +26,6 @@ __exportStar(require("./attested-compute.js"), exports);
26
26
  __exportStar(require("./attested-decrypt.js"), exports);
27
27
  __exportStar(require("./deployments.js"), exports);
28
28
  __exportStar(require("./lightning.js"), exports);
29
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbGl0ZS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLHdEQUFtRTtBQUExRCxnSEFBQSxvQkFBb0IsT0FBQTtBQUM3Qix3REFBbUU7QUFBMUQsZ0hBQUEsb0JBQW9CLE9BQUE7QUFDN0IsdURBQWlFO0FBQXhELCtHQUFBLG1CQUFtQixPQUFBO0FBQzVCLGlFQUErQztBQU8vQyx3REFBc0M7QUFDdEMsd0RBQXNDO0FBQ3RDLG1EQUFpQztBQUNqQyxpREFBK0IifQ==
29
+ var xwing_js_1 = require("./xwing.js");
30
+ Object.defineProperty(exports, "generateXwingKeypair", { enumerable: true, get: function () { return xwing_js_1.generateXwingKeypair; } });
31
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbGl0ZS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLHdEQUFtRTtBQUExRCxnSEFBQSxvQkFBb0IsT0FBQTtBQUM3Qix3REFBbUU7QUFBMUQsZ0hBQUEsb0JBQW9CLE9BQUE7QUFDN0IsdURBQWlFO0FBQXhELCtHQUFBLG1CQUFtQixPQUFBO0FBQzVCLGlFQUErQztBQU8vQyx3REFBc0M7QUFDdEMsd0RBQXNDO0FBQ3RDLG1EQUFpQztBQUNqQyxpREFBK0I7QUFZL0IsdUNBQWtEO0FBQXpDLGdIQUFBLG9CQUFvQixPQUFBIn0=
@@ -66,7 +66,7 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
66
66
  private getEncryptor;
67
67
  /**
68
68
  * Get the encryption scheme version used by this Lightning instance.
69
- * Returns 1 for ECIES or 2 for X-Wing.
69
+ * Returns the X-Wing encryption scheme identifier.
70
70
  * This is a convenience method to get the encryption scheme used by this Lightning instance.
71
71
  */
72
72
  getEncryptionScheme(): Promise<EncryptionScheme>;
@@ -129,7 +129,7 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
129
129
  /** Returns a shallow copy of the deployment configuration this Lightning instance is bound to. */
130
130
  get deployment(): T;
131
131
  /**
132
- * Encrypt a value using the network's public key (ECIES or X-Wing).
132
+ * Encrypt a value using the network's public key (X-Wing).
133
133
  * The encryption scheme is automatically detected based on the public key length.
134
134
  *
135
135
  * @param value a boolean or numeric value to encrypt
@@ -71,7 +71,7 @@ class Lightning {
71
71
  }
72
72
  /**
73
73
  * Get the encryption scheme version used by this Lightning instance.
74
- * Returns 1 for ECIES or 2 for X-Wing.
74
+ * Returns the X-Wing encryption scheme identifier.
75
75
  * This is a convenience method to get the encryption scheme used by this Lightning instance.
76
76
  */
77
77
  async getEncryptionScheme() {
@@ -225,7 +225,7 @@ class Lightning {
225
225
  return { ...this._deployment };
226
226
  }
227
227
  /**
228
- * Encrypt a value using the network's public key (ECIES or X-Wing).
228
+ * Encrypt a value using the network's public key (X-Wing).
229
229
  * The encryption scheme is automatically detected based on the public key length.
230
230
  *
231
231
  * @param value a boolean or numeric value to encrypt
@@ -97,7 +97,7 @@ export type XwingDecryptorArgs = {
97
97
  /**
98
98
  * Encrypt using X-Wing HPKE (RFC 9180) with ChaCha20-Poly1305 AEAD.
99
99
  *
100
- * Output format: encappedKey (1184 bytes) || ciphertext (variable length)
100
+ * Output format: encappedKey (1120 bytes) || ciphertext (variable length)
101
101
  *
102
102
  * @param pubKeyA - Recipient's public key
103
103
  * @param msg - Message to encrypt
@@ -109,7 +109,7 @@ export declare function encrypt(pubKeyA: CryptoKey, msg: Uint8Array, aad?: Uint8
109
109
  /**
110
110
  * Decrypt using X-Wing HPKE (RFC 9180) with ChaCha20-Poly1305 AEAD.
111
111
  *
112
- * Input format: encappedKey (1184 bytes) || ciphertext (variable length)
112
+ * Input format: encappedKey (1120 bytes) || ciphertext (variable length)
113
113
  *
114
114
  * @param privKeyA - Recipient's private key
115
115
  * @param encryptedData - Encrypted data (encappedKey || ciphertext)
@@ -171,7 +171,7 @@ async function encodeXwingPublicKey(publicKey) {
171
171
  /**
172
172
  * Encrypt using X-Wing HPKE (RFC 9180) with ChaCha20-Poly1305 AEAD.
173
173
  *
174
- * Output format: encappedKey (1184 bytes) || ciphertext (variable length)
174
+ * Output format: encappedKey (1120 bytes) || ciphertext (variable length)
175
175
  *
176
176
  * @param pubKeyA - Recipient's public key
177
177
  * @param msg - Message to encrypt
@@ -203,7 +203,7 @@ async function encrypt(pubKeyA, msg, aad = new Uint8Array(0), info = new Uint8Ar
203
203
  /**
204
204
  * Decrypt using X-Wing HPKE (RFC 9180) with ChaCha20-Poly1305 AEAD.
205
205
  *
206
- * Input format: encappedKey (1184 bytes) || ciphertext (variable length)
206
+ * Input format: encappedKey (1120 bytes) || ciphertext (variable length)
207
207
  *
208
208
  * @param privKeyA - Recipient's private key
209
209
  * @param encryptedData - Encrypted data (encappedKey || ciphertext)
@@ -1,4 +1,4 @@
1
- // @generated by protoc-gen-es v2.10.0 with parameter "target=ts"
1
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts"
2
2
  // @generated from file inco/covalidator/compute/v1/server.proto (package inco.covalidator.compute.v1, syntax proto3)
3
3
  /* eslint-disable */
4
4
  import { enumDesc, fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2";
@@ -1,4 +1,4 @@
1
- // @generated by protoc-gen-es v2.10.0 with parameter "target=ts"
1
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts"
2
2
  // @generated from file inco/covalidator/compute/v1/types.proto (package inco.covalidator.compute.v1, syntax proto3)
3
3
  /* eslint-disable */
4
4
  import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2";
@@ -1,4 +1,4 @@
1
- // @generated by protoc-gen-es v2.10.0 with parameter "target=ts"
1
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts"
2
2
  // @generated from file inco/helioswrapper/v1/helioswrapper.proto (package inco.helioswrapper.v1, syntax proto3)
3
3
  /* eslint-disable */
4
4
  import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2";
@@ -1,4 +1,4 @@
1
- // @generated by protoc-gen-es v2.10.0 with parameter "target=ts"
1
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts"
2
2
  // @generated from file inco/kms/lite/v1/kms_service.proto (package inco.kms.lite.v1, syntax proto3)
3
3
  /* eslint-disable */
4
4
  import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2";
@@ -1,4 +1,4 @@
1
- // @generated by protoc-gen-es v2.10.0 with parameter "target=ts"
1
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts"
2
2
  // @generated from file inco/kms/lite/v1/types.proto (package inco.kms.lite.v1, syntax proto3)
3
3
  /* eslint-disable */
4
4
  import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2";
@@ -1,4 +1,4 @@
1
- // @generated by protoc-gen-es v2.10.0 with parameter "target=ts"
1
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts"
2
2
  // @generated from file inco/sealingfetcher/v1/sealingfetcher.proto (package inco.sealingfetcher.v1, syntax proto3)
3
3
  /* eslint-disable */
4
4
  import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2";
@@ -9,3 +9,5 @@ export * from './attested-decrypt.js';
9
9
  export * from './deployments.js';
10
10
  export * from './lightning.js';
11
11
  export type { AttestedOpts, AttestedOptsDecrypted, AttestedOptsEncrypted, AttestedOptsEphemeral, AttestedRevealOpts, AttestedWithVoucherOpts, AttestedWithVoucherOptsDecrypted, AttestedWithVoucherOptsEncrypted, AttestedWithVoucherOptsEphemeral, } from './types.js';
12
+ export { generateXwingKeypair } from './xwing.js';
13
+ export type { XwingKeypair } from './xwing.js';
@@ -6,4 +6,5 @@ export * from './attested-compute.js';
6
6
  export * from './attested-decrypt.js';
7
7
  export * from './deployments.js';
8
8
  export * from './lightning.js';
9
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbGl0ZS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsb0JBQW9CLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUNuRSxPQUFPLEVBQUUsb0JBQW9CLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUNuRSxPQUFPLEVBQUUsbUJBQW1CLEVBQUUsTUFBTSw0QkFBNEIsQ0FBQztBQUNqRSxjQUFjLGdDQUFnQyxDQUFDO0FBTy9DLGNBQWMsdUJBQXVCLENBQUM7QUFDdEMsY0FBYyx1QkFBdUIsQ0FBQztBQUN0QyxjQUFjLGtCQUFrQixDQUFDO0FBQ2pDLGNBQWMsZ0JBQWdCLENBQUMifQ==
9
+ export { generateXwingKeypair } from './xwing.js';
10
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbGl0ZS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsb0JBQW9CLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUNuRSxPQUFPLEVBQUUsb0JBQW9CLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUNuRSxPQUFPLEVBQUUsbUJBQW1CLEVBQUUsTUFBTSw0QkFBNEIsQ0FBQztBQUNqRSxjQUFjLGdDQUFnQyxDQUFDO0FBTy9DLGNBQWMsdUJBQXVCLENBQUM7QUFDdEMsY0FBYyx1QkFBdUIsQ0FBQztBQUN0QyxjQUFjLGtCQUFrQixDQUFDO0FBQ2pDLGNBQWMsZ0JBQWdCLENBQUM7QUFZL0IsT0FBTyxFQUFFLG9CQUFvQixFQUFFLE1BQU0sWUFBWSxDQUFDIn0=
@@ -66,7 +66,7 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
66
66
  private getEncryptor;
67
67
  /**
68
68
  * Get the encryption scheme version used by this Lightning instance.
69
- * Returns 1 for ECIES or 2 for X-Wing.
69
+ * Returns the X-Wing encryption scheme identifier.
70
70
  * This is a convenience method to get the encryption scheme used by this Lightning instance.
71
71
  */
72
72
  getEncryptionScheme(): Promise<EncryptionScheme>;
@@ -129,7 +129,7 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
129
129
  /** Returns a shallow copy of the deployment configuration this Lightning instance is bound to. */
130
130
  get deployment(): T;
131
131
  /**
132
- * Encrypt a value using the network's public key (ECIES or X-Wing).
132
+ * Encrypt a value using the network's public key (X-Wing).
133
133
  * The encryption scheme is automatically detected based on the public key length.
134
134
  *
135
135
  * @param value a boolean or numeric value to encrypt
@@ -68,7 +68,7 @@ export class Lightning {
68
68
  }
69
69
  /**
70
70
  * Get the encryption scheme version used by this Lightning instance.
71
- * Returns 1 for ECIES or 2 for X-Wing.
71
+ * Returns the X-Wing encryption scheme identifier.
72
72
  * This is a convenience method to get the encryption scheme used by this Lightning instance.
73
73
  */
74
74
  async getEncryptionScheme() {
@@ -222,7 +222,7 @@ export class Lightning {
222
222
  return { ...this._deployment };
223
223
  }
224
224
  /**
225
- * Encrypt a value using the network's public key (ECIES or X-Wing).
225
+ * Encrypt a value using the network's public key (X-Wing).
226
226
  * The encryption scheme is automatically detected based on the public key length.
227
227
  *
228
228
  * @param value a boolean or numeric value to encrypt
@@ -97,7 +97,7 @@ export type XwingDecryptorArgs = {
97
97
  /**
98
98
  * Encrypt using X-Wing HPKE (RFC 9180) with ChaCha20-Poly1305 AEAD.
99
99
  *
100
- * Output format: encappedKey (1184 bytes) || ciphertext (variable length)
100
+ * Output format: encappedKey (1120 bytes) || ciphertext (variable length)
101
101
  *
102
102
  * @param pubKeyA - Recipient's public key
103
103
  * @param msg - Message to encrypt
@@ -109,7 +109,7 @@ export declare function encrypt(pubKeyA: CryptoKey, msg: Uint8Array, aad?: Uint8
109
109
  /**
110
110
  * Decrypt using X-Wing HPKE (RFC 9180) with ChaCha20-Poly1305 AEAD.
111
111
  *
112
- * Input format: encappedKey (1184 bytes) || ciphertext (variable length)
112
+ * Input format: encappedKey (1120 bytes) || ciphertext (variable length)
113
113
  *
114
114
  * @param privKeyA - Recipient's private key
115
115
  * @param encryptedData - Encrypted data (encappedKey || ciphertext)
@@ -156,7 +156,7 @@ export async function encodeXwingPublicKey(publicKey) {
156
156
  /**
157
157
  * Encrypt using X-Wing HPKE (RFC 9180) with ChaCha20-Poly1305 AEAD.
158
158
  *
159
- * Output format: encappedKey (1184 bytes) || ciphertext (variable length)
159
+ * Output format: encappedKey (1120 bytes) || ciphertext (variable length)
160
160
  *
161
161
  * @param pubKeyA - Recipient's public key
162
162
  * @param msg - Message to encrypt
@@ -188,7 +188,7 @@ export async function encrypt(pubKeyA, msg, aad = new Uint8Array(0), info = new
188
188
  /**
189
189
  * Decrypt using X-Wing HPKE (RFC 9180) with ChaCha20-Poly1305 AEAD.
190
190
  *
191
- * Input format: encappedKey (1184 bytes) || ciphertext (variable length)
191
+ * Input format: encappedKey (1120 bytes) || ciphertext (variable length)
192
192
  *
193
193
  * @param privKeyA - Recipient's private key
194
194
  * @param encryptedData - Encrypted data (encappedKey || ciphertext)
@@ -9,3 +9,5 @@ export * from './attested-decrypt.js';
9
9
  export * from './deployments.js';
10
10
  export * from './lightning.js';
11
11
  export type { AttestedOpts, AttestedOptsDecrypted, AttestedOptsEncrypted, AttestedOptsEphemeral, AttestedRevealOpts, AttestedWithVoucherOpts, AttestedWithVoucherOptsDecrypted, AttestedWithVoucherOptsEncrypted, AttestedWithVoucherOptsEphemeral, } from './types.js';
12
+ export { generateXwingKeypair } from './xwing.js';
13
+ export type { XwingKeypair } from './xwing.js';
@@ -66,7 +66,7 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
66
66
  private getEncryptor;
67
67
  /**
68
68
  * Get the encryption scheme version used by this Lightning instance.
69
- * Returns 1 for ECIES or 2 for X-Wing.
69
+ * Returns the X-Wing encryption scheme identifier.
70
70
  * This is a convenience method to get the encryption scheme used by this Lightning instance.
71
71
  */
72
72
  getEncryptionScheme(): Promise<EncryptionScheme>;
@@ -129,7 +129,7 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
129
129
  /** Returns a shallow copy of the deployment configuration this Lightning instance is bound to. */
130
130
  get deployment(): T;
131
131
  /**
132
- * Encrypt a value using the network's public key (ECIES or X-Wing).
132
+ * Encrypt a value using the network's public key (X-Wing).
133
133
  * The encryption scheme is automatically detected based on the public key length.
134
134
  *
135
135
  * @param value a boolean or numeric value to encrypt
@@ -97,7 +97,7 @@ export type XwingDecryptorArgs = {
97
97
  /**
98
98
  * Encrypt using X-Wing HPKE (RFC 9180) with ChaCha20-Poly1305 AEAD.
99
99
  *
100
- * Output format: encappedKey (1184 bytes) || ciphertext (variable length)
100
+ * Output format: encappedKey (1120 bytes) || ciphertext (variable length)
101
101
  *
102
102
  * @param pubKeyA - Recipient's public key
103
103
  * @param msg - Message to encrypt
@@ -109,7 +109,7 @@ export declare function encrypt(pubKeyA: CryptoKey, msg: Uint8Array, aad?: Uint8
109
109
  /**
110
110
  * Decrypt using X-Wing HPKE (RFC 9180) with ChaCha20-Poly1305 AEAD.
111
111
  *
112
- * Input format: encappedKey (1184 bytes) || ciphertext (variable length)
112
+ * Input format: encappedKey (1120 bytes) || ciphertext (variable length)
113
113
  *
114
114
  * @param privKeyA - Recipient's private key
115
115
  * @param encryptedData - Encrypted data (encappedKey || ciphertext)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inco/js",
3
- "version": "0.8.0-devnet-26",
3
+ "version": "0.8.0-devnet-28",
4
4
  "repository": "https://github.com/Inco-fhevm/inco-monorepo",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -88,7 +88,7 @@
88
88
  "@hpke/hybridkem-x-wing": "0.6.1",
89
89
  "@hpke/core": "1.7.5",
90
90
  "@hpke/chacha20poly1305": "1.7.1",
91
- "effect": "3.18.4",
91
+ "effect": "3.21.0",
92
92
  "sha3": "2.1.4",
93
93
  "viem": "2.39.3"
94
94
  },