Skip to content

Commit

Permalink
Combine stack macros for fewer operations
Browse files Browse the repository at this point in the history
  • Loading branch information
Nashtare committed Oct 21, 2023
1 parent 6ca9970 commit 07ffe4f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions evm/src/cpu/kernel/asm/curve/secp256k1/curve_add.asm
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,13 @@ global secp_double:
%jumpi(ec_double_retself)

// Compute lambda = 3/2 * x0^2 / y0
%stack (x, y, retdest) -> (x, x, @SECP_BASE, @SECP_BASE, x, y, retdest)
%stack (x, y, retdest) -> (x, x, @SECP_BASE, @SECP_BASE, x, y, x, y, retdest)
MULMOD
PUSH 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffff7ffffe19 // 3/2 in the base field
MULMOD
DUP3
%moddiv_secp_base
%stack (lambda, x, y, retdest) -> (lambda, x, y, x, y, retdest)
// stack: lambda, x, y, x, y, retdest
%jump(secp_add_valid_points_with_lambda)

// Push the order of the Secp256k1 scalar field.
Expand Down

0 comments on commit 07ffe4f

Please sign in to comment.