crypto_int64.h (526B)
1 /* Added for Tor. */ 2 3 #ifndef CRYPTO_INT64_H 4 #define CRYPTO_INT64_H 5 6 #include "lib/cc/torint.h" 7 #define crypto_int64 int64_t 8 #define crypto_uint64 uint64_t 9 10 /* 11 Stop signed left shifts overflowing 12 by using unsigned types for bitwise operations 13 */ 14 15 #ifndef OVERFLOW_SAFE_SIGNED_LSHIFT 16 #define OVERFLOW_SAFE_SIGNED_LSHIFT(s, lshift, utype, stype) \ 17 ((stype)((utype)(s) << (utype)(lshift))) 18 #endif 19 20 #define SHL64(s, lshift) \ 21 OVERFLOW_SAFE_SIGNED_LSHIFT(s, lshift, crypto_uint64, crypto_int64) 22 23 #endif /* CRYPTO_INT64_H */