Lines Matching +full:- +full:c1 +full:- +full:16

2  *  Constant-time functions
5 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
101 /* We don't support int smaller than 32-bits, but if someone tried to build in mbedtls_ct_memcmp()
103 * only bits set in diff are in the top 16-bits, and would be lost by a in mbedtls_ct_memcmp()
106 #error "mbedtls_ct_memcmp() requires minimum 32-bit ints" in mbedtls_ct_memcmp()
108 /* The bit-twiddling ensures that when we cast uint32_t to int, we are casting in mbedtls_ct_memcmp()
109 * a value that is in the range 0..INT_MAX - a value larger than this would in mbedtls_ct_memcmp()
112 * This ensures that the value returned by the function is non-zero iff in mbedtls_ct_memcmp()
113 * diff is non-zero. in mbedtls_ct_memcmp()
115 return (int) ((diff & 0xffff) | (diff >> 16)); in mbedtls_ct_memcmp()
132 size_t valid_end = n - skip_tail; in mbedtls_ct_memcmp_partial()
142 /* Since we go byte-by-byte, the only bits set will be in the bottom 8 bits, so the in mbedtls_ct_memcmp_partial()
155 mbedtls_ct_condition_t no_op = mbedtls_ct_uint_gt(total - offset, i); in mbedtls_ct_memmove_left()
156 /* The first `total - offset` passes are a no-op. The last in mbedtls_ct_memmove_left()
159 for (size_t n = 0; n < total - 1; n++) { in mbedtls_ct_memmove_left()
164 buf[total-1] = mbedtls_ct_uint_if_else_0(no_op, buf[total-1]); in mbedtls_ct_memmove_left()
187 * no-op because we read from dest and write the same data back into dest. in mbedtls_ct_memcpy_if()
193 /* dest[i] = c1 == c2 ? src[i] : dest[i] */ in mbedtls_ct_memcpy_if()