瀏覽代碼

show ROtate operator configuration in build settings

[skip ci]
Steffen Jaeckel 9 年之前
父節點
當前提交
7c2ff8ebfe
共有 2 個文件被更改,包括 9 次插入0 次删除
  1. 3 0
      src/headers/tomcrypt_macros.h
  2. 6 0
      src/misc/crypt/crypt.c

+ 3 - 0
src/headers/tomcrypt_macros.h

@@ -235,6 +235,7 @@ do { x = (((ulong64)((y)[7] & 255))<<56)|(((ulong64)((y)[6] & 255))<<48) | \
 
 
 /* 32-bit Rotates */
 /* 32-bit Rotates */
 #if defined(_MSC_VER)
 #if defined(_MSC_VER)
+#define LTC_ROx_ASM
 
 
 /* instrinsic rotate */
 /* instrinsic rotate */
 #include <stdlib.h>
 #include <stdlib.h>
@@ -245,6 +246,7 @@ do { x = (((ulong64)((y)[7] & 255))<<56)|(((ulong64)((y)[6] & 255))<<48) | \
 #define ROLc(x,n) _lrotl(x,n)
 #define ROLc(x,n) _lrotl(x,n)
 
 
 #elif !defined(__STRICT_ANSI__) && defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && !defined(INTEL_CC) && !defined(LTC_NO_ASM)
 #elif !defined(__STRICT_ANSI__) && defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && !defined(INTEL_CC) && !defined(LTC_NO_ASM)
+#define LTC_ROx_ASM
 
 
 static inline ulong32 ROL(ulong32 word, int i)
 static inline ulong32 ROL(ulong32 word, int i)
 {
 {
@@ -289,6 +291,7 @@ static inline ulong32 ROR(ulong32 word, int i)
 #endif
 #endif
 
 
 #elif !defined(__STRICT_ANSI__) && defined(LTC_PPC32)
 #elif !defined(__STRICT_ANSI__) && defined(LTC_PPC32)
+#define LTC_ROx_ASM
 
 
 static inline ulong32 ROL(ulong32 word, int i)
 static inline ulong32 ROL(ulong32 word, int i)
 {
 {

+ 6 - 0
src/misc/crypt/crypt.c

@@ -400,6 +400,12 @@ const char *crypt_build_settings =
 #if defined(LTC_NO_ASM)
 #if defined(LTC_NO_ASM)
     " LTC_NO_ASM "
     " LTC_NO_ASM "
 #endif
 #endif
+#if defined(LTC_ROx_ASM)
+    " LTC_ROx_ASM "
+#if defined(LTC_NO_ROLC)
+    " LTC_NO_ROLC "
+#endif
+#endif
 #if defined(LTC_NO_TEST)
 #if defined(LTC_NO_TEST)
     " LTC_NO_TEST "
     " LTC_NO_TEST "
 #endif
 #endif