问题
Can I use the assembly routines for Serpent encryption in the link below written for 32-bit x86 from a 64-bit program on an x86-64 machine? That is, without launching a separate 32-bit process for it? If not, does anyone have a pointer to an optimized implementation of Serpent that works in both 32 and 64 bit (LGPL is OK but cannot use GPL since it's a commercial project)? http://gladman.plushost.co.uk/oldsite/cryptography_technology/serpent/serpent.asm
回答1:
You will need to convert the portions of the code that transfer the results and data to/from memory to use 64-bit address registers. Also, stack manipulation code will need to use the 64-bit stack registers. Other than that, it's likely to work without major changes.
回答2:
This code seems compatible, at least for me (generally, IA32 assembly is pretty backward-compatible, as sizes of registers do not change, there are just new ones added on x86-64). Also, best way is to check it by yourself.
来源:https://stackoverflow.com/questions/6480201/using-assembly-code-written-for-32-bit-in-64-bit-application