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

UInt::{ct_div_rem, ct_reduce} are not constant-time #116

Closed
tarcieri opened this issue Aug 25, 2022 · 3 comments · Fixed by #117
Closed

UInt::{ct_div_rem, ct_reduce} are not constant-time #116

tarcieri opened this issue Aug 25, 2022 · 3 comments · Fixed by #117

Comments

@tarcieri
Copy link
Member

As noted in #115, both of these functions compute values and then pass them as the rhs to UInt::shl_vartime.

cc @andrewwhitehead @mikelodder7

@mikelodder7
Copy link
Contributor

On line

/// This is variable only with respect to `rhs`.

it specifically says it’s variable wrt the divider. What is the expected output?

@mikelodder7
Copy link
Contributor

Is the comment misleading

@tarcieri
Copy link
Member Author

The issue is even if rhs is constant, it's still variable time with respect to self, due to this line:

let mut bd = self.bits().saturating_sub(rhs.bits());

See this comment: #115 (comment)

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

Successfully merging a pull request may close this issue.

2 participants