@@ -4,17 +4,6 @@ use util::Marshal;
4
4
use webrtc_srtp:: { context:: Context , protection_profile:: ProtectionProfile } ;
5
5
6
6
fn 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
-
18
7
let mut ctx = Context :: new (
19
8
& vec ! [
20
9
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) {
57
46
criterion:: BatchSize :: LargeInput ,
58
47
) ;
59
48
} ) ;
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
+ }
60
78
61
79
c. bench_function ( "Benchmark decrypt" , |b| {
62
80
let mut seq = 1 ;
@@ -86,5 +104,7 @@ fn benchmark_encrypt_rtp_aes_128_cm_hmac_sha1(c: &mut Criterion) {
86
104
} ) ;
87
105
}
88
106
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) ;
90
110
criterion_main ! ( benches) ;
0 commit comments