mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-01-30 06:22:13 +01:00
Merge pull request #2464 from SparkiDev/rshift_neg
Use constant time comparison in MaskMac with scanStart and macStart
This commit is contained in:
@@ -13241,8 +13241,8 @@ static byte MaskMac(const byte* data, int sz, int macSz, byte* expMac)
|
||||
unsigned char started, notEnded;
|
||||
unsigned char good = 0;
|
||||
|
||||
scanStart &= (~scanStart) >> (sizeof(int) * 8 - 1);
|
||||
macStart &= (~macStart) >> (sizeof(int) * 8 - 1);
|
||||
scanStart &= ctMaskIntGTE(scanStart, 0);
|
||||
macStart &= ctMaskIntGTE(macStart, 0);
|
||||
|
||||
/* Div on Intel has different speeds depending on value.
|
||||
* Use a bitwise AND or mod a specific value (converted to mul). */
|
||||
|
||||
Reference in New Issue
Block a user