Skip to content

Commit

Permalink
feat: remove mem address check
Browse files Browse the repository at this point in the history
  • Loading branch information
chancehudson committed Feb 15, 2023
1 parent 5946e77 commit 14c7266
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 30 deletions.
6 changes: 0 additions & 6 deletions contracts/PoseidonT2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ library PoseidonT2 {
mstore(0x20, addmod(mulmod(state0, M01, F), mulmod(state1, M11, F), F))
}

// we're assuming that 0x80 is usable as scratch memory
// make sure we're not overwriting another functions memory
if eq(eq(inputs, 0x80), 0) {
revert(0, 0)
}

// scratch variable for exponentiation
let p

Expand Down
6 changes: 0 additions & 6 deletions contracts/PoseidonT3.sol
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,6 @@ library PoseidonT3 {
mstore(0x80, addmod(addmod(mulmod(state0, M02, F), mulmod(state1, M12, F), F), mulmod(state2, M22, F), F))
}

// we're assuming that 0x80 is usable as scratch memory
// make sure we're not overwriting another functions memory
if eq(eq(inputs, 0x80), 0) {
revert(0, 0)
}

// scratch variable for exponentiation
let p

Expand Down
6 changes: 0 additions & 6 deletions contracts/PoseidonT4.sol
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,6 @@ library PoseidonT4 {
mstore(0xa0, addmod(addmod(addmod(mulmod(state0, M03, F), mulmod(state1, M13, F), F), mulmod(state2, M23, F), F), mulmod(state3, M33, F), F))
}

// we're assuming that 0x80 is usable as scratch memory
// make sure we're not overwriting another functions memory
if eq(eq(inputs, 0x80), 0) {
revert(0, 0)
}

// scratch variable for exponentiation
let p

Expand Down
6 changes: 0 additions & 6 deletions contracts/PoseidonT5.sol
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,6 @@ library PoseidonT5 {
)
}

// we're assuming that 0x80 is usable as scratch memory
// make sure we're not overwriting another functions memory
if eq(eq(inputs, 0x80), 0) {
revert(0, 0)
}

// scratch variable for exponentiation
let p

Expand Down
6 changes: 0 additions & 6 deletions src/buildPoseidon.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,6 @@ function fRound(${Array(T)
f += `
}
// we're assuming that 0x80 is usable as scratch memory
// make sure we're not overwriting another functions memory
if eq(eq(inputs, 0x80), 0) {
revert(0, 0)
}
// scratch variable for exponentiation
let p
`
Expand Down

0 comments on commit 14c7266

Please sign in to comment.