Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature requrest: enforce memory contraints #167

Closed
3 tasks
dderjoel opened this issue Jul 1, 2023 · 1 comment
Closed
3 tasks

Feature requrest: enforce memory contraints #167

dderjoel opened this issue Jul 1, 2023 · 1 comment

Comments

@dderjoel
Copy link
Collaborator

dderjoel commented Jul 1, 2023

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.
@dderjoel
Copy link
Collaborator Author

dderjoel commented Jul 6, 2023

implemented after 0c2922e

  • Level 1: ./CryptOpt --memroyConstraints none
  • Level 2: ./CryptOpt --memroyConstraints out1-arg1
  • Level 3: ./CryptOpt --memroyConstraints all

@dderjoel dderjoel closed this as completed Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant