Skip to content

Commit

Permalink
remove_switch_in_projectiveIntoAffine (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
ColoCarletti authored Sep 21, 2023
1 parent 637ea8e commit e155896
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions precompiles/EcMul.yul
Original file line number Diff line number Diff line change
Expand Up @@ -293,16 +293,11 @@ object "EcMul" {
/// @return xr The x coordinate of the point P in affine coordinates in Montgomery form.
/// @return yr The y coordinate of the point P in affine coordinates in Montgomery form.
function projectiveIntoAffine(xp, yp, zp) -> xr, yr {
switch zp
case 0 {
xr := 0
yr := 0
}
default {
let zp_inv := montgomeryModularInverse(zp)
xr := montgomeryMul(xp, zp_inv)
yr := montgomeryMul(yp, zp_inv)
}
if zp {
let zp_inv := montgomeryModularInverse(zp)
xr := montgomeryMul(xp, zp_inv)
yr := montgomeryMul(yp, zp_inv)
}
}

/// @notice Doubles a point in projective coordinates in Montgomery form.
Expand Down

0 comments on commit e155896

Please sign in to comment.