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

Naming convention for secret function arguments #1191

Open
real-or-random opened this issue Jan 10, 2023 · 2 comments
Open

Naming convention for secret function arguments #1191

real-or-random opened this issue Jan 10, 2023 · 2 comments
Labels
side-channel user-documentation user-facing documentation

Comments

@real-or-random
Copy link
Contributor

We should have a naming convention for function arguments that are considered secret by the function (w.r.t to the side channels). This could for example be a prefix, a suffix, or uppercase.

This will be helpful as documentation for the API functions at least.

I'm not sure if it's worth the hassle for the internal functions. Clearer docs certainly won't hurt, but our constant-time tests should catch any violation of secrecy constraints (if nicely documented or not).

@real-or-random real-or-random added user-documentation user-facing documentation side-channel labels Jan 10, 2023
@sipa
Copy link
Contributor

sipa commented Feb 8, 2023

This seems like a good idea, as we do have both internal and external API functions that are only constant-time in some subset of the inputs.

One perhaps rather small point: functions can be constant-time or non-constant-time in their output too. E.g. an ECDH function that first computes a point multiplication (constant time in both its point and scalar argument) and then applies a variable-time hashing algorithm on its output. This may or may not be fine if the output of the function is not used as a secret-to-be-protected. Should that too be encoded in the naming somehow?

@tusharv01
Copy link

In which of the directory, we have to make changes by adding the naming conventions??
Is it coding_notes.md or doc/developer-notes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
side-channel user-documentation user-facing documentation
Projects
None yet
Development

No branches or pull requests

3 participants