Created SILC Crypto Toolkit git repository.
[crypto.git] / lib / silccrypt / des.c
index cda0ac31f2a77df78bb116246a689d14fbc532b8..75c887eebc737b6fa9607ca6b8f88e0a7d117523 100644 (file)
@@ -3,7 +3,7 @@
 
 /* LibTomCrypt, modular cryptographic library -- Tom St Denis */
 
-#include "silc.h"
+#include "silccrypto.h"
 #include "des_internal.h"
 #include "des.h"
 
@@ -211,19 +211,8 @@ SILC_CIPHER_API_DECRYPT(3des)
 #if defined(_MSC_VER)
 #pragma intrinsic(_lrotr,_lrotl)
 #define RORc(x,n) _lrotr(x,n)
-
-#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && !defined(INTEL_CC)
-
-static inline unsigned RORc(unsigned word, int i)
-{
-   asm ("rorl %%cl,%0"
-      :"=r" (word)
-      :"0" (word),"c" (i));
-   return word;
-}
-
 #else
-#define RORc(x, y) ( ((((unsigned long)(x)&0xFFFFFFFFUL)>>(unsigned long)((y)&31)) | ((unsigned long)(x)<<(unsigned long)(32-((y)&31)))) &0xFFFFFFFFUL)
+#define RORc(x, y) silc_ror(x, y)
 #endif /* _MSC_VER */
 
 static const SilcUInt32 bytebit[8] =