@@ -223,6 +223,9 @@ message PublicDecryptionRequest {
223223
224224 // The EIP712 domain used for signing the response.
225225 Eip712DomainMsg domain = 4 ;
226+
227+ // Extra data from the gateway.
228+ bytes extra_data = 5 ;
226229}
227230
228231// KMS-internal Public Decryption Response Payload, containing meta data, plaintexts
@@ -234,27 +237,29 @@ message PublicDecryptionResponsePayload {
234237 // trusted keys.
235238 // TODO should be renamed to make it clear it is the server's key
236239 bytes verification_key = 1 ;
237- // Digest of the request validated.
238- // Needed to ensure that the response is for the expected request.
239- // THIS IS DEPRECATED AND KMS WILL LEAVE THIS FIELD EMPTY,
240- // instead, we will use request_id to specify the link.
241- bytes digest = 2 [deprecated =true ];
240+
242241 // A list of plaintexts, as little endian byte arrays. One for each
243242 // ciphertext.
244- repeated TypedPlaintext plaintexts = 3 ;
245- // the signature on external_decryption_result for the external recipient
246- // (e.g. using EIP712 for fhevm)
247- optional bytes external_signature = 4 ;
243+ repeated TypedPlaintext plaintexts = 2 ;
244+
248245 // Request ID of the request that this response corresponds to.
249- RequestId request_id = 5 ;
246+ RequestId request_id = 3 ;
250247}
251248
252249// KMS-internal Public Decryption Response
253250message PublicDecryptionResponse {
254251 // Signature of the serialization of [PublicDecryptionResponsePayload].
255252 bytes signature = 1 ;
253+
254+ // the signature on external_decryption_result for the external recipient
255+ // (e.g. using EIP712 for fhevm)
256+ optional bytes external_signature = 2 ;
257+
256258 // The payload that is signed
257- PublicDecryptionResponsePayload payload = 2 ;
259+ PublicDecryptionResponsePayload payload = 3 ;
260+
261+ // Extra data used in the EIP712 signature - external_signature.
262+ bytes extra_data = 4 ;
258263}
259264
260265// Eip712 domain information.
@@ -289,38 +294,51 @@ message UserDecryptionRequest {
289294
290295 // The user's EIP712 domain. This MUST be present. Furthermore, the `verifying_contract` MUST be set and be distinct from `client_address`.
291296 Eip712DomainMsg domain = 6 ;
297+
298+ // Extra data from the gateway.
299+ bytes extra_data = 7 ;
292300}
293301
294302message UserDecryptionResponse {
295303 bytes signature = 1 ;
304+
296305 // This is the external signature created from the Eip712 domain
297306 // on the structure, where userDecryptedShare is bc2wrap::serialize(&payload)
298307 // struct UserDecryptResponseVerification {
299308 // bytes publicKey;
300309 // uint256[] ctHandles;
301- // bytes userDecryptedShare;
310+ // bytes userDecryptedShare; // serialization of payload
311+ // bytes extraData;
302312 // }
303313 bytes external_signature = 2 ;
314+
304315 // The actual [UserDecryptionResponsePayload].
305316 UserDecryptionResponsePayload payload = 3 ;
317+
318+ // Extra data used in the EIP712 signature - external_signature.
319+ bytes extra_data = 4 ;
306320}
307321
308322message UserDecryptionResponsePayload {
309323 // The server's signature verification key, Encoded using SEC1.
310324 // Needed to validate the response, but MUST also be linked to a list of
311325 // trusted keys.
312326 bytes verification_key = 1 ;
327+
313328 // This is needed to ensure the response corresponds to the request.
314329 // It is the digest of UserDecryptionLinker hashed using EIP712
315330 // under the given domain in the request.
316331 bytes digest = 2 ;
332+
317333 // The resulting signcrypted ciphertexts, each ciphertext
318334 // must be decrypted and then reconstructed with the other shares
319335 // to produce the final plaintext.
320336 repeated TypedSigncryptedCiphertext signcrypted_ciphertexts = 3 ;
337+
321338 // The ID of the MPC party doing the user decryption. Used for polynomial
322339 // reconstruction.
323340 uint32 party_id = 4 ;
341+
324342 // The degree of the sharing scheme used.
325343 uint32 degree = 5 ;
326344}
0 commit comments