1
1
use criterion:: { BatchSize , Criterion , criterion_group, criterion_main} ;
2
2
use ed448_goldilocks:: {
3
- CompressedDecaf , CompressedEdwardsY , Decaf448 , DecafPoint , DecafScalar , EdwardsPoint ,
4
- EdwardsScalar , MontgomeryPoint ,
3
+ Decaf448 , DecafPoint , DecafScalar , EdwardsPoint , EdwardsScalar , MontgomeryPoint ,
5
4
} ;
6
5
use elliptic_curve:: group:: GroupEncoding ;
7
6
use elliptic_curve:: { Field , Group } ;
@@ -36,18 +35,6 @@ pub fn ed448(c: &mut Criterion) {
36
35
)
37
36
} ) ;
38
37
39
- group. bench_function ( "hash_to_curve" , |b| {
40
- b. iter_batched (
41
- || {
42
- let mut msg = [ 0 ; 64 ] ;
43
- OsRng . try_fill_bytes ( & mut msg) . unwrap ( ) ;
44
- msg
45
- } ,
46
- |msg| EdwardsPoint :: hash_with_defaults ( & msg) ,
47
- BatchSize :: SmallInput ,
48
- )
49
- } ) ;
50
-
51
38
group. bench_function ( "encode_to_curve" , |b| {
52
39
b. iter_batched (
53
40
|| {
@@ -106,23 +93,6 @@ pub fn decaf448(c: &mut Criterion) {
106
93
)
107
94
} ) ;
108
95
109
- group. bench_function ( "hash_to_curve" , |b| {
110
- b. iter_batched (
111
- || {
112
- let mut msg = [ 0 ; 64 ] ;
113
- OsRng . try_fill_bytes ( & mut msg) . unwrap ( ) ;
114
- msg
115
- } ,
116
- |msg| {
117
- Decaf448 :: hash_from_bytes :: < ExpandMsgXof < Shake256 > > (
118
- & [ & msg] ,
119
- & [ b"decaf448_XOF:SHAKE256_D448MAP_RO_" ] ,
120
- )
121
- } ,
122
- BatchSize :: SmallInput ,
123
- )
124
- } ) ;
125
-
126
96
group. bench_function ( "encode_to_curve" , |b| {
127
97
b. iter_batched (
128
98
|| {
@@ -140,27 +110,27 @@ pub fn decaf448(c: &mut Criterion) {
140
110
)
141
111
} ) ;
142
112
143
- group. bench_function ( "compress " , |b| {
113
+ group. bench_function ( "encode " , |b| {
144
114
b. iter_batched (
145
115
|| DecafPoint :: try_from_rng ( & mut OsRng ) . unwrap ( ) ,
146
- |point| point. compress ( ) . 0 ,
116
+ |point| point. to_bytes ( ) ,
147
117
BatchSize :: SmallInput ,
148
118
)
149
119
} ) ;
150
120
151
- group. bench_function ( "decompress " , |b| {
121
+ group. bench_function ( "decode " , |b| {
152
122
b. iter_batched (
153
- || DecafPoint :: try_from_rng ( & mut OsRng ) . unwrap ( ) . compress ( ) . 0 ,
154
- |bytes| CompressedDecaf ( bytes) . decompress ( ) . unwrap ( ) ,
123
+ || DecafPoint :: try_from_rng ( & mut OsRng ) . unwrap ( ) . to_bytes ( ) ,
124
+ |bytes| DecafPoint :: from_bytes ( & bytes) . unwrap ( ) ,
155
125
BatchSize :: SmallInput ,
156
126
)
157
127
} ) ;
158
128
159
129
group. finish ( ) ;
160
130
}
161
131
162
- pub fn curve448 ( c : & mut Criterion ) {
163
- let mut group = c. benchmark_group ( "Curve448 " ) ;
132
+ pub fn x448 ( c : & mut Criterion ) {
133
+ let mut group = c. benchmark_group ( "X448 " ) ;
164
134
165
135
group. bench_function ( "scalar multiplication" , |b| {
166
136
b. iter_batched (
@@ -178,5 +148,5 @@ pub fn curve448(c: &mut Criterion) {
178
148
group. finish ( ) ;
179
149
}
180
150
181
- criterion_group ! ( benches, ed448, decaf448, curve448 ) ;
151
+ criterion_group ! ( benches, ed448, decaf448, x448 ) ;
182
152
criterion_main ! ( benches) ;
0 commit comments