@inco/js 0.8.0-devnet-27 → 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.
- package/README.md +26 -6
- package/dist/cjs/lite/index.d.ts +2 -0
- package/dist/cjs/lite/index.js +4 -2
- package/dist/esm/lite/index.d.ts +2 -0
- package/dist/esm/lite/index.js +2 -1
- package/dist/types/lite/index.d.ts +2 -0
- package/package.json +1 -1
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
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
keypair
|
|
170
|
-
|
|
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`)
|
package/dist/cjs/lite/index.d.ts
CHANGED
|
@@ -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';
|
package/dist/cjs/lite/index.js
CHANGED
|
@@ -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
|
-
|
|
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=
|
package/dist/esm/lite/index.d.ts
CHANGED
|
@@ -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';
|
package/dist/esm/lite/index.js
CHANGED
|
@@ -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
|
-
|
|
9
|
+
export { generateXwingKeypair } from './xwing.js';
|
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbGl0ZS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsb0JBQW9CLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUNuRSxPQUFPLEVBQUUsb0JBQW9CLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUNuRSxPQUFPLEVBQUUsbUJBQW1CLEVBQUUsTUFBTSw0QkFBNEIsQ0FBQztBQUNqRSxjQUFjLGdDQUFnQyxDQUFDO0FBTy9DLGNBQWMsdUJBQXVCLENBQUM7QUFDdEMsY0FBYyx1QkFBdUIsQ0FBQztBQUN0QyxjQUFjLGtCQUFrQixDQUFDO0FBQ2pDLGNBQWMsZ0JBQWdCLENBQUM7QUFZL0IsT0FBTyxFQUFFLG9CQUFvQixFQUFFLE1BQU0sWUFBWSxDQUFDIn0=
|
|
@@ -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';
|