1- use bytes:: { Bytes , BytesMut } ;
1+ use bytes:: BytesMut ;
22use criterion:: { criterion_group, criterion_main, Criterion } ;
33use util:: Marshal ;
44use webrtc_srtp:: { context:: Context , protection_profile:: ProtectionProfile } ;
55
6- const RAW_RTCP : Bytes = Bytes :: from_static ( & [
6+ const RAW_RTCP : & [ u8 ] = & [
77 0x81 , 0xc8 , 0x00 , 0x0b , 0xca , 0xfe , 0xba , 0xbe , 0xab , 0xab , 0xab , 0xab , 0xab , 0xab , 0xab , 0xab ,
88 0xab , 0xab , 0xab , 0xab , 0xab , 0xab , 0xab , 0xab ,
9- ] ) ;
9+ ] ;
1010
1111fn benchmark_encrypt_rtp_aes_128_cm_hmac_sha1 ( c : & mut Criterion ) {
1212 let mut ctx = Context :: new (
13- & vec ! [
13+ & [
1414 96 , 180 , 31 , 4 , 119 , 137 , 128 , 252 , 75 , 194 , 252 , 44 , 63 , 56 , 61 , 55 ,
1515 ] ,
16- & vec ! [ 247 , 26 , 49 , 94 , 99 , 29 , 79 , 94 , 5 , 111 , 252 , 216 , 62 , 195 ] ,
16+ & [ 247 , 26 , 49 , 94 , 99 , 29 , 79 , 94 , 5 , 111 , 252 , 216 , 62 , 195 ] ,
1717 ProtectionProfile :: Aes128CmHmacSha1_80 ,
1818 None ,
1919 None ,
@@ -55,21 +55,21 @@ fn benchmark_encrypt_rtp_aes_128_cm_hmac_sha1(c: &mut Criterion) {
5555
5656fn benchmark_decrypt_rtp_aes_128_cm_hmac_sha1 ( c : & mut Criterion ) {
5757 let mut setup_ctx = Context :: new (
58- & vec ! [
58+ & [
5959 96 , 180 , 31 , 4 , 119 , 137 , 128 , 252 , 75 , 194 , 252 , 44 , 63 , 56 , 61 , 55 ,
6060 ] ,
61- & vec ! [ 247 , 26 , 49 , 94 , 99 , 29 , 79 , 94 , 5 , 111 , 252 , 216 , 62 , 195 ] ,
61+ & [ 247 , 26 , 49 , 94 , 99 , 29 , 79 , 94 , 5 , 111 , 252 , 216 , 62 , 195 ] ,
6262 ProtectionProfile :: Aes128CmHmacSha1_80 ,
6363 None ,
6464 None ,
6565 )
6666 . unwrap ( ) ;
6767
6868 let mut ctx = Context :: new (
69- & vec ! [
69+ & [
7070 96 , 180 , 31 , 4 , 119 , 137 , 128 , 252 , 75 , 194 , 252 , 44 , 63 , 56 , 61 , 55 ,
7171 ] ,
72- & vec ! [ 247 , 26 , 49 , 94 , 99 , 29 , 79 , 94 , 5 , 111 , 252 , 216 , 62 , 195 ] ,
72+ & [ 247 , 26 , 49 , 94 , 99 , 29 , 79 , 94 , 5 , 111 , 252 , 216 , 62 , 195 ] ,
7373 ProtectionProfile :: Aes128CmHmacSha1_80 ,
7474 None ,
7575 None ,
@@ -109,10 +109,10 @@ fn benchmark_decrypt_rtp_aes_128_cm_hmac_sha1(c: &mut Criterion) {
109109
110110fn benchmark_encrypt_rtcp_aes_128_cm_hmac_sha1 ( c : & mut Criterion ) {
111111 let mut ctx = Context :: new (
112- & vec ! [
112+ & [
113113 96 , 180 , 31 , 4 , 119 , 137 , 128 , 252 , 75 , 194 , 252 , 44 , 63 , 56 , 61 , 55 ,
114114 ] ,
115- & vec ! [ 247 , 26 , 49 , 94 , 99 , 29 , 79 , 94 , 5 , 111 , 252 , 216 , 62 , 195 ] ,
115+ & [ 247 , 26 , 49 , 94 , 99 , 29 , 79 , 94 , 5 , 111 , 252 , 216 , 62 , 195 ] ,
116116 ProtectionProfile :: Aes128CmHmacSha1_80 ,
117117 None ,
118118 None ,
@@ -121,30 +121,30 @@ fn benchmark_encrypt_rtcp_aes_128_cm_hmac_sha1(c: &mut Criterion) {
121121
122122 c. bench_function ( "Benchmark RTCP encrypt" , |b| {
123123 b. iter ( || {
124- ctx. encrypt_rtcp ( & RAW_RTCP ) . unwrap ( ) ;
124+ ctx. encrypt_rtcp ( RAW_RTCP ) . unwrap ( ) ;
125125 } ) ;
126126 } ) ;
127127}
128128
129129fn benchmark_decrypt_rtcp_aes_128_cm_hmac_sha1 ( c : & mut Criterion ) {
130130 let encrypted = Context :: new (
131- & vec ! [
131+ & [
132132 96 , 180 , 31 , 4 , 119 , 137 , 128 , 252 , 75 , 194 , 252 , 44 , 63 , 56 , 61 , 55 ,
133133 ] ,
134- & vec ! [ 247 , 26 , 49 , 94 , 99 , 29 , 79 , 94 , 5 , 111 , 252 , 216 , 62 , 195 ] ,
134+ & [ 247 , 26 , 49 , 94 , 99 , 29 , 79 , 94 , 5 , 111 , 252 , 216 , 62 , 195 ] ,
135135 ProtectionProfile :: Aes128CmHmacSha1_80 ,
136136 None ,
137137 None ,
138138 )
139139 . unwrap ( )
140- . encrypt_rtcp ( & RAW_RTCP )
140+ . encrypt_rtcp ( RAW_RTCP )
141141 . unwrap ( ) ;
142142
143143 let mut ctx = Context :: new (
144- & vec ! [
144+ & [
145145 96 , 180 , 31 , 4 , 119 , 137 , 128 , 252 , 75 , 194 , 252 , 44 , 63 , 56 , 61 , 55 ,
146146 ] ,
147- & vec ! [ 247 , 26 , 49 , 94 , 99 , 29 , 79 , 94 , 5 , 111 , 252 , 216 , 62 , 195 ] ,
147+ & [ 247 , 26 , 49 , 94 , 99 , 29 , 79 , 94 , 5 , 111 , 252 , 216 , 62 , 195 ] ,
148148 ProtectionProfile :: Aes128CmHmacSha1_80 ,
149149 None ,
150150 None ,
0 commit comments