Skip to content

Commit

Permalink
Fix code scanning alert #19
Browse files Browse the repository at this point in the history
  • Loading branch information
jibeee committed Jul 28, 2022
1 parent edf508c commit abeb51e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/stark_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,12 @@ void shift_stark_hash(FieldElement hash) {
uint32_t bits_count = bits256(&hash256);
if (bits_count < 248) {
return;
} else if (bits_count >= 248 && bits_count % 8 >= 1 && bits_count % 8 <= 4) {
} else if (bits_count % 8 >= 1 && bits_count % 8 <= 4) {
shiftl256(&hash256, 4, &final_hash256);
write_u64_be(hash, UPPER(UPPER_P((&final_hash256))));
write_u64_be(hash + 8, LOWER(UPPER_P((&final_hash256))));
write_u64_be(hash + 16, UPPER(LOWER_P((&final_hash256))));
write_u64_be(hash + 24, LOWER(LOWER_P((&final_hash256))));
return;
} else {
THROW(0x6A80);
}
Expand Down

0 comments on commit abeb51e

Please sign in to comment.