@@ -13,8 +13,6 @@ use crate::{
1313 client:: user_decryption_wasm:: { ParsedUserDecryptionRequest , compute_link} ,
1414 cryptography:: {
1515 compute_user_decrypt_message,
16- encryption:: UnifiedPublicEncKey ,
17- internal_crypto_types:: LegacySerialization ,
1816 signatures:: {
1917 PublicSigKey , Signature , internal_verify_sig, recover_address_from_ext_signature,
2018 } ,
@@ -82,12 +80,8 @@ pub(crate) fn check_ext_user_decryption_signature(
8280 eip712_domain : & Eip712Domain ,
8381 expected_addr : & alloy_primitives:: Address ,
8482) -> anyhow:: Result < ( ) > {
85- // NOTE: we need to support legacy user_pk, so try to deserialize MlKem1024 encoded with bincode first
86- let unified_pk = UnifiedPublicEncKey :: from_legacy_bytes ( request. enc_key ( ) ) . map_err ( |e| {
87- anyhow_error_and_log ( format ! ( "Error deserializing UnifiedPublicEncKey: {e}" ) )
88- } ) ?;
8983 let extra_data = request. extra_data ( ) ;
90- let message = compute_user_decrypt_message ( payload, & unified_pk , extra_data) ?;
84+ let message = compute_user_decrypt_message ( payload, request . enc_key ( ) , extra_data) ?;
9185 tracing:: debug!(
9286 "Verifying external user decryption signature for UserDecryptResponseVerification"
9387 ) ;
@@ -593,7 +587,7 @@ mod tests {
593587 & sk0,
594588 & payload,
595589 & domain,
596- & eph_client_pk ,
590+ request . enc_key ( ) ,
597591 request. extra_data ( ) ,
598592 )
599593 . unwrap ( ) ;
@@ -621,7 +615,7 @@ mod tests {
621615 & sk_bad,
622616 & payload,
623617 & domain,
624- & eph_client_pk ,
618+ request . enc_key ( ) ,
625619 & [ ] ,
626620 )
627621 . unwrap ( ) ;
@@ -747,7 +741,7 @@ mod tests {
747741 & sk0,
748742 & pivot_resp,
749743 & dummy_domain,
750- & eph_client_pk ,
744+ client_request . enc_key ( ) ,
751745 & extra_data,
752746 )
753747 . unwrap ( ) ;
@@ -1024,7 +1018,7 @@ mod tests {
10241018 & sk1,
10251019 & payload0,
10261020 & dummy_domain,
1027- & eph_client_pk ,
1021+ client_request . enc_key ( ) ,
10281022 & [ ] ,
10291023 )
10301024 . unwrap ( ) ;
@@ -1053,7 +1047,7 @@ mod tests {
10531047 & sk2,
10541048 & payload,
10551049 & dummy_domain,
1056- & eph_client_pk ,
1050+ client_request . enc_key ( ) ,
10571051 & [ ] ,
10581052 )
10591053 . unwrap ( ) ;
@@ -1082,7 +1076,7 @@ mod tests {
10821076 & sk3,
10831077 & payload,
10841078 & dummy_domain,
1085- & eph_client_pk ,
1079+ client_request . enc_key ( ) ,
10861080 & [ ] ,
10871081 )
10881082 . unwrap ( ) ;
@@ -1111,7 +1105,7 @@ mod tests {
11111105 & sk4,
11121106 & payload,
11131107 & dummy_domain,
1114- & eph_client_pk ,
1108+ client_request . enc_key ( ) ,
11151109 & [ ] ,
11161110 )
11171111 . unwrap ( ) ;
@@ -1249,7 +1243,7 @@ mod tests {
12491243 & sk3,
12501244 & payload,
12511245 & dummy_domain,
1252- & eph_client_pk ,
1246+ client_request . enc_key ( ) ,
12531247 & [ ] ,
12541248 )
12551249 . unwrap ( ) ;
@@ -1399,7 +1393,7 @@ mod tests {
13991393 & sk1,
14001394 & payload0,
14011395 & dummy_domain,
1402- & eph_client_pk ,
1396+ client_request . enc_key ( ) ,
14031397 & [ ] ,
14041398 )
14051399 . unwrap ( ) ;
@@ -1428,7 +1422,7 @@ mod tests {
14281422 & sk2,
14291423 & payload,
14301424 & dummy_domain,
1431- & eph_client_pk ,
1425+ client_request . enc_key ( ) ,
14321426 & [ ] ,
14331427 )
14341428 . unwrap ( ) ;
0 commit comments