@kumiai/mls-rpc 0.8.0 → 0.9.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.
- package/lib/crypto.js +3 -10
- package/package.json +4 -4
package/lib/crypto.js
CHANGED
|
@@ -65,7 +65,7 @@ import { createRuntime } from '@sozai/runtime';
|
|
|
65
65
|
}
|
|
66
66
|
return handle().exportSecret(label, EXPORT_CONTEXT, length);
|
|
67
67
|
},
|
|
68
|
-
wrap: (bytes)=>handle().encrypt(bytes),
|
|
68
|
+
wrap: (bytes, opts)=>handle().encrypt(bytes, opts),
|
|
69
69
|
sealEntries: async (bytes)=>{
|
|
70
70
|
const key = await handle().exportSecret(entryLabel, EXPORT_CONTEXT, SECRET_LENGTH);
|
|
71
71
|
// Random per seal: two members can frame a commit at the same epoch, and a repeated nonce
|
|
@@ -91,15 +91,8 @@ import { createRuntime } from '@sozai/runtime';
|
|
|
91
91
|
const key = await handle().exportSecret(entryLabel, EXPORT_CONTEXT, SECRET_LENGTH);
|
|
92
92
|
return xchacha20poly1305(key, sealed.subarray(1, 1 + ENTRY_NONCE_BYTES)).decrypt(sealed.subarray(1 + ENTRY_NONCE_BYTES));
|
|
93
93
|
},
|
|
94
|
-
unwrap: async (bytes)=>{
|
|
95
|
-
|
|
96
|
-
const { payload, senderDID } = await handle().decrypt(bytes);
|
|
97
|
-
// `unwrap` requires a sender; `GroupHandle.decrypt` doesn't guarantee one — it can come
|
|
98
|
-
// back absent if the sender-data AEAD open fails or is malformed, no member is found at
|
|
99
|
-
// the authenticated leaf index, or the leaf's credential fails to parse
|
|
100
|
-
// (`group-handle.ts:677,867-872,536-537`, `sender-data.ts:120,123`). `@kumiai/mls` treats
|
|
101
|
-
// all three as "cannot name the author", never "no author" — a shape this port has no case
|
|
102
|
-
// for, so it's refused here rather than passed up with the field missing.
|
|
94
|
+
unwrap: async (bytes, opts)=>{
|
|
95
|
+
const { payload, senderDID } = await handle().decrypt(bytes, opts);
|
|
103
96
|
if (senderDID == null) {
|
|
104
97
|
throw new Error('unwrap: opened frame has no authenticated sender');
|
|
105
98
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kumiai/mls-rpc",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "The @kumiai/rpc consumer ports (GroupCrypto, GroupMLS) implemented over @kumiai/mls",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mls",
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@kokuin/token": "^0.5.0",
|
|
29
|
-
"@kumiai/mls": "^0.
|
|
30
|
-
"@kumiai/rpc": "^0.
|
|
29
|
+
"@kumiai/mls": "^0.9.0",
|
|
30
|
+
"@kumiai/rpc": "^0.9.0",
|
|
31
31
|
"@noble/ciphers": "^2.4.0",
|
|
32
32
|
"@sozai/runtime": "^0.1.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@kumiai/rpc-conformance": "^0.
|
|
35
|
+
"@kumiai/rpc-conformance": "^0.9.0",
|
|
36
36
|
"ts-mls": "2.0.0-rc.13",
|
|
37
37
|
"vitest": "^4.1.11"
|
|
38
38
|
},
|