mirror of
https://github.com/QuasarApp/openssl.git
synced 2025-05-05 14:09:41 +00:00
modes/ctr128.c: fix false carry in counter increment procedure.
GH issue #1916 affects only big-endian platforms. TLS is not affected, because TLS fragment is never big enough. Reviewed-by: Matt Caswell <matt@openssl.org> (cherry picked from commit 76f572ed0469a277d92378848250b7a9705d3071)
This commit is contained in:
parent
ca88f01d6c
commit
edfca4e3da
@ -100,7 +100,7 @@ static void ctr128_inc_aligned(unsigned char *counter)
|
|||||||
--n;
|
--n;
|
||||||
d = data[n] += c;
|
d = data[n] += c;
|
||||||
/* did addition carry? */
|
/* did addition carry? */
|
||||||
c = ((d - c) ^ d) >> (sizeof(size_t) * 8 - 1);
|
c = ((d - c) & ~d) >> (sizeof(size_t) * 8 - 1);
|
||||||
} while (n);
|
} while (n);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user