Ver Fonte

move LTC_BYTE macro from tomcrypt_macros.h to tomcrypt_private.h

Karel Miko há 7 anos atrás
pai
commit
bb5ea12d0b
2 ficheiros alterados com 6 adições e 7 exclusões
  1. 0 7
      src/headers/tomcrypt_macros.h
  2. 6 0
      src/headers/tomcrypt_private.h

+ 0 - 7
src/headers/tomcrypt_macros.h

@@ -429,13 +429,6 @@ static inline ulong64 ROR64(ulong64 word, int i)
    #define LTC_UNUSED_PARAM(x) (void)(x)
 #endif
 
-/* extract a byte portably */
-#ifdef _MSC_VER
-   #define LTC_BYTE(x, n) ((unsigned char)((x) >> (8 * (n))))
-#else
-   #define LTC_BYTE(x, n) (((x) >> (8 * (n))) & 255)
-#endif
-
 /* there is no snprintf before Visual C++ 2015 */
 #if defined(_MSC_VER) && _MSC_VER < 1900
 #define snprintf _snprintf

+ 6 - 0
src/headers/tomcrypt_private.h

@@ -340,6 +340,12 @@ int which ## _export(unsigned char *out, unsigned long *outlen, prng_state *prng
    return CRYPT_OK;                                                                    \
 }
 
+/* extract a byte portably */
+#ifdef _MSC_VER
+   #define LTC_BYTE(x, n) ((unsigned char)((x) >> (8 * (n))))
+#else
+   #define LTC_BYTE(x, n) (((x) >> (8 * (n))) & 255)
+#endif
 
 /* ref:         $Format:%D$ */
 /* git commit:  $Format:%H$ */