libtomcrypt compiling

507 views
Skip to first unread message

Giuseppe Triolo

unread,
Apr 29, 2012, 6:22:46 PM4/29/12
to lib...@googlegroups.com
After i type ./configure make make install i am trying to compile the example aes.c inside the directory src/ciphers/aes/aes.c ;  i have the following error:
占쏙옙libtomcrypt-1.17/src/ciphers/aes#    gcc -o aes aes.c
In file included from /usr/include/tomcrypt.h:67,
                 from aes.c:33:
/usr/include/tomcrypt_macros.h: In function 'RORc':
/usr/include/tomcrypt_macros.h:275: error impossible contraint in 'asm' 

How can i compile it ?
Thanks

Giuseppe Triolo

unread,
Jun 27, 2012, 11:23:38 AM6/27/12
to lib...@googlegroups.com

Ubunti 12.04 on Virtual machine!

Date: Wed, 27 Jun 2012 07:08:15 -0700
From: jfvo...@gmail.com
To: lib...@googlegroups.com
Subject: [libtom] Re: libtomcrypt compiling

what OS are you using?
--
You received this message because you are subscribed to the Google Groups "LibTom Projects" group.
To view this discussion on the web visit https://groups.google.com/d/msg/libtom/-/exsJ1nGDcxgJ.
To post to this group, send email to lib...@googlegroups.com.
To unsubscribe from this group, send email to libtom+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/libtom?hl=en.

yinx...@gmail.com

unread,
May 23, 2016, 9:50:00 AM5/23/16
to LibTom Projects

hi, have you found the solution?

georg....@gmail.com

unread,
Jul 14, 2016, 4:19:29 PM7/14/16
to LibTom Projects, yinx...@gmail.com
In the BitKeeper source, we've been carrying this patch around for awhile (we first saw the same errors as the original poster on Macs using Apple's toolchain).

(also, the "develop" branch on github solves the problem differently)

-g


src/headers/tomcrypt_macros.h@1.22, 2015-06-09 09:27:59-04:00, wscott@bitkeeper.com
  x86 only allows variable shifts
and rotates with the CL register.
 
Change the inline asm to use CL explicitly and update the constraints to
  reflect that
.
===== tomcrypt_macros.h 1.21 vs 1.22 =====

--- 1.21/src/tomcrypt/src/headers/tomcrypt_macros.h 2015-03-24 14:45:42 -04:00
+++ 1.22/src/tomcrypt/src/headers/tomcrypt_macros.h 2015-06-09 09:27:59 -04:00
@@ -264,17 +264,17 @@ static inline unsigned ROLc(unsigned wor
 
 
static inline unsigned ROLc(unsigned word, const int i)
 
{
-   asm ("roll %2,%0"
+   asm ("roll %%cl,%0"
       
:"=r" (word)
-      :"0" (word),"I" (i));
+      :"0" (word),"c" (i));
   
return word;
 
}
 
 
static inline unsigned RORc(unsigned word, const int i)
 
{
-   asm ("rorl %2,%0"
+   asm ("rorl %%cl,%0"
       
:"=r" (word)
-      :"0" (word),"I" (i));
+      :"0" (word),"c" (i));
   
return word;
 
}
 
@@ -363,17 +363,17 @@ static inline unsigned long ROL64c(unsig
 
 
static inline unsigned long ROL64c(unsigned long word, const int i)
 
{
-   asm("rolq %2,%0"
+   asm("rolq %%cl,%0"
       
:"=r" (word)
-      :"0" (word),"J" (i));
+      :"0" (word),"c" (i));
   
return word;
 
}
 
 
static inline unsigned long ROR64c(unsigned long word, const int i)
 
{
-   asm("rorq %2,%0"
+   asm("rorq %%cl,%0"
       
:"=r" (word)
-      :"0" (word),"J" (i));
+      :"0" (word),"c" (i));
   
return word;
 
}

Reply all
Reply to author
Forward
0 new messages