File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change 1515 deployments : write
1616 # contents permission to update benchmark contents in gh-pages branch
1717 contents : write
18+ pull-requests : write
1819
1920 steps :
2021 - name : Checkout sources
Original file line number Diff line number Diff line change @@ -25,13 +25,10 @@ impl Poseidon2 {
2525
2626 fn perform_duplex (&mut self ) {
2727 // add the cache into sponge state
28- for i in 0 ..RATE {
29- // We effectively zero-pad the cache by only adding to the state
30- // cache that is less than the specified `cache_size`
31- if i < self .cache_size {
32- self .state [i ] += self .cache [i ];
33- }
34- }
28+ self .state [0 ] += self .cache [0 ] * (0 < self .cache_size ) as Field ;
29+ self .state [1 ] += self .cache [1 ] * (1 < self .cache_size ) as Field ;
30+ self .state [2 ] += self .cache [2 ] * (2 < self .cache_size ) as Field ;
31+ self .state [3 ] += self .cache [3 ] * (3 < self .cache_size ) as Field ;
3532 self .state = crate ::poseidon2_permutation (self .state , 4 );
3633 }
3734
You can’t perform that action at this time.
0 commit comments