Skip to content

Feature requrest: enforce memory contraints #167

@dderjoel

Description

@dderjoel

re bitcoin-core/secp256k1#1329 (comment)

  • r and a may point to the same object, but neither can be equal to b. (...)
    */
    static void secp256k1_fe_mul(secp256k1_fe *r, const secp256k1_fe *a, const secp256k1_fe *b);

The idea is that we could have three enforcement levels:

  • do not care at all (current default). This assumes, that all memory is distinct. I.e read a[0] after writing r[0] is fine.
  • level 2: assume that r and a can be equal, but must be aligned. then, writing to r[0] and subsequently reading from a[1] is valid. Reading a[0] after writing r[0] would be invalid.
  • level 3: do not read any memory after writing any. (except for stack). I.e. there cannot be any reads after the first write, expect if the read is from the stack.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions