@@ -431,15 +431,15 @@ fn felts_steps(n_big_felts: usize, n_small_felts: usize) -> usize {
431
431
/// Estimates the number of VM steps needed to hash the given felts with Blake in Starknet OS.
432
432
/// Each small felt unpacks into 2 u32s, and each big felt into 8 u32s.
433
433
/// Adds a base cost depending on whether the total fits exactly into full 16-u32 messages.
434
- fn compute_blake_hash_steps ( n_big_felts : usize , n_small_felts : usize ) -> usize {
435
- let total_u32s = total_u32s_from_felts ( n_big_felts , n_small_felts ) ;
434
+ fn compute_blake_hash_steps ( felt_size_groups : & FeltSizeCount ) -> usize {
435
+ let total_u32s = felt_size_groups . encoded_u32_len ( ) ;
436
436
if total_u32s == 0 {
437
437
// The empty input case is a special case.
438
438
return blake_estimation:: STEPS_EMPTY_INPUT ;
439
439
}
440
440
441
441
let base_steps = base_steps_for_blake_hash ( total_u32s) ;
442
- let felt_steps = felts_steps ( n_big_felts , n_small_felts ) ;
442
+ let felt_steps = felts_steps ( felt_size_groups . large , felt_size_groups . small ) ;
443
443
444
444
base_steps. checked_add ( felt_steps) . expect ( "Overflow computing total Blake hash steps" )
445
445
}
@@ -465,7 +465,7 @@ fn count_blake_opcode(n_big_felts: usize, n_small_felts: usize) -> usize {
465
465
pub fn encode_and_blake_hash_resources (
466
466
felt_size_groups : & FeltSizeCount ,
467
467
) -> EstimatedExecutionResources {
468
- let n_steps = compute_blake_hash_steps ( felt_size_groups. large , felt_size_groups . small ) ;
468
+ let n_steps = compute_blake_hash_steps ( felt_size_groups) ;
469
469
let builtin_instance_counter = match felt_size_groups. n_felts ( ) {
470
470
// The empty case does not use builtins at all.
471
471
0 => HashMap :: new ( ) ,
0 commit comments