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 76f572ed04
)
This commit is contained in:
parent
ca88f01d6c
commit
edfca4e3da
1 changed files with 1 additions and 1 deletions
|
@ -100,7 +100,7 @@ static void ctr128_inc_aligned(unsigned char *counter)
|
|||
--n;
|
||||
d = data[n] += c;
|
||||
/* did addition carry? */
|
||||
c = ((d - c) ^ d) >> (sizeof(size_t) * 8 - 1);
|
||||
c = ((d - c) & ~d) >> (sizeof(size_t) * 8 - 1);
|
||||
} while (n);
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue