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

Clarify assembly review #109

Open
sonti-lurker opened this issue Apr 4, 2023 · 0 comments
Open

Clarify assembly review #109

sonti-lurker opened this issue Apr 4, 2023 · 0 comments

Comments

@sonti-lurker
Copy link

subtle/src/lib.rs

Lines 332 to 338 in 6b6a81a

// This loop shouldn't be shortcircuitable, since the compiler
// shouldn't be able to reason about the value of the `u8`
// unwrapped from the `ct_eq` result.
let mut x = 1u8;
for (ai, bi) in self.iter().zip(_rhs.iter()) {
x &= ai.ct_eq(bi).unwrap_u8();
}

Doesn't really rule out a simple if x == 0 goto end optimization. I assume the assembly was inspected but that should probably be annotated because it would have to be repeated when the compiler does smarter things.

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