Hacker News new | past | comments | ask | show | jobs | submit login

I understand the issue, but not the explanation.

Your example is different, this is because you're doing an addition. I can see how this could be a problem if you want to do a rotation (a << 4) + (a >> 60) and hence why you should use a ^ instead of a + here (example: https://github.com/gvanas/KeccakCodePackage/blob/master/SnP/... )




6.5.7.3 of the C99 standard specifies that each operand of a bit shift first undergoes integer promotion.


yesh! Alright I see the issue. This `int` then gets sign extended to a 64-bit register.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: