Annotation of src/usr.bin/ssh/int32_minmax.inc, Revision 1.1
1.1 ! tobhe 1: /* $OpenBSD: $ */
! 2:
! 3: /*
! 4: * Public Domain, Authors:
! 5: * - Daniel J. Bernstein
! 6: * - Chitchanok Chuengsatiansup
! 7: * - Tanja Lange
! 8: * - Christine van Vredendaal
! 9: */
! 10:
! 11: #define int32_MINMAX(a,b) \
! 12: do { \
! 13: int64_t ab = (int64_t)b ^ (int64_t)a; \
! 14: int64_t c = (int64_t)b - (int64_t)a; \
! 15: c ^= ab & (c ^ b); \
! 16: c >>= 31; \
! 17: c &= ab; \
! 18: a ^= c; \
! 19: b ^= c; \
! 20: } while(0)