File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,15 @@ use rand_core::OsRng;
12
12
use crypto_bigint:: MultiExponentiate ;
13
13
14
14
fn bench_montgomery_conversion < M : Measurement > ( group : & mut BenchmarkGroup < ' _ , M > ) {
15
- group. bench_function ( "MontyParams creation" , |b| {
15
+ group. bench_function ( "MontyParams::new" , |b| {
16
+ b. iter_batched (
17
+ || Odd :: < U256 > :: random ( & mut OsRng ) ,
18
+ |modulus| black_box ( MontyParams :: new ( modulus) ) ,
19
+ BatchSize :: SmallInput ,
20
+ )
21
+ } ) ;
22
+
23
+ group. bench_function ( "MontyParams::new_vartime" , |b| {
16
24
b. iter_batched (
17
25
|| Odd :: < U256 > :: random ( & mut OsRng ) ,
18
26
|modulus| black_box ( MontyParams :: new_vartime ( modulus) ) ,
@@ -21,7 +29,7 @@ fn bench_montgomery_conversion<M: Measurement>(group: &mut BenchmarkGroup<'_, M>
21
29
} ) ;
22
30
23
31
let params = MontyParams :: new_vartime ( Odd :: < U256 > :: random ( & mut OsRng ) ) ;
24
- group. bench_function ( "MontyForm creation " , |b| {
32
+ group. bench_function ( "MontyForm::new " , |b| {
25
33
b. iter_batched (
26
34
|| Odd :: < U256 > :: random ( & mut OsRng ) ,
27
35
|x| black_box ( MontyForm :: new ( & x, params) ) ,
You can’t perform that action at this time.
0 commit comments