Commit 76f572ed authored by Andy Polyakov's avatar Andy Polyakov
Browse files

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: default avatarMatt Caswell <matt@openssl.org>
parent b47f116b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -52,7 +52,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