+32
−32
+112
−112
Loading
WARNING! GitLab maintenance operation scheduled for this Friday between 14:00 and 19:00 (CET). During this time window, GitLab will be unavailable, and any data entered during this period may be lost. Thank you in advance for your understanding.
Td4 and Te4 are arrays of u8. A u8 << int promotes the u8 to an int first then shifts.
If the mathematical result of a shift (as modelled by lhs * 2^{rhs}) is not representable
in an integer, behaviour is undefined. In other words, you can't shift into the sign bit
of a signed integer. Fix this by casting to u32 whenever we're shifting left by 24.
(For consistency, cast other shifts, too.)
Caught by -fsanitize=shift
Submitted by Nick Lewycky (Google)
Reviewed-by:
Andy Polyakov <appro@openssl.org>
(cherry picked from commit 8b37e5c1)