File tree Expand file tree Collapse file tree 1 file changed +7
-16
lines changed
Expand file tree Collapse file tree 1 file changed +7
-16
lines changed Original file line number Diff line number Diff line change @@ -71,22 +71,13 @@ impl Poseidon2 {
7171
7272 // handle remaining elements after last full RATE-sized chunk
7373 let num_extra_fields = in_len % RATE ;
74- let remainder_start = in_len - num_extra_fields ;
75- state [0 ] += if num_extra_fields > 0 {
76- input [remainder_start ]
77- } else {
78- 0
79- };
80- state [1 ] += if num_extra_fields > 1 {
81- input [remainder_start + 1 ]
82- } else {
83- 0
84- };
85- state [2 ] += if num_extra_fields > 2 {
86- input [remainder_start + 2 ]
87- } else {
88- 0
89- };
74+ if num_extra_fields != 0 {
75+ let remainder_start = in_len - num_extra_fields ;
76+ state [0 ] += input [remainder_start ];
77+ if num_extra_fields > 1 {
78+ state [1 ] += input [remainder_start + 1 ]
79+ }
80+ }
9081 } else {
9182 let mut states : [[Field ; 4 ]; N / RATE + 1 ] = [[0 ; 4 ]; N / RATE + 1 ];
9283 states [0 ] = state ;
You can’t perform that action at this time.
0 commit comments