Lines Matching refs:mask

42 /* Convenience method for getting an 8-bit mask. */
51 /* Convenience method for getting an 8-bit mask. */
57 /* Convenience method for getting an 8-bit mask. */
59 /* Convenience method for getting a 32-bit mask. */
65 /* Convenience method for getting an 8-bit mask. */
70 /* Convenience method for getting an 8-bit mask. */
74 * Returns (mask & a) | (~mask & b).
76 * When |mask| is all 1s or all 0s (as returned by the methods above),
77 * the select methods return either |a| (if |mask| is nonzero) or |b|
78 * (if |mask| is zero).
80 static ossl_inline unsigned int constant_time_select(unsigned int mask,
84 static ossl_inline unsigned char constant_time_select_8(unsigned char mask,
89 static ossl_inline uint32_t constant_time_select_32(uint32_t mask, uint32_t a,
93 static ossl_inline uint64_t constant_time_select_64(uint64_t mask, uint64_t a,
96 static ossl_inline int constant_time_select_int(unsigned int mask, int a,
225 * possible value range of the mask and ~mask in the select
276 static ossl_inline unsigned int constant_time_select(unsigned int mask,
280 return (value_barrier(mask) & a) | (value_barrier(~mask) & b);
283 static ossl_inline size_t constant_time_select_s(size_t mask,
287 return (value_barrier_s(mask) & a) | (value_barrier_s(~mask) & b);
290 static ossl_inline unsigned char constant_time_select_8(unsigned char mask,
294 return (unsigned char)constant_time_select(mask, a, b);
297 static ossl_inline int constant_time_select_int(unsigned int mask, int a,
300 return (int)constant_time_select(mask, (unsigned)(a), (unsigned)(b));
303 static ossl_inline int constant_time_select_int_s(size_t mask, int a, int b)
305 return (int)constant_time_select((unsigned)mask, (unsigned)(a),
309 static ossl_inline uint32_t constant_time_select_32(uint32_t mask, uint32_t a,
312 return (value_barrier_32(mask) & a) | (value_barrier_32(~mask) & b);
315 static ossl_inline uint64_t constant_time_select_64(uint64_t mask, uint64_t a,
318 return (value_barrier_64(mask) & a) | (value_barrier_64(~mask) & b);
322 * mask must be 0xFFFFFFFF or 0x00000000.
324 * if (mask) {
331 static ossl_inline void constant_time_cond_swap_32(uint32_t mask, uint32_t *a,
336 xor &= mask;
342 * mask must be 0xFFFFFFFF or 0x00000000.
344 * if (mask) {
351 static ossl_inline void constant_time_cond_swap_64(uint64_t mask, uint64_t *a,
356 xor &= mask;
362 * mask must be 0xFF or 0x00.
365 * if (mask) {
373 static ossl_inline void constant_time_cond_swap_buff(unsigned char mask,
383 tmp &= mask;
403 unsigned char mask;
409 mask = (unsigned char)constant_time_is_zero_s(idx);
411 *(outc + j) |= constant_time_select_8(mask, *(tablec++), 0);