Skip to content

Commit

Permalink
pow_mod use sqr_mod
Browse files Browse the repository at this point in the history
  • Loading branch information
shramee committed May 15, 2024
1 parent edb50fc commit 34374c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/math/src/mod_arithmetics.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ pub fn pow_mod(mut base: u256, mut pow: u256, mod_non_zero: NonZero<u256>) -> u2
result = mult_mod(result, base, mod_non_zero);
}
pow = q;
base = mult_mod(base, base, mod_non_zero);
base = sqr_mod(base, mod_non_zero);
};

result
Expand Down

0 comments on commit 34374c0

Please sign in to comment.