Assessment reports>Session Token>Threat Model>Function: add()

Function: add()

This performs point addition in . It is a wrapper to the precompile contract, computing the addition over alt_bn128 curves as defined in EIP-196.

Inputs

  • p1

    • Validation: Points are validated to lie on the curve during the call of the precompiled contract and revert if not.

    • Impact: Avoid a resulting point not lying on the curve or having an erroneous resulting point.

  • p2

    • Validation: Points are validated to lie on the curve during the call of the precompiled contract and revert if not.

    • Impact: Avoid a resulting point not lying on the curve or having an erroneous resulting point.

Branches and code coverage (including function calls)

Intended branches

Negative behavior

Function call analysis

  • staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)

    • External/Internal? External.

    • Argument control: input and sizes are controlled.

    • Impact: Addition computation of two points.

Zellic © 2024Back to top ↑