node-tkms 0.9.0-rc5 → 0.9.1-rc1
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 +226 -267
- package/kms_lib.js +683 -943
- 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,194 +213,152 @@ export enum FheType {
|
|
|
212
213
|
Euint2048 = 11,
|
|
213
214
|
}
|
|
214
215
|
/**
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
|
|
216
|
+
* Core Client
|
|
217
|
+
*
|
|
218
|
+
* Simple client to interact with the KMS servers. This can be seen as a proof-of-concept
|
|
219
|
+
* and reference code for validating the KMS. The logic supplied by the client will be
|
|
220
|
+
* distributed across the aggregator/proxy and smart contracts.
|
|
221
|
+
*/
|
|
219
222
|
export class Client {
|
|
220
223
|
free(): void;
|
|
221
224
|
}
|
|
222
|
-
/**
|
|
223
|
-
*/
|
|
224
225
|
export class CryptoBoxCt {
|
|
225
226
|
free(): void;
|
|
226
227
|
}
|
|
227
228
|
/**
|
|
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
|
-
*/
|
|
229
|
+
* <https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator>
|
|
230
|
+
* eventually chain_id, verifying_contract and salt will be parsed in to
|
|
231
|
+
* solidity types
|
|
232
|
+
*/
|
|
232
233
|
export class Eip712DomainMsg {
|
|
233
234
|
free(): void;
|
|
234
|
-
/**
|
|
235
|
-
*/
|
|
236
235
|
chain_id: Uint8Array;
|
|
237
|
-
/**
|
|
238
|
-
*/
|
|
239
236
|
name: string;
|
|
240
|
-
|
|
241
|
-
*/
|
|
242
|
-
salt: Uint8Array;
|
|
243
|
-
/**
|
|
244
|
-
*/
|
|
237
|
+
salt?: Uint8Array;
|
|
245
238
|
verifying_contract: string;
|
|
246
|
-
/**
|
|
247
|
-
*/
|
|
248
239
|
version: string;
|
|
249
240
|
}
|
|
250
241
|
/**
|
|
251
|
-
* Validity of this struct is not checked.
|
|
252
|
-
*/
|
|
242
|
+
* Validity of this struct is not checked.
|
|
243
|
+
*/
|
|
253
244
|
export class ParsedReencryptionRequest {
|
|
254
245
|
free(): void;
|
|
255
246
|
}
|
|
256
|
-
/**
|
|
257
|
-
*/
|
|
258
|
-
export class Plaintext {
|
|
259
|
-
free(): void;
|
|
260
|
-
/**
|
|
261
|
-
*/
|
|
262
|
-
bytes: Uint8Array;
|
|
263
|
-
}
|
|
264
|
-
/**
|
|
265
|
-
*/
|
|
266
247
|
export class PrivateEncKey {
|
|
267
248
|
free(): void;
|
|
268
249
|
}
|
|
269
|
-
/**
|
|
270
|
-
*/
|
|
271
250
|
export class PrivateSigKey {
|
|
272
251
|
free(): void;
|
|
273
252
|
}
|
|
274
|
-
/**
|
|
275
|
-
*/
|
|
276
253
|
export class PublicEncKey {
|
|
277
254
|
free(): void;
|
|
278
255
|
}
|
|
279
|
-
/**
|
|
280
|
-
*/
|
|
281
256
|
export class PublicSigKey {
|
|
282
257
|
free(): void;
|
|
283
258
|
}
|
|
284
|
-
/**
|
|
285
|
-
*/
|
|
286
259
|
export class ReencryptionRequest {
|
|
287
260
|
free(): void;
|
|
288
|
-
/**
|
|
289
|
-
*/
|
|
290
261
|
domain?: Eip712DomainMsg;
|
|
291
|
-
/**
|
|
292
|
-
*/
|
|
293
262
|
payload?: ReencryptionRequestPayload;
|
|
294
263
|
/**
|
|
295
|
-
* The ID that identifies this request.
|
|
296
|
-
* Future queries for the result must use this request ID.
|
|
297
|
-
*/
|
|
264
|
+
* The ID that identifies this request.
|
|
265
|
+
* Future queries for the result must use this request ID.
|
|
266
|
+
*/
|
|
298
267
|
request_id?: RequestId;
|
|
299
268
|
/**
|
|
300
|
-
* Signature of the serialization of \[ReencryptionRequestPayload\].
|
|
301
|
-
*/
|
|
269
|
+
* Signature of the serialization of \[ReencryptionRequestPayload\].
|
|
270
|
+
*/
|
|
302
271
|
signature: Uint8Array;
|
|
303
272
|
}
|
|
304
|
-
/**
|
|
305
|
-
*/
|
|
306
273
|
export class ReencryptionRequestPayload {
|
|
307
274
|
free(): void;
|
|
308
275
|
/**
|
|
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
|
-
*/
|
|
276
|
+
* The actual ciphertext to decrypt, taken directly from the fhevm.
|
|
277
|
+
* When creating the payload, this field may be empty,
|
|
278
|
+
* it is the responsibility of the gateway to fetch the
|
|
279
|
+
* ciphertext for the given digest below.
|
|
280
|
+
*/
|
|
314
281
|
ciphertext?: Uint8Array;
|
|
315
282
|
/**
|
|
316
|
-
* The SHA3 digest of the ciphertext above.
|
|
317
|
-
*/
|
|
283
|
+
* The SHA3 digest of the ciphertext above.
|
|
284
|
+
*/
|
|
318
285
|
ciphertext_digest: Uint8Array;
|
|
319
286
|
/**
|
|
320
|
-
* The client's (blockchain wallet) address,
|
|
321
|
-
* encoded using EIP-55.
|
|
322
|
-
*/
|
|
287
|
+
* The client's (blockchain wallet) address,
|
|
288
|
+
* encoded using EIP-55.
|
|
289
|
+
*/
|
|
323
290
|
client_address: string;
|
|
324
291
|
/**
|
|
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
|
-
*/
|
|
292
|
+
* Encoding of the user's public encryption key for this request.
|
|
293
|
+
* Encoding using the default encoding of libsodium, i.e. the 32 bytes of a
|
|
294
|
+
* Montgomery point.
|
|
295
|
+
*/
|
|
329
296
|
enc_key: Uint8Array;
|
|
330
297
|
/**
|
|
331
|
-
* The type of plaintext encrypted.
|
|
332
|
-
*/
|
|
298
|
+
* The type of plaintext encrypted.
|
|
299
|
+
*/
|
|
333
300
|
fhe_type: number;
|
|
334
301
|
/**
|
|
335
|
-
* The key id to use for decryption. Will be the request_id used during key
|
|
336
|
-
* generation
|
|
337
|
-
*/
|
|
302
|
+
* The key id to use for decryption. Will be the request_id used during key
|
|
303
|
+
* generation
|
|
304
|
+
*/
|
|
338
305
|
key_id?: RequestId;
|
|
339
306
|
/**
|
|
340
|
-
* Version of the request format.
|
|
341
|
-
*/
|
|
307
|
+
* Version of the request format.
|
|
308
|
+
*/
|
|
342
309
|
version: number;
|
|
343
310
|
}
|
|
344
|
-
/**
|
|
345
|
-
*/
|
|
346
311
|
export class ReencryptionResponse {
|
|
347
312
|
free(): void;
|
|
348
313
|
/**
|
|
349
|
-
* Signature of the serialization of \[ReencryptionResponsePayload\].
|
|
350
|
-
*/
|
|
314
|
+
* Signature of the serialization of \[ReencryptionResponsePayload\].
|
|
315
|
+
*/
|
|
351
316
|
payload?: ReencryptionResponsePayload;
|
|
352
|
-
/**
|
|
353
|
-
*/
|
|
354
317
|
signature: Uint8Array;
|
|
355
318
|
}
|
|
356
|
-
/**
|
|
357
|
-
*/
|
|
358
319
|
export class ReencryptionResponsePayload {
|
|
359
320
|
free(): void;
|
|
360
321
|
/**
|
|
361
|
-
* The degree of the sharing scheme used.
|
|
362
|
-
*/
|
|
322
|
+
* The degree of the sharing scheme used.
|
|
323
|
+
*/
|
|
363
324
|
degree: number;
|
|
364
325
|
/**
|
|
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
|
-
*/
|
|
326
|
+
* The concatenation of two digests:
|
|
327
|
+
* (eip712_signing_hash(pk, domain) || ciphertext digest).
|
|
328
|
+
* This is needed to ensure the response corresponds to the request.
|
|
329
|
+
*/
|
|
369
330
|
digest: Uint8Array;
|
|
370
331
|
/**
|
|
371
|
-
* The type of plaintext encrypted.
|
|
372
|
-
*/
|
|
332
|
+
* The type of plaintext encrypted.
|
|
333
|
+
*/
|
|
373
334
|
fhe_type: number;
|
|
374
335
|
/**
|
|
375
|
-
* The ID of the MPC party doing the reencryption. Used for polynomial
|
|
376
|
-
* reconstruction.
|
|
377
|
-
*/
|
|
336
|
+
* The ID of the MPC party doing the reencryption. Used for polynomial
|
|
337
|
+
* reconstruction.
|
|
338
|
+
*/
|
|
378
339
|
party_id: number;
|
|
379
340
|
/**
|
|
380
|
-
* The signcrypted payload, using a hybrid encryption approach in
|
|
381
|
-
* sign-then-encrypt.
|
|
382
|
-
*/
|
|
341
|
+
* The signcrypted payload, using a hybrid encryption approach in
|
|
342
|
+
* sign-then-encrypt.
|
|
343
|
+
*/
|
|
383
344
|
signcrypted_ciphertext: Uint8Array;
|
|
384
345
|
/**
|
|
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
|
-
*/
|
|
346
|
+
* The server's signature verification key.
|
|
347
|
+
* Encoded using SEC1.
|
|
348
|
+
* Needed to validate the response, but MUST also be linked to a list of
|
|
349
|
+
* trusted keys.
|
|
350
|
+
*/
|
|
390
351
|
verification_key: Uint8Array;
|
|
391
352
|
/**
|
|
392
|
-
* Version of the response format.
|
|
393
|
-
*/
|
|
353
|
+
* Version of the response format.
|
|
354
|
+
*/
|
|
394
355
|
version: number;
|
|
395
356
|
}
|
|
396
357
|
/**
|
|
397
|
-
* Simple response to return an ID, to be used to retrieve the computed result
|
|
398
|
-
* later on.
|
|
399
|
-
*/
|
|
358
|
+
* Simple response to return an ID, to be used to retrieve the computed result
|
|
359
|
+
* later on.
|
|
360
|
+
*/
|
|
400
361
|
export class RequestId {
|
|
401
362
|
free(): void;
|
|
402
|
-
/**
|
|
403
|
-
*/
|
|
404
363
|
request_id: string;
|
|
405
364
|
}
|