Well, report is here. I wish I could compile both for i386 and x86_64, but
at least it worked for x86_64.

Mac OS X 10.8.4 (our IT is darn slow updating to 10.8.5 :), MacBook Pro
Core i7 2.7 GHz.

For "cryptest.exe b > cryptest-gcc.html" with gcc-4.9 and native assembler:

real 3m36.878s
user 3m34.604s
sys 0m2.253s

For "cryptest.exe b > cryptest-clang.html" with Xcode-5.0:

real 3m38.096s
user 3m35.491s
sys 0m2.603s


Representative difference proving that using clang is not a good choice for
crypto++:

-------------------------------------------------------------------
Cipher/Mode               |    GCC-4.9     |   Xcode-5.0   |
                                   |     MB/sec       |    MB/sec      |
--------------------------- +------------------+-----------------|
AES/GCM                            964                    146      |     6+
better
AES/CTR 128bit key          2535                    163      |   15+ times
better
AES/CTR 256bit key          1856                    140      |   13+ times
better
GMAC/AES                        1556                  1045      |   1.4+
times better
CMAC/AES                          590                    177      |    3.3+
times better

      |
ECDSA GFp 256 sig           0.82 ms          0.89 ms   |
ECDSA GFp 256 ver          2.43 ms           2.82 ms   |
------------------------------------------------------------------

On Tue, Oct 1, 2013 at 12:30 PM, Mouse <[email protected]> wrote:

> Jeffrey,
>
> Thank you very much for pointing out the work-arounds for AS. That's
> indeed what is causing the observed problem: GNU assembler that stupid
> Apple keeps is v1.38. To keep things simple, I've just replaced
> /opt/local/bin/as with the script that
>
> The reason I do NOT want to "just use clang" is that clang seems to have
> no clue about AESNI, so all the optimizations and speedups would be lost.
>
> One problem I seem to be having with using gcc-4.9 and clang-assembler is
> that now it refuses to build "-arch x86_64 -arch i386", refusing to use
> /opt/local/lib/libgcc/<someting> because it's not for i386, and complaining
> about being unable to resolve i386 names.
>
> What I will do is (a) compile crypto++-5.6.2 with gcc-4.9 (and native
> assembler :) for x86_64, (b) compile crypto++-5.6.2 with Xcode (clang++)
> for x86+64, and (c) compare the benchmarks (cryptest.exe b) between the two
> and post the results here. If the difference is small - I'll concede that
> using clang is the best way to go forward.
>
>
>
> On Tue, Oct 1, 2013 at 12:58 AM, Jeffrey Walton <[email protected]>wrote:
>
>>
>>
>> On Tuesday, October 1, 2013 12:55:26 AM UTC-4, Jeffrey Walton wrote:
>>
>>>
>>>
>>> On Monday, September 30, 2013 8:05:29 PM UTC-4, Mouse wrote:
>>>
>>>> Solution proposed in http://www.cryptopp.com/**wiki/Linux#No_such_**
>>>> instruction:_pclmulqdq<http://www.cryptopp.com/wiki/Linux#No_such_instruction:_pclmulqdq>
>>>>  did
>>>> not help (well, another solution that page suggested was disabling AESNI
>>>> via -DCRYPTOPP_DISABLE_AESNI=1 - which wouldn't be my choice of solution).
>>>> I wonder why g++-4.9 seems to have a problem with PCLMULQDQ instruction,
>>>> which was supposed to be supported/included since gcc-4.4?
>>>>
>>>> g++ -DNDEBUG -g -O2 -D__STRICT_ANSI__=1 -fPIC -ffunction-sections
>>>> -fdata-sections -maes -mpclmul -mtune=core-avx-i -arch x86_64 -arch i386
>>>> -DCRYPTOPP_DISABLE_ASM -pipe -c gcm.cpp
>>>> :55:no such instruction: `pclmulqdq $1, %xmm7,%xmm2'
>>>> :52:no such instruction: `pclmulqdq $1, %xmm6,%xmm5'
>>>> :66:no such instruction: `pclmulqdq $1, (%esp),%xmm2'
>>>> ....and much more like these......
>>>>
>>>> Mac OS X 10.8.4, Xcode-5.0, gcc-4.9 (via macports). cryptopp-5.6.2
>>>>
>>> It almost sounds like you got GCC 4.9, but you're using old Binutils.
>>> Can you verify you have an updated AS on path?
>>>
>>>
>>> Have you had a look at http://stackoverflow.com/**
>>> questions/9840207/how-to-use-**avx-pclmulqdq-on-mac-os-x-lion<http://stackoverflow.com/questions/9840207/how-to-use-avx-pclmulqdq-on-mac-os-x-lion>
>>> **?
>>>
>>
>> By the way, I would personally just:
>>
>>     export CC=/usr/local/bin/clang; export CXX=/usr/local/bin/clang++
>>     make
>>
>> If you use clang++, open the GNUMakefile and change "clang version" to
>> "clang":
>>
>>     CLANG_COMPILER = $(shell $(CXX) --version 2>&1 | $(EGREP) -i -c
>> "clang")
>>
>> Jeff
>>
>
>
>
> --
> Regards,
> Mouse
>
>


-- 
Regards,
Mouse

-- 
-- 
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [email protected].
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
CPU frequency of the test platform was not provided.
AlgorithmMiB/SecondMicroseconds to
Setup Key and IV
AES/GCM9640.459
AES/CCM4900.305
AES/EAX4880.390
GMAC(AES)15560.460
VMAC(AES)-6448520.728
VMAC(AES)-12831270.839
HMAC(SHA-1)4560.267
Two-Track-MAC2520.012
CMAC(AES)5900.137
DMAC(AES)6090.414
CRC32455
Adler321915
MD5574
SHA-1447
SHA-256212
SHA-512333
SHA-3-224289
SHA-3-256265
SHA-3-384200
SHA-3-512142
Tiger516
Whirlpool113
RIPEMD-160261
RIPEMD-320292
RIPEMD-128386
RIPEMD-256440
Panama-LE10761.004
Panama-BE9611.014
Salsa204300.143
Salsa20/126630.185
Salsa20/89040.188
Sosemanuk12100.455
MARC43821.437
SEAL-3.0-LE72023.194
WAKE-OFB-LE3352.020
AES/CTR (128-bit key)25350.238
AES/CTR (192-bit key)21570.234
AES/CTR (256-bit key)18560.251
AES/CBC (128-bit key)6090.179
AES/CBC (192-bit key)5150.173
AES/CBC (256-bit key)4480.192
AES/OFB (128-bit key)5660.249
AES/CFB (128-bit key)5840.254
AES/ECB (128-bit key)29970.075
Camellia/CTR (128-bit key)1450.209
Camellia/CTR (256-bit key)1120.239
Twofish/CTR1622.305
Serpent/CTR800.452
CAST-256/CTR1031.024
RC6/CTR1881.780
MARS/CTR1301.455
SHACAL-2/CTR (128-bit key)1640.318
SHACAL-2/CTR (512-bit key)1640.322
DES/CTR722.347
DES-XEX3/CTR652.435
DES-EDE3/CTR267.497
IDEA/CTR950.251
RC5 (r=16)2061.575
Blowfish/CTR11333.387
TEA/CTR370.209
XTEA/CTR340.209
CAST-128/CTR1060.313
SKIPJACK/CTR421.759
SEED/CTR (1/2 K table)620.253
OperationMilliseconds/Operation
RSA 1024 Encryption0.02
RSA 1024 Decryption0.38
LUC 1024 Encryption0.02
LUC 1024 Decryption0.70
DLIES 1024 Encryption0.23
DLIES 1024 Encryption with precomputation0.49
DLIES 1024 Decryption0.37
LUCELG 512 Encryption0.15
LUCELG 512 Encryption with precomputation0.15
LUCELG 512 Decryption0.21
RSA 2048 Encryption0.05
RSA 2048 Decryption1.62
LUC 2048 Encryption0.05
LUC 2048 Decryption2.83
DLIES 2048 Encryption1.14
DLIES 2048 Encryption with precomputation1.38
DLIES 2048 Decryption1.15
LUCELG 1024 Encryption0.52
LUCELG 1024 Encryption with precomputation0.51
LUCELG 1024 Decryption0.52
RSA 1024 Signature0.38
RSA 1024 Verification0.02
RW 1024 Signature0.60
RW 1024 Verification0.01
LUC 1024 Signature0.71
LUC 1024 Verification0.02
NR 1024 Signature0.13
NR 1024 Signature with precomputation0.16
NR 1024 Verification0.14
NR 1024 Verification with precomputation0.25
DSA 1024 Signature0.13
DSA 1024 Signature with precomputation0.16
DSA 1024 Verification0.14
DSA 1024 Verification with precomputation0.24
LUC-HMP 512 Signature0.15
LUC-HMP 512 Signature with precomputation0.16
LUC-HMP 512 Verification0.16
LUC-HMP 512 Verification with precomputation0.16
ESIGN 1023 Signature0.07
ESIGN 1023 Verification0.02
ESIGN 1536 Signature0.11
ESIGN 1536 Verification0.04
RSA 2048 Signature1.69
RSA 2048 Verification0.04
RW 2048 Signature2.22
RW 2048 Verification0.03
LUC 2048 Signature2.83
LUC 2048 Verification0.05
NR 2048 Signature0.57
NR 2048 Signature with precomputation0.31
NR 2048 Verification0.66
NR 2048 Verification with precomputation0.51
LUC-HMP 1024 Signature0.54
LUC-HMP 1024 Signature with precomputation0.53
LUC-HMP 1024 Verification0.53
LUC-HMP 1024 Verification with precomputation0.53
ESIGN 2046 Signature0.13
ESIGN 2046 Verification0.04
XTR-DH 171 Key-Pair Generation0.19
XTR-DH 171 Key Agreement0.37
XTR-DH 342 Key-Pair Generation0.49
XTR-DH 342 Key Agreement0.98
DH 1024 Key-Pair Generation0.12
DH 1024 Key-Pair Generation with precomputation0.25
DH 1024 Key Agreement0.38
DH 2048 Key-Pair Generation0.58
DH 2048 Key-Pair Generation with precomputation0.70
DH 2048 Key Agreement1.14
LUCDIF 512 Key-Pair Generation0.08
LUCDIF 512 Key-Pair Generation with precomputation0.08
LUCDIF 512 Key Agreement0.19
LUCDIF 1024 Key-Pair Generation0.27
LUCDIF 1024 Key-Pair Generation with precomputation0.27
LUCDIF 1024 Key Agreement0.52
MQV 1024 Key-Pair Generation0.11
MQV 1024 Key-Pair Generation with precomputation0.14
MQV 1024 Key Agreement0.24
MQV 2048 Key-Pair Generation0.58
MQV 2048 Key-Pair Generation with precomputation0.29
MQV 2048 Key Agreement1.06
ECIES over GF(p) 256 Encryption1.61
ECIES over GF(p) 256 Encryption with precomputation1.33
ECIES over GF(p) 256 Decryption1.11
ECDSA over GF(p) 256 Signature0.82
ECDSA over GF(p) 256 Signature with precomputation0.68
ECDSA over GF(p) 256 Verification2.43
ECDSA over GF(p) 256 Verification with precomputation1.14
ECDHC over GF(p) 256 Key-Pair Generation0.80
ECDHC over GF(p) 256 Key-Pair Generation with precomputation0.66
ECDHC over GF(p) 256 Key Agreement0.80
ECMQVC over GF(p) 256 Key-Pair Generation0.81
ECMQVC over GF(p) 256 Key-Pair Generation with precomputation0.66
ECMQVC over GF(p) 256 Key Agreement2.39
ECIES over GF(2^n) 233 Encryption6.82
ECIES over GF(2^n) 233 Encryption with precomputation2.09
ECIES over GF(2^n) 233 Decryption3.89
ECDSA over GF(2^n) 233 Signature3.49
ECDSA over GF(2^n) 233 Signature with precomputation1.09
ECDSA over GF(2^n) 233 Verification4.21
ECDSA over GF(2^n) 233 Verification with precomputation1.82
ECDHC over GF(2^n) 233 Key-Pair Generation3.39
ECDHC over GF(2^n) 233 Key-Pair Generation with precomputation1.04
ECDHC over GF(2^n) 233 Key Agreement3.45
ECMQVC over GF(2^n) 233 Key-Pair Generation3.43
ECMQVC over GF(2^n) 233 Key-Pair Generation with precomputation1.05
ECMQVC over GF(2^n) 233 Key Agreement4.46
Throughput Geometric Average: 1199.79 Test ended at Tue Oct 1 12:21:23 2013 CPU frequency of the test platform was not provided.
AlgorithmMiB/SecondMicroseconds to
Setup Key and IV
AES/GCM (2K tables)1370.709
AES/GCM (64K tables)1465.041
AES/CCM860.281
AES/EAX840.614
GMAC(AES) (2K tables)6930.735
GMAC(AES) (64K tables)10455.111
VMAC(AES)-6478001.421
VMAC(AES)-12835201.728
HMAC(SHA-1)3690.263
Two-Track-MAC3440.014
CMAC(AES)1770.228
DMAC(AES)1760.588
CRC32436
Adler322036
MD5454
SHA-1369
SHA-256196
SHA-512309
SHA-3-224240
SHA-3-256227
SHA-3-384174
SHA-3-512121
Tiger500
Whirlpool100
RIPEMD-160356
RIPEMD-320351
RIPEMD-128521
RIPEMD-256465
Panama-LE9081.162
Panama-BE8351.234
Salsa204120.106
Salsa20/126770.131
Salsa20/89370.131
Sosemanuk11170.500
MARC44091.358
SEAL-3.0-LE75826.775
WAKE-OFB-LE3371.606
AES/CTR (128-bit key)1630.228
AES/CTR (192-bit key)1560.222
AES/CTR (256-bit key)1400.237
AES/CBC (128-bit key)1770.183
AES/CBC (192-bit key)1540.186
AES/CBC (256-bit key)1370.202
AES/OFB (128-bit key)1790.272
AES/CFB (128-bit key)1810.306
AES/ECB (128-bit key)1830.097
Camellia/CTR (128-bit key)1320.175
Camellia/CTR (256-bit key)1020.190
Twofish/CTR1512.658
Serpent/CTR750.515
CAST-256/CTR921.072
RC6/CTR1801.675
MARS/CTR1041.360
SHACAL-2/CTR (128-bit key)1340.299
SHACAL-2/CTR (512-bit key)1350.299
DES/CTR692.610
DES-XEX3/CTR652.623
DES-EDE3/CTR2710.785
IDEA/CTR860.224
RC5 (r=16)1701.421
Blowfish/CTR11332.791
TEA/CTR300.165
XTEA/CTR280.167
CAST-128/CTR1010.289
SKIPJACK/CTR392.391
SEED/CTR (1/2 K table)610.251
OperationMilliseconds/Operation
RSA 1024 Encryption0.02
RSA 1024 Decryption0.44
LUC 1024 Encryption0.03
LUC 1024 Decryption0.77
DLIES 1024 Encryption0.28
DLIES 1024 Encryption with precomputation0.55
DLIES 1024 Decryption0.44
LUCELG 512 Encryption0.18
LUCELG 512 Encryption with precomputation0.18
LUCELG 512 Decryption0.22
RSA 2048 Encryption0.05
RSA 2048 Decryption1.91
LUC 2048 Encryption0.06
LUC 2048 Decryption3.35
DLIES 2048 Encryption1.37
DLIES 2048 Encryption with precomputation1.61
DLIES 2048 Decryption1.28
LUCELG 1024 Encryption0.63
LUCELG 1024 Encryption with precomputation0.63
LUCELG 1024 Decryption0.60
RSA 1024 Signature0.44
RSA 1024 Verification0.02
RW 1024 Signature0.66
RW 1024 Verification0.02
LUC 1024 Signature0.80
LUC 1024 Verification0.03
NR 1024 Signature0.15
NR 1024 Signature with precomputation0.15
NR 1024 Verification0.17
NR 1024 Verification with precomputation0.24
DSA 1024 Signature0.15
DSA 1024 Signature with precomputation0.15
DSA 1024 Verification0.17
DSA 1024 Verification with precomputation0.24
LUC-HMP 512 Signature0.18
LUC-HMP 512 Signature with precomputation0.18
LUC-HMP 512 Verification0.18
LUC-HMP 512 Verification with precomputation0.18
ESIGN 1023 Signature0.08
ESIGN 1023 Verification0.02
ESIGN 1536 Signature0.13
ESIGN 1536 Verification0.04
RSA 2048 Signature1.91
RSA 2048 Verification0.05
RW 2048 Signature2.42
RW 2048 Verification0.03
LUC 2048 Signature3.34
LUC 2048 Verification0.05
NR 2048 Signature0.70
NR 2048 Signature with precomputation0.34
NR 2048 Verification0.81
NR 2048 Verification with precomputation0.53
LUC-HMP 1024 Signature0.63
LUC-HMP 1024 Signature with precomputation0.63
LUC-HMP 1024 Verification0.65
LUC-HMP 1024 Verification with precomputation0.65
ESIGN 2046 Signature0.15
ESIGN 2046 Verification0.05
XTR-DH 171 Key-Pair Generation0.21
XTR-DH 171 Key Agreement0.42
XTR-DH 342 Key-Pair Generation0.60
XTR-DH 342 Key Agreement1.21
DH 1024 Key-Pair Generation0.15
DH 1024 Key-Pair Generation with precomputation0.28
DH 1024 Key Agreement0.42
DH 2048 Key-Pair Generation0.71
DH 2048 Key-Pair Generation with precomputation0.82
DH 2048 Key Agreement1.29
LUCDIF 512 Key-Pair Generation0.09
LUCDIF 512 Key-Pair Generation with precomputation0.09
LUCDIF 512 Key Agreement0.21
LUCDIF 1024 Key-Pair Generation0.32
LUCDIF 1024 Key-Pair Generation with precomputation0.32
LUCDIF 1024 Key Agreement0.59
MQV 1024 Key-Pair Generation0.14
MQV 1024 Key-Pair Generation with precomputation0.15
MQV 1024 Key Agreement0.29
MQV 2048 Key-Pair Generation0.70
MQV 2048 Key-Pair Generation with precomputation0.35
MQV 2048 Key Agreement1.36
ECIES over GF(p) 256 Encryption1.76
ECIES over GF(p) 256 Encryption with precomputation1.53
ECIES over GF(p) 256 Decryption1.21
ECDSA over GF(p) 256 Signature0.89
ECDSA over GF(p) 256 Signature with precomputation0.73
ECDSA over GF(p) 256 Verification2.82
ECDSA over GF(p) 256 Verification with precomputation1.22
ECDHC over GF(p) 256 Key-Pair Generation0.92
ECDHC over GF(p) 256 Key-Pair Generation with precomputation0.75
ECDHC over GF(p) 256 Key Agreement0.91
ECMQVC over GF(p) 256 Key-Pair Generation0.90
ECMQVC over GF(p) 256 Key-Pair Generation with precomputation0.71
ECMQVC over GF(p) 256 Key Agreement2.81
ECIES over GF(2^n) 233 Encryption6.98
ECIES over GF(2^n) 233 Encryption with precomputation2.08
ECIES over GF(2^n) 233 Decryption3.92
ECDSA over GF(2^n) 233 Signature3.63
ECDSA over GF(2^n) 233 Signature with precomputation1.08
ECDSA over GF(2^n) 233 Verification4.30
ECDSA over GF(2^n) 233 Verification with precomputation1.82
ECDHC over GF(2^n) 233 Key-Pair Generation3.52
ECDHC over GF(2^n) 233 Key-Pair Generation with precomputation1.04
ECDHC over GF(2^n) 233 Key Agreement3.47
ECMQVC over GF(2^n) 233 Key-Pair Generation3.44
ECMQVC over GF(2^n) 233 Key-Pair Generation with precomputation1.06
ECMQVC over GF(2^n) 233 Key Agreement4.42
Throughput Geometric Average: 942.67 Test ended at Tue Oct 1 12:36:35 2013

Reply via email to