tkms 0.9.0-rc11 → 0.9.0-rc21
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/kms_lib.d.ts +266 -301
- package/kms_lib.js +696 -916
- package/kms_lib_bg.wasm +0 -0
- package/package.json +1 -1
package/kms_lib.d.ts
CHANGED
|
@@ -1,202 +1,203 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
* @param {PublicSigKey} pk
|
|
5
|
-
* @returns {Uint8Array}
|
|
6
|
-
*/
|
|
4
|
+
* @param {PublicSigKey} pk
|
|
5
|
+
* @returns {Uint8Array}
|
|
6
|
+
*/
|
|
7
7
|
export function public_sig_key_to_u8vec(pk: PublicSigKey): Uint8Array;
|
|
8
8
|
/**
|
|
9
|
-
* @param {Uint8Array} v
|
|
10
|
-
* @returns {PublicSigKey}
|
|
11
|
-
*/
|
|
9
|
+
* @param {Uint8Array} v
|
|
10
|
+
* @returns {PublicSigKey}
|
|
11
|
+
*/
|
|
12
12
|
export function u8vec_to_public_sig_key(v: Uint8Array): PublicSigKey;
|
|
13
13
|
/**
|
|
14
|
-
* @param {PrivateSigKey} sk
|
|
15
|
-
* @returns {Uint8Array}
|
|
16
|
-
*/
|
|
14
|
+
* @param {PrivateSigKey} sk
|
|
15
|
+
* @returns {Uint8Array}
|
|
16
|
+
*/
|
|
17
17
|
export function private_sig_key_to_u8vec(sk: PrivateSigKey): Uint8Array;
|
|
18
18
|
/**
|
|
19
|
-
* @param {Uint8Array} v
|
|
20
|
-
* @returns {PrivateSigKey}
|
|
21
|
-
*/
|
|
19
|
+
* @param {Uint8Array} v
|
|
20
|
+
* @returns {PrivateSigKey}
|
|
21
|
+
*/
|
|
22
22
|
export function u8vec_to_private_sig_key(v: Uint8Array): PrivateSigKey;
|
|
23
23
|
/**
|
|
24
|
-
* Instantiate a new client.
|
|
25
|
-
*
|
|
26
|
-
* * `
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* * `client_address_hex` - the client (wallet) address in hex,
|
|
30
|
-
* must be prefixed with "0x".
|
|
31
|
-
*
|
|
32
|
-
* * `param_choice` - the parameter choice, which can be either `"test"` or `"default"`.
|
|
33
|
-
* The "default" parameter choice is selected if no matching string is found.
|
|
34
|
-
* @param {(string)[]} server_addrs
|
|
35
|
-
* @param {string} client_address_hex
|
|
36
|
-
* @param {string} param_choice
|
|
37
|
-
* @returns {Client}
|
|
38
|
-
*/
|
|
24
|
+
* Instantiate a new client.
|
|
25
|
+
*
|
|
26
|
+
* * `server_addrs` - a list of KMS server EIP-55 addresses,
|
|
27
|
+
* must be prefixed with "0x".
|
|
28
|
+
*
|
|
29
|
+
* * `client_address_hex` - the client (wallet) address in hex,
|
|
30
|
+
* must be prefixed with "0x".
|
|
31
|
+
*
|
|
32
|
+
* * `param_choice` - the parameter choice, which can be either `"test"` or `"default"`.
|
|
33
|
+
* The "default" parameter choice is selected if no matching string is found.
|
|
34
|
+
* @param {(string)[]} server_addrs
|
|
35
|
+
* @param {string} client_address_hex
|
|
36
|
+
* @param {string} param_choice
|
|
37
|
+
* @returns {Client}
|
|
38
|
+
*/
|
|
39
39
|
export function new_client(server_addrs: (string)[], client_address_hex: string, param_choice: string): Client;
|
|
40
40
|
/**
|
|
41
|
-
* @param {Client} client
|
|
42
|
-
* @returns {(string)[]}
|
|
43
|
-
*/
|
|
41
|
+
* @param {Client} client
|
|
42
|
+
* @returns {(string)[]}
|
|
43
|
+
*/
|
|
44
44
|
export function get_server_addrs(client: Client): (string)[];
|
|
45
45
|
/**
|
|
46
|
-
* @param {Client} client
|
|
47
|
-
* @returns {PrivateSigKey | undefined}
|
|
48
|
-
*/
|
|
46
|
+
* @param {Client} client
|
|
47
|
+
* @returns {PrivateSigKey | undefined}
|
|
48
|
+
*/
|
|
49
49
|
export function get_client_secret_key(client: Client): PrivateSigKey | undefined;
|
|
50
50
|
/**
|
|
51
|
-
* @param {Client} client
|
|
52
|
-
* @returns {string}
|
|
53
|
-
*/
|
|
51
|
+
* @param {Client} client
|
|
52
|
+
* @returns {string}
|
|
53
|
+
*/
|
|
54
54
|
export function get_client_address(client: Client): string;
|
|
55
55
|
/**
|
|
56
|
-
* @returns {PrivateEncKey}
|
|
57
|
-
*/
|
|
56
|
+
* @returns {PrivateEncKey}
|
|
57
|
+
*/
|
|
58
58
|
export function cryptobox_keygen(): PrivateEncKey;
|
|
59
59
|
/**
|
|
60
|
-
* @param {PrivateEncKey} sk
|
|
61
|
-
* @returns {PublicEncKey}
|
|
62
|
-
*/
|
|
60
|
+
* @param {PrivateEncKey} sk
|
|
61
|
+
* @returns {PublicEncKey}
|
|
62
|
+
*/
|
|
63
63
|
export function cryptobox_get_pk(sk: PrivateEncKey): PublicEncKey;
|
|
64
64
|
/**
|
|
65
|
-
* @param {PublicEncKey} pk
|
|
66
|
-
* @returns {Uint8Array}
|
|
67
|
-
*/
|
|
65
|
+
* @param {PublicEncKey} pk
|
|
66
|
+
* @returns {Uint8Array}
|
|
67
|
+
*/
|
|
68
68
|
export function cryptobox_pk_to_u8vec(pk: PublicEncKey): Uint8Array;
|
|
69
69
|
/**
|
|
70
|
-
* @param {PrivateEncKey} sk
|
|
71
|
-
* @returns {Uint8Array}
|
|
72
|
-
*/
|
|
70
|
+
* @param {PrivateEncKey} sk
|
|
71
|
+
* @returns {Uint8Array}
|
|
72
|
+
*/
|
|
73
73
|
export function cryptobox_sk_to_u8vec(sk: PrivateEncKey): Uint8Array;
|
|
74
74
|
/**
|
|
75
|
-
* @param {Uint8Array} v
|
|
76
|
-
* @returns {PublicEncKey}
|
|
77
|
-
*/
|
|
75
|
+
* @param {Uint8Array} v
|
|
76
|
+
* @returns {PublicEncKey}
|
|
77
|
+
*/
|
|
78
78
|
export function u8vec_to_cryptobox_pk(v: Uint8Array): PublicEncKey;
|
|
79
79
|
/**
|
|
80
|
-
* @param {Uint8Array} v
|
|
81
|
-
* @returns {PrivateEncKey}
|
|
82
|
-
*/
|
|
80
|
+
* @param {Uint8Array} v
|
|
81
|
+
* @returns {PrivateEncKey}
|
|
82
|
+
*/
|
|
83
83
|
export function u8vec_to_cryptobox_sk(v: Uint8Array): PrivateEncKey;
|
|
84
84
|
/**
|
|
85
|
-
* @param {Uint8Array} msg
|
|
86
|
-
* @param {PublicEncKey} their_pk
|
|
87
|
-
* @param {PrivateEncKey} my_sk
|
|
88
|
-
* @returns {CryptoBoxCt}
|
|
89
|
-
*/
|
|
85
|
+
* @param {Uint8Array} msg
|
|
86
|
+
* @param {PublicEncKey} their_pk
|
|
87
|
+
* @param {PrivateEncKey} my_sk
|
|
88
|
+
* @returns {CryptoBoxCt}
|
|
89
|
+
*/
|
|
90
90
|
export function cryptobox_encrypt(msg: Uint8Array, their_pk: PublicEncKey, my_sk: PrivateEncKey): CryptoBoxCt;
|
|
91
91
|
/**
|
|
92
|
-
* @param {CryptoBoxCt} ct
|
|
93
|
-
* @param {PrivateEncKey} my_sk
|
|
94
|
-
* @param {PublicEncKey} their_pk
|
|
95
|
-
* @returns {Uint8Array}
|
|
96
|
-
*/
|
|
92
|
+
* @param {CryptoBoxCt} ct
|
|
93
|
+
* @param {PrivateEncKey} my_sk
|
|
94
|
+
* @param {PublicEncKey} their_pk
|
|
95
|
+
* @returns {Uint8Array}
|
|
96
|
+
*/
|
|
97
97
|
export function cryptobox_decrypt(ct: CryptoBoxCt, my_sk: PrivateEncKey, their_pk: PublicEncKey): Uint8Array;
|
|
98
98
|
/**
|
|
99
|
-
* Process the reencryption response from JavaScript objects.
|
|
100
|
-
* The result is a byte array representing a plaintext of any length
|
|
101
|
-
*
|
|
102
|
-
|
|
103
|
-
*
|
|
104
|
-
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
* 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
131
|
-
* 0, 0, 0, 0, 0
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
|
|
150
|
-
*
|
|
151
|
-
|
|
152
|
-
*
|
|
153
|
-
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
* @param {
|
|
157
|
-
* @param {any}
|
|
158
|
-
* @param {any}
|
|
159
|
-
* @param {
|
|
160
|
-
* @param {
|
|
161
|
-
* @param {
|
|
162
|
-
* @
|
|
163
|
-
|
|
99
|
+
* Process the reencryption response from JavaScript objects.
|
|
100
|
+
* The returned result is a byte array representing a plaintext of any length,
|
|
101
|
+
* postprocessing is returned to turn it into an integer.
|
|
102
|
+
*
|
|
103
|
+
* * `client` - client that wants to perform reencryption.
|
|
104
|
+
*
|
|
105
|
+
* * `request` - the initial reencryption request JS object.
|
|
106
|
+
* It can be set to null if `verify` is false.
|
|
107
|
+
* Otherwise the caller needs to give the following JS object.
|
|
108
|
+
* Note that `client_address` and `eip712_verifying_contract` follow EIP-55.
|
|
109
|
+
* ```
|
|
110
|
+
* {
|
|
111
|
+
* signature: '15a4f9a8eb61459cfba7d103d8f911fb04ce91ecf841b34c49c0d56a70b896d20cbc31986188f91efc3842b7df215cee8acb40178daedb8b63d0ba5d199bce121c',
|
|
112
|
+
* client_address: '0x17853A630aAe15AED549B2B874de08B73C0F59c5',
|
|
113
|
+
* enc_key: '2000000000000000df2fcacb774f03187f3802a27259f45c06d33cefa68d9c53426b15ad531aa822',
|
|
114
|
+
* ciphertext_handle: '0748b542afe2353c86cb707e3d21044b0be1fd18efc7cbaa6a415af055bfb358',
|
|
115
|
+
* eip712_verifying_contract: '0x66f9664f97F2b50F62D13eA064982f936dE76657'
|
|
116
|
+
* }
|
|
117
|
+
* ```
|
|
118
|
+
*
|
|
119
|
+
* * `eip712_domain` - the EIP-712 domain JS object.
|
|
120
|
+
* It can be set to null if `verify` is false.
|
|
121
|
+
* Otherwise the caller needs to give the following JS object.
|
|
122
|
+
* Note that `salt` is optional and `verifying_contract` follows EIP-55,
|
|
123
|
+
* additionally, `chain_id` is an array of u8.
|
|
124
|
+
* ```
|
|
125
|
+
* {
|
|
126
|
+
* name: 'Authorization token',
|
|
127
|
+
* version: '1',
|
|
128
|
+
* chain_id: [
|
|
129
|
+
* 70, 31, 0, 0, 0, 0, 0, 0, 0,
|
|
130
|
+
* 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
131
|
+
* 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
132
|
+
* 0, 0, 0, 0, 0
|
|
133
|
+
* ],
|
|
134
|
+
* verifying_contract: '0x66f9664f97F2b50F62D13eA064982f936dE76657',
|
|
135
|
+
* salt: []
|
|
136
|
+
* }
|
|
137
|
+
* ```
|
|
138
|
+
*
|
|
139
|
+
* * `agg_resp` - the response JS object from the gateway.
|
|
140
|
+
* It has two fields like so, both are hex encoded byte arrays.
|
|
141
|
+
* ```
|
|
142
|
+
* [
|
|
143
|
+
* {
|
|
144
|
+
* signature: '69e7e040cab157aa819015b321c012dccb1545ffefd325b359b492653f0347517e28e66c572cdc299e259024329859ff9fcb0096e1ce072af0b6e1ca1fe25ec6',
|
|
145
|
+
* payload: '0100000029...'
|
|
146
|
+
* }
|
|
147
|
+
* ]
|
|
148
|
+
* ```
|
|
149
|
+
*
|
|
150
|
+
* * `enc_pk` - The ephemeral public key.
|
|
151
|
+
*
|
|
152
|
+
* * `enc_sk` - The ephemeral secret key.
|
|
153
|
+
*
|
|
154
|
+
* * `verify` - Whether to perform signature verification for the response.
|
|
155
|
+
* It is insecure if `verify = false`!
|
|
156
|
+
* @param {Client} client
|
|
157
|
+
* @param {any} request
|
|
158
|
+
* @param {any} eip712_domain
|
|
159
|
+
* @param {any} agg_resp
|
|
160
|
+
* @param {PublicEncKey} enc_pk
|
|
161
|
+
* @param {PrivateEncKey} enc_sk
|
|
162
|
+
* @param {boolean} verify
|
|
163
|
+
* @returns {Uint8Array}
|
|
164
|
+
*/
|
|
164
165
|
export function process_reencryption_resp_from_js(client: Client, request: any, eip712_domain: any, agg_resp: any, enc_pk: PublicEncKey, enc_sk: PrivateEncKey, verify: boolean): Uint8Array;
|
|
165
166
|
/**
|
|
166
|
-
* Process the reencryption response from Rust objects.
|
|
167
|
-
* Consider using [process_reencryption_resp_from_js]
|
|
168
|
-
* when using the JS API.
|
|
169
|
-
* The result is a byte array representing a plaintext of any length.
|
|
170
|
-
*
|
|
171
|
-
* * `client` - client that wants to perform reencryption.
|
|
172
|
-
*
|
|
173
|
-
* * `request` - the initial reencryption request.
|
|
174
|
-
* Must be given if `verify` is true.
|
|
175
|
-
*
|
|
176
|
-
* * `eip712_domain` - the EIP-712 domain.
|
|
177
|
-
* Must be given if `verify` is true.
|
|
178
|
-
*
|
|
179
|
-
* * `agg_resp` - the vector of reencryption responses.
|
|
180
|
-
*
|
|
181
|
-
* * `enc_pk` - The ephemeral public key.
|
|
182
|
-
*
|
|
183
|
-
* * `enc_sk` - The ephemeral secret key.
|
|
184
|
-
*
|
|
185
|
-
* * `verify` - Whether to perform signature verification for the response.
|
|
186
|
-
* It is insecure if `verify = false`!
|
|
187
|
-
* @param {Client} client
|
|
188
|
-
* @param {ParsedReencryptionRequest | undefined} request
|
|
189
|
-
* @param {Eip712DomainMsg | undefined} eip712_domain
|
|
190
|
-
* @param {(ReencryptionResponse)[]} agg_resp
|
|
191
|
-
* @param {PublicEncKey} enc_pk
|
|
192
|
-
* @param {PrivateEncKey} enc_sk
|
|
193
|
-
* @param {boolean} verify
|
|
194
|
-
* @returns {Uint8Array}
|
|
195
|
-
*/
|
|
167
|
+
* Process the reencryption response from Rust objects.
|
|
168
|
+
* Consider using [process_reencryption_resp_from_js]
|
|
169
|
+
* when using the JS API.
|
|
170
|
+
* The result is a byte array representing a plaintext of any length.
|
|
171
|
+
*
|
|
172
|
+
* * `client` - client that wants to perform reencryption.
|
|
173
|
+
*
|
|
174
|
+
* * `request` - the initial reencryption request.
|
|
175
|
+
* Must be given if `verify` is true.
|
|
176
|
+
*
|
|
177
|
+
* * `eip712_domain` - the EIP-712 domain.
|
|
178
|
+
* Must be given if `verify` is true.
|
|
179
|
+
*
|
|
180
|
+
* * `agg_resp` - the vector of reencryption responses.
|
|
181
|
+
*
|
|
182
|
+
* * `enc_pk` - The ephemeral public key.
|
|
183
|
+
*
|
|
184
|
+
* * `enc_sk` - The ephemeral secret key.
|
|
185
|
+
*
|
|
186
|
+
* * `verify` - Whether to perform signature verification for the response.
|
|
187
|
+
* It is insecure if `verify = false`!
|
|
188
|
+
* @param {Client} client
|
|
189
|
+
* @param {ParsedReencryptionRequest | undefined} request
|
|
190
|
+
* @param {Eip712DomainMsg | undefined} eip712_domain
|
|
191
|
+
* @param {(ReencryptionResponse)[]} agg_resp
|
|
192
|
+
* @param {PublicEncKey} enc_pk
|
|
193
|
+
* @param {PrivateEncKey} enc_sk
|
|
194
|
+
* @param {boolean} verify
|
|
195
|
+
* @returns {Uint8Array}
|
|
196
|
+
*/
|
|
196
197
|
export function process_reencryption_resp(client: Client, request: ParsedReencryptionRequest | undefined, eip712_domain: Eip712DomainMsg | undefined, agg_resp: (ReencryptionResponse)[], enc_pk: PublicEncKey, enc_sk: PrivateEncKey, verify: boolean): Uint8Array;
|
|
197
198
|
/**
|
|
198
|
-
* The plaintext types that can be encrypted in a fhevm ciphertext.
|
|
199
|
-
*/
|
|
199
|
+
* The plaintext types that can be encrypted in a fhevm ciphertext.
|
|
200
|
+
*/
|
|
200
201
|
export enum FheType {
|
|
201
202
|
Ebool = 0,
|
|
202
203
|
Euint4 = 1,
|
|
@@ -212,195 +213,155 @@ export enum FheType {
|
|
|
212
213
|
Euint2048 = 11,
|
|
213
214
|
}
|
|
214
215
|
/**
|
|
215
|
-
* Simple client to interact with the KMS servers. This can be seen as a proof-of-concept
|
|
216
|
-
* and reference code for validating the KMS. The logic supplied by the client will be
|
|
217
|
-
* distributed across the aggregator/proxy and smart contracts.
|
|
218
|
-
*/
|
|
216
|
+
* Simple client to interact with the KMS servers. This can be seen as a proof-of-concept
|
|
217
|
+
* and reference code for validating the KMS. The logic supplied by the client will be
|
|
218
|
+
* distributed across the aggregator/proxy and smart contracts.
|
|
219
|
+
*/
|
|
219
220
|
export class Client {
|
|
220
221
|
free(): void;
|
|
221
222
|
}
|
|
222
|
-
/**
|
|
223
|
-
*/
|
|
224
223
|
export class CryptoBoxCt {
|
|
225
224
|
free(): void;
|
|
226
225
|
}
|
|
227
226
|
/**
|
|
228
|
-
* <https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator>
|
|
229
|
-
* eventually chain_id, verifying_contract and salt will be parsed in to
|
|
230
|
-
* solidity types
|
|
231
|
-
*/
|
|
227
|
+
* <https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator>
|
|
228
|
+
* eventually chain_id, verifying_contract and salt will be parsed in to
|
|
229
|
+
* solidity types
|
|
230
|
+
*/
|
|
232
231
|
export class Eip712DomainMsg {
|
|
233
232
|
free(): void;
|
|
234
|
-
/**
|
|
235
|
-
*/
|
|
236
233
|
chain_id: Uint8Array;
|
|
237
|
-
/**
|
|
238
|
-
*/
|
|
239
234
|
name: string;
|
|
240
|
-
|
|
241
|
-
*/
|
|
242
|
-
salt: Uint8Array;
|
|
243
|
-
/**
|
|
244
|
-
*/
|
|
235
|
+
salt?: Uint8Array;
|
|
245
236
|
verifying_contract: string;
|
|
246
|
-
/**
|
|
247
|
-
*/
|
|
248
237
|
version: string;
|
|
249
238
|
}
|
|
250
239
|
/**
|
|
251
|
-
* Validity of this struct is not checked.
|
|
252
|
-
*/
|
|
240
|
+
* Validity of this struct is not checked.
|
|
241
|
+
*/
|
|
253
242
|
export class ParsedReencryptionRequest {
|
|
254
243
|
free(): void;
|
|
255
244
|
}
|
|
256
|
-
/**
|
|
257
|
-
*/
|
|
258
245
|
export class Plaintext {
|
|
259
246
|
free(): void;
|
|
260
|
-
/**
|
|
261
|
-
*/
|
|
262
247
|
bytes: Uint8Array;
|
|
263
248
|
}
|
|
264
|
-
/**
|
|
265
|
-
*/
|
|
266
249
|
export class PrivateEncKey {
|
|
267
250
|
free(): void;
|
|
268
251
|
}
|
|
269
|
-
/**
|
|
270
|
-
*/
|
|
271
252
|
export class PrivateSigKey {
|
|
272
253
|
free(): void;
|
|
273
254
|
}
|
|
274
|
-
/**
|
|
275
|
-
*/
|
|
276
255
|
export class PublicEncKey {
|
|
277
256
|
free(): void;
|
|
278
257
|
}
|
|
279
|
-
/**
|
|
280
|
-
*/
|
|
281
258
|
export class PublicSigKey {
|
|
282
259
|
free(): void;
|
|
283
260
|
}
|
|
284
|
-
/**
|
|
285
|
-
*/
|
|
286
261
|
export class ReencryptionRequest {
|
|
287
262
|
free(): void;
|
|
288
|
-
/**
|
|
289
|
-
*/
|
|
290
263
|
domain?: Eip712DomainMsg;
|
|
291
|
-
/**
|
|
292
|
-
*/
|
|
293
264
|
payload?: ReencryptionRequestPayload;
|
|
294
265
|
/**
|
|
295
|
-
* The ID that identifies this request.
|
|
296
|
-
* Future queries for the result must use this request ID.
|
|
297
|
-
*/
|
|
266
|
+
* The ID that identifies this request.
|
|
267
|
+
* Future queries for the result must use this request ID.
|
|
268
|
+
*/
|
|
298
269
|
request_id?: RequestId;
|
|
299
270
|
/**
|
|
300
|
-
* Signature of the serialization of \[ReencryptionRequestPayload\].
|
|
301
|
-
*/
|
|
271
|
+
* Signature of the serialization of \[ReencryptionRequestPayload\].
|
|
272
|
+
*/
|
|
302
273
|
signature: Uint8Array;
|
|
303
274
|
}
|
|
304
|
-
/**
|
|
305
|
-
*/
|
|
306
275
|
export class ReencryptionRequestPayload {
|
|
307
276
|
free(): void;
|
|
308
277
|
/**
|
|
309
|
-
* The actual ciphertext to decrypt, taken directly from the fhevm.
|
|
310
|
-
* When creating the payload, this field may be empty,
|
|
311
|
-
* it is the responsibility of the gateway to fetch the
|
|
312
|
-
* ciphertext for the given digest below.
|
|
313
|
-
*/
|
|
278
|
+
* The actual ciphertext to decrypt, taken directly from the fhevm.
|
|
279
|
+
* When creating the payload, this field may be empty,
|
|
280
|
+
* it is the responsibility of the gateway to fetch the
|
|
281
|
+
* ciphertext for the given digest below.
|
|
282
|
+
*/
|
|
314
283
|
ciphertext?: Uint8Array;
|
|
315
284
|
/**
|
|
316
|
-
* The SHA3 digest of the ciphertext above.
|
|
317
|
-
*/
|
|
285
|
+
* The SHA3 digest of the ciphertext above.
|
|
286
|
+
*/
|
|
318
287
|
ciphertext_digest: Uint8Array;
|
|
319
288
|
/**
|
|
320
|
-
* The client's (blockchain wallet) address,
|
|
321
|
-
* encoded using EIP-55.
|
|
322
|
-
*/
|
|
289
|
+
* The client's (blockchain wallet) address,
|
|
290
|
+
* encoded using EIP-55.
|
|
291
|
+
*/
|
|
323
292
|
client_address: string;
|
|
324
293
|
/**
|
|
325
|
-
* Encoding of the user's public encryption key for this request.
|
|
326
|
-
* Encoding using the default encoding of libsodium, i.e. the 32 bytes of a
|
|
327
|
-
* Montgomery point.
|
|
328
|
-
*/
|
|
294
|
+
* Encoding of the user's public encryption key for this request.
|
|
295
|
+
* Encoding using the default encoding of libsodium, i.e. the 32 bytes of a
|
|
296
|
+
* Montgomery point.
|
|
297
|
+
*/
|
|
329
298
|
enc_key: Uint8Array;
|
|
330
299
|
/**
|
|
331
|
-
* The type of plaintext encrypted.
|
|
332
|
-
*/
|
|
300
|
+
* The type of plaintext encrypted.
|
|
301
|
+
*/
|
|
333
302
|
fhe_type: number;
|
|
334
303
|
/**
|
|
335
|
-
* The key id to use for decryption. Will be the request_id used during key
|
|
336
|
-
* generation
|
|
337
|
-
*/
|
|
304
|
+
* The key id to use for decryption. Will be the request_id used during key
|
|
305
|
+
* generation
|
|
306
|
+
*/
|
|
338
307
|
key_id?: RequestId;
|
|
339
308
|
/**
|
|
340
|
-
* Version of the request format.
|
|
341
|
-
*/
|
|
309
|
+
* Version of the request format.
|
|
310
|
+
*/
|
|
342
311
|
version: number;
|
|
343
312
|
}
|
|
344
|
-
/**
|
|
345
|
-
*/
|
|
346
313
|
export class ReencryptionResponse {
|
|
347
314
|
free(): void;
|
|
348
315
|
/**
|
|
349
|
-
* Signature of the serialization of \[ReencryptionResponsePayload\].
|
|
350
|
-
*/
|
|
316
|
+
* Signature of the serialization of \[ReencryptionResponsePayload\].
|
|
317
|
+
*/
|
|
351
318
|
payload?: ReencryptionResponsePayload;
|
|
352
|
-
/**
|
|
353
|
-
*/
|
|
354
319
|
signature: Uint8Array;
|
|
355
320
|
}
|
|
356
|
-
/**
|
|
357
|
-
*/
|
|
358
321
|
export class ReencryptionResponsePayload {
|
|
359
322
|
free(): void;
|
|
360
323
|
/**
|
|
361
|
-
* The degree of the sharing scheme used.
|
|
362
|
-
*/
|
|
324
|
+
* The degree of the sharing scheme used.
|
|
325
|
+
*/
|
|
363
326
|
degree: number;
|
|
364
327
|
/**
|
|
365
|
-
* The concatenation of two digests:
|
|
366
|
-
* (eip712_signing_hash(pk, domain) || ciphertext digest).
|
|
367
|
-
* This is needed to ensure the response corresponds to the request.
|
|
368
|
-
*/
|
|
328
|
+
* The concatenation of two digests:
|
|
329
|
+
* (eip712_signing_hash(pk, domain) || ciphertext digest).
|
|
330
|
+
* This is needed to ensure the response corresponds to the request.
|
|
331
|
+
*/
|
|
369
332
|
digest: Uint8Array;
|
|
370
333
|
/**
|
|
371
|
-
* The type of plaintext encrypted.
|
|
372
|
-
*/
|
|
334
|
+
* The type of plaintext encrypted.
|
|
335
|
+
*/
|
|
373
336
|
fhe_type: number;
|
|
374
337
|
/**
|
|
375
|
-
* The ID of the MPC party doing the reencryption. Used for polynomial
|
|
376
|
-
* reconstruction.
|
|
377
|
-
*/
|
|
338
|
+
* The ID of the MPC party doing the reencryption. Used for polynomial
|
|
339
|
+
* reconstruction.
|
|
340
|
+
*/
|
|
378
341
|
party_id: number;
|
|
379
342
|
/**
|
|
380
|
-
* The signcrypted payload, using a hybrid encryption approach in
|
|
381
|
-
* sign-then-encrypt.
|
|
382
|
-
*/
|
|
343
|
+
* The signcrypted payload, using a hybrid encryption approach in
|
|
344
|
+
* sign-then-encrypt.
|
|
345
|
+
*/
|
|
383
346
|
signcrypted_ciphertext: Uint8Array;
|
|
384
347
|
/**
|
|
385
|
-
* The server's signature verification key.
|
|
386
|
-
* Encoded using SEC1.
|
|
387
|
-
* Needed to validate the response, but MUST also be linked to a list of
|
|
388
|
-
* trusted keys.
|
|
389
|
-
*/
|
|
348
|
+
* The server's signature verification key.
|
|
349
|
+
* Encoded using SEC1.
|
|
350
|
+
* Needed to validate the response, but MUST also be linked to a list of
|
|
351
|
+
* trusted keys.
|
|
352
|
+
*/
|
|
390
353
|
verification_key: Uint8Array;
|
|
391
354
|
/**
|
|
392
|
-
* Version of the response format.
|
|
393
|
-
*/
|
|
355
|
+
* Version of the response format.
|
|
356
|
+
*/
|
|
394
357
|
version: number;
|
|
395
358
|
}
|
|
396
359
|
/**
|
|
397
|
-
* Simple response to return an ID, to be used to retrieve the computed result
|
|
398
|
-
* later on.
|
|
399
|
-
*/
|
|
360
|
+
* Simple response to return an ID, to be used to retrieve the computed result
|
|
361
|
+
* later on.
|
|
362
|
+
*/
|
|
400
363
|
export class RequestId {
|
|
401
364
|
free(): void;
|
|
402
|
-
/**
|
|
403
|
-
*/
|
|
404
365
|
request_id: string;
|
|
405
366
|
}
|
|
406
367
|
|
|
@@ -410,30 +371,35 @@ export interface InitOutput {
|
|
|
410
371
|
readonly memory: WebAssembly.Memory;
|
|
411
372
|
readonly __wbg_client_free: (a: number, b: number) => void;
|
|
412
373
|
readonly __wbg_parsedreencryptionrequest_free: (a: number, b: number) => void;
|
|
374
|
+
readonly __wbg_publicenckey_free: (a: number, b: number) => void;
|
|
375
|
+
readonly __wbg_privateenckey_free: (a: number, b: number) => void;
|
|
376
|
+
readonly __wbg_publicsigkey_free: (a: number, b: number) => void;
|
|
377
|
+
readonly __wbg_privatesigkey_free: (a: number, b: number) => void;
|
|
378
|
+
readonly __wbg_plaintext_free: (a: number, b: number) => void;
|
|
379
|
+
readonly __wbg_get_plaintext_bytes: (a: number) => Array;
|
|
380
|
+
readonly __wbg_set_plaintext_bytes: (a: number, b: number, c: number) => void;
|
|
413
381
|
readonly __wbg_requestid_free: (a: number, b: number) => void;
|
|
414
382
|
readonly __wbg_reencryptionrequestpayload_free: (a: number, b: number) => void;
|
|
415
383
|
readonly __wbg_get_reencryptionrequestpayload_version: (a: number) => number;
|
|
416
384
|
readonly __wbg_set_reencryptionrequestpayload_version: (a: number, b: number) => void;
|
|
417
|
-
readonly __wbg_get_reencryptionrequestpayload_enc_key: (a: number
|
|
385
|
+
readonly __wbg_get_reencryptionrequestpayload_enc_key: (a: number) => Array;
|
|
418
386
|
readonly __wbg_get_reencryptionrequestpayload_fhe_type: (a: number) => number;
|
|
419
387
|
readonly __wbg_set_reencryptionrequestpayload_fhe_type: (a: number, b: number) => void;
|
|
420
388
|
readonly __wbg_get_reencryptionrequestpayload_key_id: (a: number) => number;
|
|
421
389
|
readonly __wbg_set_reencryptionrequestpayload_key_id: (a: number, b: number) => void;
|
|
422
|
-
readonly __wbg_get_reencryptionrequestpayload_ciphertext: (a: number, b: number) => void;
|
|
423
|
-
readonly __wbg_set_reencryptionrequestpayload_ciphertext: (a: number, b: number, c: number) => void;
|
|
424
390
|
readonly __wbg_eip712domainmsg_free: (a: number, b: number) => void;
|
|
425
|
-
readonly __wbg_get_eip712domainmsg_name: (a: number
|
|
391
|
+
readonly __wbg_get_eip712domainmsg_name: (a: number) => Array;
|
|
426
392
|
readonly __wbg_set_eip712domainmsg_name: (a: number, b: number, c: number) => void;
|
|
427
|
-
readonly __wbg_get_eip712domainmsg_version: (a: number
|
|
393
|
+
readonly __wbg_get_eip712domainmsg_version: (a: number) => Array;
|
|
428
394
|
readonly __wbg_set_eip712domainmsg_version: (a: number, b: number, c: number) => void;
|
|
429
|
-
readonly __wbg_get_eip712domainmsg_chain_id: (a: number
|
|
395
|
+
readonly __wbg_get_eip712domainmsg_chain_id: (a: number) => Array;
|
|
430
396
|
readonly __wbg_set_eip712domainmsg_chain_id: (a: number, b: number, c: number) => void;
|
|
431
|
-
readonly __wbg_get_eip712domainmsg_verifying_contract: (a: number
|
|
397
|
+
readonly __wbg_get_eip712domainmsg_verifying_contract: (a: number) => Array;
|
|
432
398
|
readonly __wbg_set_eip712domainmsg_verifying_contract: (a: number, b: number, c: number) => void;
|
|
433
|
-
readonly __wbg_get_eip712domainmsg_salt: (a: number
|
|
399
|
+
readonly __wbg_get_eip712domainmsg_salt: (a: number) => Array;
|
|
434
400
|
readonly __wbg_set_eip712domainmsg_salt: (a: number, b: number, c: number) => void;
|
|
435
401
|
readonly __wbg_reencryptionrequest_free: (a: number, b: number) => void;
|
|
436
|
-
readonly __wbg_get_reencryptionrequest_signature: (a: number
|
|
402
|
+
readonly __wbg_get_reencryptionrequest_signature: (a: number) => Array;
|
|
437
403
|
readonly __wbg_get_reencryptionrequest_payload: (a: number) => number;
|
|
438
404
|
readonly __wbg_set_reencryptionrequest_payload: (a: number, b: number) => void;
|
|
439
405
|
readonly __wbg_get_reencryptionrequest_domain: (a: number) => number;
|
|
@@ -461,44 +427,43 @@ export interface InitOutput {
|
|
|
461
427
|
readonly __wbg_set_reencryptionresponsepayload_verification_key: (a: number, b: number, c: number) => void;
|
|
462
428
|
readonly __wbg_set_reencryptionresponsepayload_digest: (a: number, b: number, c: number) => void;
|
|
463
429
|
readonly __wbg_set_reencryptionresponsepayload_signcrypted_ciphertext: (a: number, b: number, c: number) => void;
|
|
464
|
-
readonly
|
|
465
|
-
readonly
|
|
466
|
-
readonly
|
|
467
|
-
readonly
|
|
468
|
-
readonly
|
|
469
|
-
readonly
|
|
470
|
-
readonly
|
|
471
|
-
readonly
|
|
472
|
-
readonly
|
|
473
|
-
readonly
|
|
474
|
-
readonly
|
|
475
|
-
readonly
|
|
476
|
-
readonly
|
|
477
|
-
readonly
|
|
478
|
-
readonly
|
|
479
|
-
readonly u8vec_to_public_sig_key: (a: number, b: number, c: number) => void;
|
|
480
|
-
readonly private_sig_key_to_u8vec: (a: number, b: number) => void;
|
|
481
|
-
readonly u8vec_to_private_sig_key: (a: number, b: number, c: number) => void;
|
|
482
|
-
readonly new_client: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
483
|
-
readonly get_server_addrs: (a: number, b: number) => void;
|
|
430
|
+
readonly __wbg_set_reencryptionrequestpayload_ciphertext: (a: number, b: number, c: number) => void;
|
|
431
|
+
readonly __wbg_get_reencryptionrequestpayload_ciphertext: (a: number) => Array;
|
|
432
|
+
readonly __wbg_get_reencryptionrequestpayload_ciphertext_digest: (a: number) => Array;
|
|
433
|
+
readonly __wbg_get_reencryptionresponse_signature: (a: number) => Array;
|
|
434
|
+
readonly __wbg_get_reencryptionresponsepayload_verification_key: (a: number) => Array;
|
|
435
|
+
readonly __wbg_get_reencryptionresponsepayload_digest: (a: number) => Array;
|
|
436
|
+
readonly __wbg_get_reencryptionresponsepayload_signcrypted_ciphertext: (a: number) => Array;
|
|
437
|
+
readonly __wbg_get_requestid_request_id: (a: number) => Array;
|
|
438
|
+
readonly __wbg_get_reencryptionrequestpayload_client_address: (a: number) => Array;
|
|
439
|
+
readonly public_sig_key_to_u8vec: (a: number) => Array;
|
|
440
|
+
readonly u8vec_to_public_sig_key: (a: number, b: number) => Array;
|
|
441
|
+
readonly private_sig_key_to_u8vec: (a: number) => Array;
|
|
442
|
+
readonly u8vec_to_private_sig_key: (a: number, b: number) => Array;
|
|
443
|
+
readonly new_client: (a: number, b: number, c: number, d: number, e: number, f: number) => Array;
|
|
444
|
+
readonly get_server_addrs: (a: number) => Array;
|
|
484
445
|
readonly get_client_secret_key: (a: number) => number;
|
|
485
|
-
readonly get_client_address: (a: number
|
|
446
|
+
readonly get_client_address: (a: number) => Array;
|
|
486
447
|
readonly __wbg_cryptoboxct_free: (a: number, b: number) => void;
|
|
487
448
|
readonly cryptobox_keygen: () => number;
|
|
488
449
|
readonly cryptobox_get_pk: (a: number) => number;
|
|
489
|
-
readonly cryptobox_pk_to_u8vec: (a: number
|
|
490
|
-
readonly cryptobox_sk_to_u8vec: (a: number
|
|
491
|
-
readonly u8vec_to_cryptobox_pk: (a: number, b: number
|
|
492
|
-
readonly u8vec_to_cryptobox_sk: (a: number, b: number
|
|
450
|
+
readonly cryptobox_pk_to_u8vec: (a: number) => Array;
|
|
451
|
+
readonly cryptobox_sk_to_u8vec: (a: number) => Array;
|
|
452
|
+
readonly u8vec_to_cryptobox_pk: (a: number, b: number) => Array;
|
|
453
|
+
readonly u8vec_to_cryptobox_sk: (a: number, b: number) => Array;
|
|
493
454
|
readonly cryptobox_encrypt: (a: number, b: number, c: number, d: number) => number;
|
|
494
|
-
readonly cryptobox_decrypt: (a: number, b: number, c: number
|
|
495
|
-
readonly process_reencryption_resp_from_js: (a: number, b: number, c: number, d: number, e: number, f: number, g: number
|
|
496
|
-
readonly process_reencryption_resp: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number
|
|
455
|
+
readonly cryptobox_decrypt: (a: number, b: number, c: number) => Array;
|
|
456
|
+
readonly process_reencryption_resp_from_js: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => Array;
|
|
457
|
+
readonly process_reencryption_resp: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => Array;
|
|
497
458
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
498
459
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
499
|
-
readonly
|
|
460
|
+
readonly __wbindgen_export_2: WebAssembly.Table;
|
|
500
461
|
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
462
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
463
|
+
readonly __externref_table_alloc: () => number;
|
|
464
|
+
readonly __externref_drop_slice: (a: number, b: number) => void;
|
|
501
465
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
466
|
+
readonly __wbindgen_start: () => void;
|
|
502
467
|
}
|
|
503
468
|
|
|
504
469
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|