@@ -8,55 +8,52 @@ use std::time::{Duration, SystemTime};
8
8
use const_str:: hex;
9
9
use criterion:: { criterion_group, criterion_main, Criterion } ;
10
10
use libsignal_keytrans:: {
11
- CondensedTreeSearchResponse , DeploymentMode , FullSearchResponse , FullTreeHead , KeyTransparency ,
12
- PublicConfig , SearchContext , SlimSearchRequest , VerifyingKey , VrfPublicKey ,
11
+ ChatSearchResponse , DeploymentMode , FullSearchResponse , KeyTransparency , PublicConfig ,
12
+ SearchContext , SlimSearchRequest , VerifyingKey , VrfPublicKey ,
13
13
} ;
14
14
use prost:: Message as _;
15
15
16
16
fn bench_verify_search ( c : & mut Criterion ) {
17
17
let sig_key = VerifyingKey :: from_bytes ( & hex ! (
18
- "12a21ad60d5a3978e19a3b0baa8c35c55a20e10d45f39e5cb34bf6e1b3cce432 "
18
+ "ac0de1fd7f33552bbeb6ebc12b9d4ea10bf5f025c45073d3fb5f5648955a749e "
19
19
) )
20
20
. unwrap ( ) ;
21
21
let vrf_key = VrfPublicKey :: try_from ( hex ! (
22
- "1e71563470c1b8a6e0aadf280b6aa96f8ad064674e69b80292ee46d1ab655fcf "
22
+ "ec3a268237cf5c47115cf222405d5f90cc633ebe05caf82c0dd5acf9d341dadb "
23
23
) )
24
24
. unwrap ( ) ;
25
25
let auditor_key = VerifyingKey :: from_bytes ( & hex ! (
26
26
"1123b13ee32479ae6af5739e5d687b51559abf7684120511f68cde7a21a0e755"
27
27
) )
28
28
. unwrap ( ) ;
29
- let aci = uuid:: uuid!( "84fd7196-b3fa-4d4d-bbf8-8f1cdf2b7cea" ) ;
30
- let request = SlimSearchRequest {
31
- search_key : [ b"a" , aci. as_bytes ( ) . as_slice ( ) ] . concat ( ) ,
32
- version : None ,
33
- } ;
34
- let condensed_response = {
35
- let bytes = include_bytes ! ( "../res/kt-search-response-condensed.dat" ) ;
36
- CondensedTreeSearchResponse :: decode ( bytes. as_slice ( ) ) . unwrap ( )
29
+ let aci = uuid:: uuid!( "90c979fd-eab4-4a08-b6da-69dedeab9b29" ) ;
30
+ let request = SlimSearchRequest :: new ( [ b"a" , aci. as_bytes ( ) . as_slice ( ) ] . concat ( ) ) ;
31
+
32
+ let ChatSearchResponse {
33
+ tree_head : response_tree_head,
34
+ aci : condensed_response,
35
+ e164 : _,
36
+ username_hash : _,
37
+ } = {
38
+ let bytes = include_bytes ! ( "../res/chat_search_response.dat" ) ;
39
+ let mut response =
40
+ ChatSearchResponse :: decode ( bytes. as_slice ( ) ) . expect ( "can decode chat response" ) ;
41
+
42
+ if let Some ( head) = response. tree_head . as_mut ( ) {
43
+ // we don't expect these fields to be present in the verification that follows
44
+ head. distinguished = vec ! [ ] ;
45
+ head. last = vec ! [ ] ;
46
+ }
47
+
48
+ response
37
49
} ;
38
- let response_tree_head = FullTreeHead :: decode (
39
- hex ! ( [
40
- "0a4c08f23710bbd4dfb897321a40385a" ,
41
- "2eee61b2a0ef463251e8f0301389c3a3" ,
42
- "34a0146bc6f2cb9b35938d9c16ba9922" ,
43
- "3a651e963fab86e64e02484e49b5718d" ,
44
- "d826aafe7c3e38dfe53226220603224e" ,
45
- "0a4c08f23710e1d4e0b897321a40a973" ,
46
- "dd2f6a412287f93b051bd7a5da9dc99b" ,
47
- "61d86db8a25c861934e00ee6895097b5" ,
48
- "5272f5f71de8b610b5da0b49fc263e0c" ,
49
- "5e33cd3de26d3a9f98fd5d2aae06"
50
- ] )
51
- . as_slice ( ) ,
52
- )
53
- . expect ( "valid test full tree head" ) ;
50
+ let response_tree_head = response_tree_head. as_ref ( ) . expect ( "has tree head" ) ;
54
51
let response = FullSearchResponse {
55
- condensed : condensed_response,
56
- tree_head : & response_tree_head,
52
+ condensed : condensed_response. expect ( "has ACI condensed response" ) ,
53
+ tree_head : response_tree_head,
57
54
} ;
58
55
59
- let valid_at = SystemTime :: UNIX_EPOCH + Duration :: from_secs ( 1724279958 ) ;
56
+ let valid_at = SystemTime :: UNIX_EPOCH + Duration :: from_secs ( 1746042060 ) ;
60
57
let kt = KeyTransparency {
61
58
config : PublicConfig {
62
59
mode : DeploymentMode :: ThirdPartyAuditing ( auditor_key) ,
0 commit comments