@nekzus/liop 2.4.0-alpha.25 → 2.4.0-alpha.26
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/dist/bin/agent.js +27 -933
- package/dist/bridge.js +1 -5
- package/dist/chunk-2XHSALII.js +3 -0
- package/dist/chunk-2ZYX736J.js +2 -0
- package/dist/chunk-3WRKTVOF.js +2 -0
- package/dist/chunk-6KFKO6ZX.js +2 -0
- package/dist/chunk-6VK2XALI.js +2 -0
- package/dist/chunk-AYDF3IFZ.js +2 -0
- package/dist/chunk-CTTTLCGL.js +31 -0
- package/dist/chunk-ECRS6N33.js +4 -0
- package/dist/chunk-FDJMH4CB.js +2 -0
- package/dist/chunk-FTF6AMF6.js +0 -1
- package/dist/chunk-GWVSCZUS.js +2 -0
- package/dist/chunk-LEXMMIQI.js +15 -0
- package/dist/chunk-LM26HOJ6.js +31 -0
- package/dist/chunk-MQ5SU26J.js +2 -0
- package/dist/chunk-N35BC62H.js +2 -0
- package/dist/chunk-P6IJ3VBD.js +3 -0
- package/dist/chunk-TKLRW52V.js +2 -0
- package/dist/chunk-V35CXJQN.js +2 -0
- package/dist/chunk-WP5ER7RH.js +3 -0
- package/dist/chunk-XLVEDKM6.js +2 -0
- package/dist/chunk-Y675R34Z.js +2 -0
- package/dist/chunk-YD2AF2M6.js +46 -0
- package/dist/chunk-YLCNV764.js +3 -0
- package/dist/chunk-ZZMSFCJP.js +3 -0
- package/dist/client.js +1 -12
- package/dist/gateway.js +1 -13
- package/dist/index.js +4 -320
- package/dist/kyber-PULV7PQX.js +2 -0
- package/dist/mesh.js +1 -5
- package/dist/server.js +1 -10
- package/dist/types.js +1 -3
- package/dist/verifier-J4NQYZX5.js +2 -0
- package/dist/workers/logic-execution.js +1 -355
- package/dist/workers/zk-verifier.js +1 -275
- package/package.json +1 -1
- package/dist/chunk-3664H3CV.js +0 -136
- package/dist/chunk-3QH44NKZ.js +0 -115
- package/dist/chunk-6MYJBM2E.js +0 -818
- package/dist/chunk-7PITYWOV.js +0 -68
- package/dist/chunk-DSOB2JKM.js +0 -1507
- package/dist/chunk-ET6VRUK2.js +0 -58
- package/dist/chunk-FIVRGOA4.js +0 -280
- package/dist/chunk-IHKKWXHJ.js +0 -876
- package/dist/chunk-IK7CGWAZ.js +0 -24
- package/dist/chunk-JPWC6XG6.js +0 -941
- package/dist/chunk-K3DGJLUY.js +0 -106
- package/dist/chunk-KR5UZUEY.js +0 -98
- package/dist/chunk-NXCAFF73.js +0 -59
- package/dist/chunk-Q3FKHJ3B.js +0 -345
- package/dist/chunk-R52TZEIL.js +0 -426
- package/dist/chunk-S3RAZTEM.js +0 -807
- package/dist/chunk-V47P2AQR.js +0 -281
- package/dist/chunk-WXOWJXY6.js +0 -564
- package/dist/chunk-WXYDFCIW.js +0 -293
- package/dist/chunk-Y62GORQF.js +0 -51
- package/dist/chunk-ZP3VVXOI.js +0 -66
- package/dist/chunk-ZU3WVVLC.js +0 -3752
- package/dist/kyber-CGOA7Q6A.js +0 -3
- package/dist/verifier-55HW6AFN.js +0 -6
package/dist/chunk-7PITYWOV.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { createMlKem768 } from 'mlkem';
|
|
2
|
-
|
|
3
|
-
// src/rpc/crypto/kyber.ts
|
|
4
|
-
var kemInstance = null;
|
|
5
|
-
async function getKemInstance() {
|
|
6
|
-
if (!kemInstance) {
|
|
7
|
-
kemInstance = await createMlKem768();
|
|
8
|
-
}
|
|
9
|
-
return kemInstance;
|
|
10
|
-
}
|
|
11
|
-
var Kyber768Wrapper = {
|
|
12
|
-
/**
|
|
13
|
-
* Extracts and validates the 1184-byte Public Key from the Rust LIOP Data Node
|
|
14
|
-
* @param buffer Raw buffer sent via gRPC IntentResponse
|
|
15
|
-
*/
|
|
16
|
-
importPublicKey(buffer) {
|
|
17
|
-
if (buffer.length !== 1184) {
|
|
18
|
-
throw new Error(
|
|
19
|
-
`Kyber768 Public Key must be exactly 1184 bytes (Received: ${buffer.length})`
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
return buffer;
|
|
23
|
-
},
|
|
24
|
-
/**
|
|
25
|
-
* Encapsulates a shared secret using the server's public key.
|
|
26
|
-
* Returns the 1088-byte ciphertext to be sent back, and the 32-byte shared AES secret.
|
|
27
|
-
*/
|
|
28
|
-
async encapsulateAsymmetric(publicKey) {
|
|
29
|
-
try {
|
|
30
|
-
if (publicKey.length !== 1184) {
|
|
31
|
-
throw new Error("Kyber768 Public Key must be exactly 1184 bytes.");
|
|
32
|
-
}
|
|
33
|
-
const kem = await getKemInstance();
|
|
34
|
-
const [ct, ss] = kem.encap(publicKey);
|
|
35
|
-
return {
|
|
36
|
-
ciphertext: ct,
|
|
37
|
-
sharedSecret: ss
|
|
38
|
-
};
|
|
39
|
-
} catch (error) {
|
|
40
|
-
throw new Error(
|
|
41
|
-
`Failed to perform PQC encapsulation: ${error.message}`
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
/**
|
|
46
|
-
* Generates a Kyber768 KeyPair for the server to accept intents.
|
|
47
|
-
*/
|
|
48
|
-
async generateKeyPair() {
|
|
49
|
-
const kem = await getKemInstance();
|
|
50
|
-
const [pk, sk] = kem.generateKeyPair();
|
|
51
|
-
return {
|
|
52
|
-
publicKey: pk,
|
|
53
|
-
secretKey: sk
|
|
54
|
-
};
|
|
55
|
-
},
|
|
56
|
-
/**
|
|
57
|
-
* Decapsulates the shared secret using the server's secret key.
|
|
58
|
-
* Zero-fills the shared secret buffer after extraction for side-channel protection.
|
|
59
|
-
*/
|
|
60
|
-
async decapsulateSymmetric(ciphertext, secretKey) {
|
|
61
|
-
const kem = await getKemInstance();
|
|
62
|
-
return kem.decap(ciphertext, secretKey);
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export { Kyber768Wrapper };
|
|
67
|
-
//# sourceMappingURL=chunk-7PITYWOV.js.map
|
|
68
|
-
//# sourceMappingURL=chunk-7PITYWOV.js.map
|