@@ -4,17 +4,6 @@ use util::Marshal;
44use webrtc_srtp:: { context:: Context , protection_profile:: ProtectionProfile } ;
55
66fn benchmark_encrypt_rtp_aes_128_cm_hmac_sha1 ( c : & mut Criterion ) {
7- let mut setup_ctx = Context :: new (
8- & vec ! [
9- 96 , 180 , 31 , 4 , 119 , 137 , 128 , 252 , 75 , 194 , 252 , 44 , 63 , 56 , 61 , 55 ,
10- ] ,
11- & vec ! [ 247 , 26 , 49 , 94 , 99 , 29 , 79 , 94 , 5 , 111 , 252 , 216 , 62 , 195 ] ,
12- ProtectionProfile :: Aes128CmHmacSha1_80 ,
13- None ,
14- None ,
15- )
16- . unwrap ( ) ;
17-
187 let mut ctx = Context :: new (
198 & vec ! [
209 96 , 180 , 31 , 4 , 119 , 137 , 128 , 252 , 75 , 194 , 252 , 44 , 63 , 56 , 61 , 55 ,
@@ -57,6 +46,35 @@ fn benchmark_encrypt_rtp_aes_128_cm_hmac_sha1(c: &mut Criterion) {
5746 criterion:: BatchSize :: LargeInput ,
5847 ) ;
5948 } ) ;
49+ }
50+
51+ fn benchmark_decrypt_rtp_aes_128_cm_hmac_sha1 ( c : & mut Criterion ) {
52+ let mut setup_ctx = Context :: new (
53+ & vec ! [
54+ 96 , 180 , 31 , 4 , 119 , 137 , 128 , 252 , 75 , 194 , 252 , 44 , 63 , 56 , 61 , 55 ,
55+ ] ,
56+ & vec ! [ 247 , 26 , 49 , 94 , 99 , 29 , 79 , 94 , 5 , 111 , 252 , 216 , 62 , 195 ] ,
57+ ProtectionProfile :: Aes128CmHmacSha1_80 ,
58+ None ,
59+ None ,
60+ )
61+ . unwrap ( ) ;
62+
63+ let mut ctx = Context :: new (
64+ & vec ! [
65+ 96 , 180 , 31 , 4 , 119 , 137 , 128 , 252 , 75 , 194 , 252 , 44 , 63 , 56 , 61 , 55 ,
66+ ] ,
67+ & vec ! [ 247 , 26 , 49 , 94 , 99 , 29 , 79 , 94 , 5 , 111 , 252 , 216 , 62 , 195 ] ,
68+ ProtectionProfile :: Aes128CmHmacSha1_80 ,
69+ None ,
70+ None ,
71+ )
72+ . unwrap ( ) ;
73+
74+ let mut pld = BytesMut :: new ( ) ;
75+ for i in 0 ..1200 {
76+ pld. extend_from_slice ( & [ i as u8 ] ) ;
77+ }
6078
6179 c. bench_function ( "Benchmark decrypt" , |b| {
6280 let mut seq = 1 ;
@@ -86,5 +104,7 @@ fn benchmark_encrypt_rtp_aes_128_cm_hmac_sha1(c: &mut Criterion) {
86104 } ) ;
87105}
88106
89- criterion_group ! ( benches, benchmark_encrypt_rtp_aes_128_cm_hmac_sha1) ;
107+
108+
109+ criterion_group ! ( benches, benchmark_encrypt_rtp_aes_128_cm_hmac_sha1, benchmark_decrypt_rtp_aes_128_cm_hmac_sha1) ;
90110criterion_main ! ( benches) ;
0 commit comments