3 ms·
The FOR macro is more readable than the original C for loops. Given their sheer number in this code, I think this is worth the 10 seconds learning curve. I don
by loup-vaillant 9y ago
The FOR macro is more readable than the original C for loops. Given their sheer number in this code, I think this is worth the 10 seconds learning curve. I don't use that when I work with others, though.
The "used twice" macro makes clear this is the exact same code. Would be hard to make sure it is otherwise. Easier to review that way (carry code is a nightmare to test and review).
The constant time comparison is necessary to ensure timing attacks cannot happen. The arithmetic trick may be a tad slower than a conditional branch, but its timings are consistent. Note: the compiler is still allowed to just use a branch, but in practice they don't.