@@ -8,9 +8,9 @@ use crate::prelude::*;
8
8
/// The input list must have a length that is a power of two
9
9
/// and is not one. Can otherwise handle any length.
10
10
#[ derive( Debug , Copy , Clone , Eq , PartialEq , Hash ) ]
11
- pub struct MerkleRootFromXfesGeneric ;
11
+ pub struct MerkleRootFromXfes ;
12
12
13
- impl BasicSnippet for MerkleRootFromXfesGeneric {
13
+ impl BasicSnippet for MerkleRootFromXfes {
14
14
fn inputs ( & self ) -> Vec < ( DataType , String ) > {
15
15
vec ! [ (
16
16
DataType :: List ( Box :: new( DataType :: Xfe ) ) ,
@@ -23,7 +23,7 @@ impl BasicSnippet for MerkleRootFromXfesGeneric {
23
23
}
24
24
25
25
fn entrypoint ( & self ) -> String {
26
- "tasmlib_hashing_merkle_root_from_xfes_generic " . to_string ( )
26
+ "tasmlib_hashing_merkle_root_from_xfes " . to_string ( )
27
27
}
28
28
29
29
fn code ( & self , library : & mut Library ) -> Vec < LabelledInstruction > {
@@ -185,7 +185,7 @@ mod tests {
185
185
use crate :: test_helpers:: test_assertion_failure;
186
186
use crate :: test_prelude:: * ;
187
187
188
- impl Function for MerkleRootFromXfesGeneric {
188
+ impl Function for MerkleRootFromXfes {
189
189
fn rust_shadow (
190
190
& self ,
191
191
stack : & mut Vec < BFieldElement > ,
@@ -252,7 +252,7 @@ mod tests {
252
252
}
253
253
}
254
254
255
- impl MerkleRootFromXfesGeneric {
255
+ impl MerkleRootFromXfes {
256
256
fn init_state (
257
257
& self ,
258
258
xfes : Vec < XFieldElement > ,
@@ -270,14 +270,14 @@ mod tests {
270
270
271
271
#[ test]
272
272
fn test ( ) {
273
- ShadowedFunction :: new ( MerkleRootFromXfesGeneric ) . test ( )
273
+ ShadowedFunction :: new ( MerkleRootFromXfes ) . test ( )
274
274
}
275
275
276
276
#[ test]
277
277
fn cannot_handle_input_list_of_length_one ( ) {
278
- let height_0 = MerkleRootFromXfesGeneric . init_state ( xfe_vec ! [ 1 ] , bfe ! ( 0 ) ) ;
278
+ let height_0 = MerkleRootFromXfes . init_state ( xfe_vec ! [ 1 ] , bfe ! ( 0 ) ) ;
279
279
test_assertion_failure (
280
- & ShadowedFunction :: new ( MerkleRootFromXfesGeneric ) ,
280
+ & ShadowedFunction :: new ( MerkleRootFromXfes ) ,
281
281
InitVmState :: with_stack_and_memory ( height_0. stack , height_0. memory ) ,
282
282
& [ 91 ] ,
283
283
) ;
@@ -286,9 +286,9 @@ mod tests {
286
286
#[ test]
287
287
fn cannot_handle_input_list_of_length_not_pow2 ( ) {
288
288
for bad_length in [ 3 , 5 , 6 , 7 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 17 ] {
289
- let init_state = MerkleRootFromXfesGeneric . init_state ( xfe_vec ! [ 1 ; bad_length] , bfe ! ( 0 ) ) ;
289
+ let init_state = MerkleRootFromXfes . init_state ( xfe_vec ! [ 1 ; bad_length] , bfe ! ( 0 ) ) ;
290
290
test_assertion_failure (
291
- & ShadowedFunction :: new ( MerkleRootFromXfesGeneric ) ,
291
+ & ShadowedFunction :: new ( MerkleRootFromXfes ) ,
292
292
InitVmState :: with_stack_and_memory ( init_state. stack , init_state. memory ) ,
293
293
& [ 90 ] ,
294
294
) ;
@@ -303,6 +303,6 @@ mod benches {
303
303
304
304
#[ test]
305
305
fn benchmark ( ) {
306
- ShadowedFunction :: new ( MerkleRootFromXfesGeneric ) . bench ( )
306
+ ShadowedFunction :: new ( MerkleRootFromXfes ) . bench ( )
307
307
}
308
308
}
0 commit comments