X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fed25519%2Ffixedint.h;h=8abced09accfa9a180c502b82f462ab63246383c;hp=d03e4bddde3db6e0dd5d367dd37aca280181303b;hb=7a8515112a4bf94da3cec157ada6e0794a03b946;hpb=73068238436d8a22abb86e67b08f573b09fd04e1 diff --git a/src/ed25519/fixedint.h b/src/ed25519/fixedint.h index d03e4bdd..8abced09 100644 --- a/src/ed25519/fixedint.h +++ b/src/ed25519/fixedint.h @@ -4,6 +4,9 @@ Not a compatible replacement for , do not blindly use it as such. */ +#ifndef __TINC_FIXEDINT_H__ +#define __TINC_FIXEDINT_H__ + #if ((defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined(__WATCOMC__) && (defined(_STDINT_H_INCLUDED) || __WATCOMC__ >= 1250)) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_) || defined(__UINT_FAST64_TYPE__)) )) && !defined(FIXEDINT_H_INCLUDED) #include #define FIXEDINT_H_INCLUDED @@ -68,3 +71,21 @@ #define INT64_C(v) v ##I64 #endif #endif + +static inline unsigned char shlu8(unsigned char a, uint32_t b) { + return a << b; +} + +static inline int32_t shl32(uint32_t a, uint32_t b) { + return a << b; +} + +static inline int64_t shl64(uint64_t a, uint32_t b) { + return a << b; +} + +static inline uint64_t shlu64(uint64_t a, uint32_t b) { + return a << b; +} + +#endif