Should true/false for Choice be encoded as 0x55 and 0xAA instead of 0/1? #110
Unanswered
sonti-lurker
asked this question in
Q&A
Replies: 1 comment
-
Per #101 I think the best choices are zero and non-zero. This is because hardware predication instructions work in terms of zero and non-zero. Using anything other than zero for false will not work with those instructions. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Why are true/false encoded as 0u8 and 1u8 and not something with constant hamming weight like 01010101 and 10101010?
I understand that it's not required for constant time operations but it seems to be common practice in protected cryptography libraries. It provides a starting point for defense against power analysis. It would also prevent some timing issues if an extra smart compiler or processor tries to optimize a & b for the case that one of them is all-0.
It does complicate the code somewhat, I suppose.
Beta Was this translation helpful? Give feedback.
All reactions