Is it possible to compile Crypto++ on OS X with ASM enabled?

37 views
Skip to first unread message

Siyuan Ren

unread,
Apr 9, 2015, 4:21:16 AM4/9/15
to cryptop...@googlegroups.com
I find a thread several years ago detailing why ASM is disabled on OS X. I just wonder if this has changed.

I did a little test and CommonCrypto (the crypto API provided by OS X itself) is consistently 50% faster than Crypto++, probably due to the use of AES-NI. Performance is very important to me because I need to encrypt/decrypt very large files on the fly.

Mobile Mouse

unread,
Apr 9, 2015, 7:02:10 AM4/9/15
to Siyuan Ren, cryptop...@googlegroups.com
What you need is adding the AES-NI and PCMUL flags to CXXFLAGS. I think I posted my GNUmakefile here several times. 

Sent from my iPad

On Apr 9, 2015, at 04:21, Siyuan Ren <nethe...@gmail.com> wrote:

I find a thread several years ago detailing why ASM is disabled on OS X. I just wonder if this has changed.

I did a little test and CommonCrypto (the crypto API provided by OS X itself) is consistently 50% faster than Crypto++, probably due to the use of AES-NI. Performance is very important to me because I need to encrypt/decrypt very large files on the fly.

--
--
You received this message because you are subscribed to the "Crypto++ Users" Google Group.
To unsubscribe, send an email to cryptopp-user...@googlegroups.com.
More information about Crypto++ and this group is available at http://www.cryptopp.com.
---
You received this message because you are subscribed to the Google Groups "Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cryptopp-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Siyuan Ren

unread,
Apr 9, 2015, 11:01:04 AM4/9/15
to cryptop...@googlegroups.com, nethe...@gmail.com
The problem is not with the flags, but that OS X comes with an outdated GNU Assembler. I am wondering if there are any workarounds.

Jeffrey Walton

unread,
Apr 9, 2015, 2:35:32 PM4/9/15
to cryptop...@googlegroups.com, nethe...@gmail.com


On Thursday, April 9, 2015 at 11:01:04 AM UTC-4, Siyuan Ren wrote:
The problem is not with the flags, but that OS X comes with an outdated GNU Assembler. I am wondering if there are any workarounds.

You might be able to install a newer version of AS through Binutils directly, through Macports, or Brew (I think its called Brew).

If you try a new AS, then you may need to tweak the GNUmakefile to enable ASM on OS X. I think the lines start around 75:

ifeq ($(GAS210_OR_LATER),0)    # .intel_syntax wasn't supported until GNU assembler 2.10
  CXXFLAGS += -DCRYPTOPP_DISABLE_ASM
else
ifeq ($(GAS217_OR_LATER),0)
  CXXFLAGS += -DCRYPTOPP_DISABLE_SSSE3
else
ifeq ($(GAS219_OR_LATER),0)
  CXXFLAGS += -DCRYPTOPP_DISABLE_AESNI
endif

I have never tried it, so I don't know if it will work.

Jeff
 
Reply all
Reply to author
Forward
0 new messages