I understand. I've compiled NASM on Mac OS X and it seems to pass all  
the tests.

So while those people are working on porting binutils to Mac OS X -  
perhaps you could isolate assembly code into separate .s (or .asm)  
files that e.g. I could feed to NASM? Because since GNU incorporated  
GAS into binutils, it became a pain-in-the-neck to deal with. I  
personally think that it was a big mistake and a bad move to fold GAS  
into the binutils package.

NASM input syntax is said to be "like Intel but with less complexity".

Thanks!

P.S. Here's an older test-run

, and the current one  (64-bit, cryptopp shared library).

Recommendation: add some machine/cpu data from "cryptest.exe v" to  
cryptest.exe b", so one can identify the compilation etc. conditions  
under which the benchmark tests ran. Or later on (or after you've  
tried several options) these listings become rather useless (unless  
you took precautions and named the files appropriately, which not  
everybody does :-().


On Nov 21, 2009, at  23:16 , Wei Dai wrote:

> There is no easy way to do this, as far as I can tell. Crypto++  
> doesn't actually use GAS directly. It contains inline assembly,  
> which GCC mixes with assembly code that it generates, and then  
> passes on to the assembler. The code that GCC generates is in AT&T  
> syntax, which NASM doesn't support, I think.
>
> BTW, apparently someone is working on getting the latest GAS to work  
> on Mac OS X. See http://gcc.gnu.org/ml/gcc/2009-09/msg00146.html.
>
> --------------------------------------------------
> From: "Mouse" <[email protected]>
> Sent: Wednesday, November 18, 2009 4:38 AM
> To: "Crypto++ Users" <[email protected]>
> Subject: Re: Performance in Mac OS X
>
>> Is it possible to configure Crypto++ to use NASM instead of GAS? If  
>> so
>> - any guidance?
>>
>> I'll post 64-bit Mac OS X numbers later on.
>>
>> On Nov 17, 2009, at  17:27 , Wei Dai wrote:
>>
>>> I'm pretty sure GPLv3 came out way after GNU AS
>>> supported .intel_syntax. I
>>> suspect that Apple doesn't want to upgrade because they've made too
>>> many
>>> changes to the assembler and don't want to port those changes to a
>>> later
>>> version of GNU AS.
>>>
>>> I guess it wouldn't hurt to ask Apple directly. Does anyone know if
>>> they
>>> have an open source outreach/liason person?
>>>
>>> BTW, on 64-bit Mac OS X, the performance difference should be much
>>> smaller,
>>> if you compile Crypto++ into a 64-bit binary. (I don't remember if
>>> that
>>> happens automatically, or if you have to set some compiler flags.)
>>>
>>> --------------------------------------------------
>>> From: "Zooko Wilcox-O'Hearn" <[email protected]>
>>> Sent: Tuesday, November 17, 2009 2:09 PM
>>> To: "Wei Dai" <[email protected]>
>>> Cc: "Jose Cisneros" <[email protected]>; "Crypto++ Users"
>>> <[email protected]>
>>> Subject: Re: Performance in Mac OS X
>>>
>>>> On Tuesday, 2009-11-17, at 13:47 , Wei Dai wrote:
>>>>
>>>>> That's because the assembler in Mac OS X is based on a very old
>>>>> version
>>>>> of GNU AS, which doesn't support .intel_syntax. The  assembly code
>>>>> in
>>>>> Crypto++ is written in Intel syntax to be  compatible with  
>>>>> Microsoft
>>>>> compilers/assemblers.
>>>>
>>>>
>>>> It is indeed a very old version.  It calls itself "v1.38".  GNU AS
>>>> v1.38
>>>> was released so long ago that I can't figure out when it was.   It
>>>> was
>>>> released before 1996, and probably many years before 1996.
>>>>
>>>> I think that Apple refuses to upgrade to the new GNU assembler
>>>> because
>>>> the new one is under GPLv3 and Apple doesn't like that.
>>>>
>>>> So, I don't know if or how this situation is ever going to be
>>>> improved.
>>>> Apple will patch its ancient version of as to do the new  syntax?
>>>> Wei Dai
>>>> will write old-style-syntax variants of all his  assembly just for
>>>> Mac OS
>>>> X?  Apple will give up and accept GPLv3- licensed assembler?  All
>>>> Apple
>>>> users will instead install some open  source operating system on
>>>> their
>>>> machines?
>>>>
>>>> I guess what will happen is Crypto++ will continue to be much
>>>> slower  on
>>>> Mac OS X than on other systems.  Maybe this doesn't matter in
>>>> practice.
>>>> Just how slow is it?  Slow enough that it diminishes your  battery
>>>> life?
>>>> Slow enough that it worsens the user experience?
>>>>
>>>> Maybe someone who cares about this issue should write to Apple and
>>>> request that their assembler support Intel syntax.
>>>>
>>>> Regards,
>>>>
>>>> Zooko
>>>>
>>>
>>> -- 
>>> 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 "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 "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.
CPU frequency of the test platform was not provided.
AlgorithmMiB/SecondMicroseconds to
Setup Key and IV
AES/GCM (2K tables)322.782
AES/GCM (64K tables)378.998
AES/CCM220.766
AES/EAX221.931
GMAC(AES) (2K tables)1092.757
GMAC(AES) (64K tables)2018.983
VMAC(AES)-645124.717
VMAC(AES)-1282725.777
HMAC(SHA-1)1980.699
Two-Track-MAC1310.040
CMAC(AES)450.666
DMAC(AES)451.665
CRC32419
Adler321246
MD5339
SHA-1198
SHA-25673
SHA-51234
Tiger90
Whirlpool20
RIPEMD-160105
RIPEMD-320114
RIPEMD-128192
RIPEMD-256201
Panama-LE2913.579
Panama-BE2693.728
Salsa201750.333
Salsa20/122490.383
Salsa20/83190.383
Sosemanuk3401.002
MARC41503.333
SEAL-3.0-LE41150.768
WAKE-OFB-LE2713.698
AES/CTR (128-bit key)450.594
AES/CTR (192-bit key)390.618
AES/CTR (256-bit key)340.653
AES/CBC (128-bit key)440.460
AES/CBC (192-bit key)380.483
AES/CBC (256-bit key)340.523
AES/OFB (128-bit key)440.582
AES/CFB (128-bit key)450.916
AES/ECB (128-bit key)460.242
Camellia/CTR (128-bit key)710.580
Camellia/CTR (256-bit key)560.668
Twofish/CTR605.682
Serpent/CTR430.938
CAST-256/CTR562.020
RC6/CTR882.544
MARS/CTR642.349
SHACAL-2/CTR (128-bit key)610.817
SHACAL-2/CTR (512-bit key)610.876
DES/CTR377.067
DES-XEX3/CTR347.364
DES-EDE3/CTR1421.293
IDEA/CTR460.707
RC5 (r=16)1042.223
Blowfish/CTR7648.266
TEA/CTR390.521
XTEA/CTR170.517
CAST-128/CTR460.986
SKIPJACK/CTR262.510
SEED/CTR (1/2 K table)410.694
OperationMilliseconds/Operation
RSA 1024 Encryption0.14
RSA 1024 Decryption4.12
LUC 1024 Encryption0.17
LUC 1024 Decryption6.90
DLIES 1024 Encryption4.61
DLIES 1024 Encryption with precomputation3.88
DLIES 1024 Decryption2.98
LUCELG 512 Encryption2.07
LUCELG 512 Encryption with precomputation2.06
LUCELG 512 Decryption1.26
RSA 2048 Encryption0.39
RSA 2048 Decryption29.10
LUC 2048 Encryption0.52
LUC 2048 Decryption48.91
DLIES 2048 Encryption21.96
DLIES 2048 Encryption with precomputation19.06
DLIES 2048 Decryption12.57
LUCELG 1024 Encryption10.50
LUCELG 1024 Encryption with precomputation10.67
LUCELG 1024 Decryption5.97
RSA 1024 Signature4.07
RSA 1024 Verification0.14
RW 1024 Signature4.40
RW 1024 Verification0.06
LUC 1024 Signature6.91
LUC 1024 Verification0.17
NR 1024 Signature2.34
NR 1024 Signature with precomputation0.93
NR 1024 Verification2.65
NR 1024 Verification with precomputation1.52
DSA 1024 Signature2.28
DSA 1024 Signature with precomputation0.92
DSA 1024 Verification2.65
DSA 1024 Verification with precomputation1.44
LUC-HMP 512 Signature2.03
LUC-HMP 512 Signature with precomputation2.02
LUC-HMP 512 Verification2.04
LUC-HMP 512 Verification with precomputation2.06
ESIGN 1023 Signature0.35
ESIGN 1023 Verification0.13
ESIGN 1536 Signature0.84
ESIGN 1536 Verification0.37
RSA 2048 Signature29.05
RSA 2048 Verification0.40
RW 2048 Signature29.86
RW 2048 Verification0.13
LUC 2048 Signature48.83
LUC 2048 Verification0.51
NR 2048 Signature11.21
NR 2048 Signature with precomputation3.37
NR 2048 Verification12.53
NR 2048 Verification with precomputation5.43
LUC-HMP 1024 Signature10.83
LUC-HMP 1024 Signature with precomputation10.65
LUC-HMP 1024 Verification10.83
LUC-HMP 1024 Verification with precomputation10.83
ESIGN 2046 Signature0.97
ESIGN 2046 Verification0.39
XTR-DH 171 Key-Pair Generation1.58
XTR-DH 171 Key Agreement3.13
XTR-DH 342 Key-Pair Generation6.72
XTR-DH 342 Key Agreement13.50
DH 1024 Key-Pair Generation2.37
DH 1024 Key-Pair Generation with precomputation1.96
DH 1024 Key Agreement2.90
DH 2048 Key-Pair Generation11.04
DH 2048 Key-Pair Generation with precomputation9.72
DH 2048 Key Agreement12.58
LUCDIF 512 Key-Pair Generation1.03
LUCDIF 512 Key-Pair Generation with precomputation1.03
LUCDIF 512 Key Agreement1.29
LUCDIF 1024 Key-Pair Generation5.21
LUCDIF 1024 Key-Pair Generation with precomputation5.25
LUCDIF 1024 Key Agreement5.80
MQV 1024 Key-Pair Generation2.32
MQV 1024 Key-Pair Generation with precomputation0.89
MQV 1024 Key Agreement4.31
MQV 2048 Key-Pair Generation11.04
MQV 2048 Key-Pair Generation with precomputation3.34
MQV 2048 Key Agreement19.94
ECIES over GF(p) 256 Encryption8.29
ECIES over GF(p) 256 Encryption with precomputation5.30
ECIES over GF(p) 256 Decryption5.32
ECDSA over GF(p) 256 Signature4.11
ECDSA over GF(p) 256 Signature with precomputation2.71
ECDSA over GF(p) 256 Verification11.84
ECDSA over GF(p) 256 Verification with precomputation4.43
ECDHC over GF(p) 256 Key-Pair Generation4.12
ECDHC over GF(p) 256 Key-Pair Generation with precomputation2.68
ECDHC over GF(p) 256 Key Agreement4.13
ECMQVC over GF(p) 256 Key-Pair Generation4.09
ECMQVC over GF(p) 256 Key-Pair Generation with precomputation2.65
ECMQVC over GF(p) 256 Key Agreement11.88
ECIES over GF(2^n) 233 Encryption19.08
ECIES over GF(2^n) 233 Encryption with precomputation5.45
ECIES over GF(2^n) 233 Decryption10.91
ECNR over GF(2^n) 233 Signature9.68
ECNR over GF(2^n) 233 Signature with precomputation2.80
ECNR over GF(2^n) 233 Verification12.06
ECNR over GF(2^n) 233 Verification with precomputation4.67
ECDHC over GF(2^n) 233 Key-Pair Generation9.61
ECDHC over GF(2^n) 233 Key-Pair Generation with precomputation2.72
ECDHC over GF(2^n) 233 Key Agreement9.57
ECMQVC over GF(2^n) 233 Key-Pair Generation9.61
ECMQVC over GF(2^n) 233 Key-Pair Generation with precomputation2.72
ECMQVC over GF(2^n) 233 Key Agreement12.07
Throughput Geometric Average: 186.53 Test ended at Fri Apr 3 10:38:03 2009
, and the current one 
CPU frequency of the test platform was not provided.
AlgorithmMiB/SecondMicroseconds to
Setup Key and IV
AES/GCM (2K tables)831.621
AES/GCM (64K tables)8211.323
AES/CCM610.550
AES/EAX611.073
GMAC(AES) (2K tables)2571.626
GMAC(AES) (64K tables)25211.309
VMAC(AES)-6434812.106
VMAC(AES)-12813052.509
HMAC(SHA-1)2670.442
Two-Track-MAC1640.032
CMAC(AES)1220.400
DMAC(AES)1211.050
CRC32417
Adler321575
MD5419
SHA-1266
SHA-256112
SHA-512176
Tiger346
Whirlpool48
RIPEMD-160170
RIPEMD-320184
RIPEMD-128257
RIPEMD-256286
Panama-LE3992.452
Panama-BE2933.158
Salsa202280.189
Salsa20/123290.228
Salsa20/84180.228
Sosemanuk3031.151
MARC42182.421
SEAL-3.0-LE57734.264
WAKE-OFB-LE2852.481
AES/CTR (128-bit key)1220.389
AES/CTR (192-bit key)1050.383
AES/CTR (256-bit key)920.411
AES/CBC (128-bit key)1210.317
AES/CBC (192-bit key)1040.314
AES/CBC (256-bit key)910.343
AES/OFB (128-bit key)1220.371
AES/CFB (128-bit key)1220.503
AES/ECB (128-bit key)1250.183
Camellia/CTR (128-bit key)820.313
Camellia/CTR (256-bit key)650.357
Twofish/CTR1074.312
Serpent/CTR490.818
CAST-256/CTR591.401
RC6/CTR893.813
MARS/CTR1041.857
SHACAL-2/CTR (128-bit key)920.492
SHACAL-2/CTR (512-bit key)920.542
DES/CTR476.772
DES-XEX3/CTR446.970
DES-EDE3/CTR1920.664
IDEA/CTR460.392
RC5 (r=16)1043.200
Blowfish/CTR8939.915
TEA/CTR390.307
XTEA/CTR360.298
CAST-128/CTR760.546
SKIPJACK/CTR343.285
SEED/CTR (1/2 K table)350.413
OperationMilliseconds/Operation
RSA 1024 Encryption0.05
RSA 1024 Decryption0.90
LUC 1024 Encryption0.05
LUC 1024 Decryption1.59
DLIES 1024 Encryption0.57
DLIES 1024 Encryption with precomputation1.03
DLIES 1024 Decryption0.78
LUCELG 512 Encryption0.39
LUCELG 512 Encryption with precomputation0.39
LUCELG 512 Decryption0.43
RSA 2048 Encryption0.10
RSA 2048 Decryption3.97
LUC 2048 Encryption0.11
LUC 2048 Decryption6.65
DLIES 2048 Encryption2.96
DLIES 2048 Encryption with precomputation3.30
DLIES 2048 Decryption2.52
LUCELG 1024 Encryption1.30
LUCELG 1024 Encryption with precomputation1.30
LUCELG 1024 Decryption1.15
RSA 1024 Signature0.94
RSA 1024 Verification0.05
RW 1024 Signature1.28
RW 1024 Verification0.03
LUC 1024 Signature1.58
LUC 1024 Verification0.05
NR 1024 Signature0.31
NR 1024 Signature with precomputation0.27
NR 1024 Verification0.36
NR 1024 Verification with precomputation0.41
DSA 1024 Signature0.30
DSA 1024 Signature with precomputation0.27
DSA 1024 Verification0.35
DSA 1024 Verification with precomputation0.40
LUC-HMP 512 Signature0.38
LUC-HMP 512 Signature with precomputation0.38
LUC-HMP 512 Verification0.39
LUC-HMP 512 Verification with precomputation0.39
ESIGN 1023 Signature0.14
ESIGN 1023 Verification0.04
ESIGN 1536 Signature0.24
ESIGN 1536 Verification0.09
RSA 2048 Signature3.94
RSA 2048 Verification0.10
RW 2048 Signature4.78
RW 2048 Verification0.05
LUC 2048 Signature6.72
LUC 2048 Verification0.11
NR 2048 Signature1.52
NR 2048 Signature with precomputation0.64
NR 2048 Verification1.75
NR 2048 Verification with precomputation1.02
LUC-HMP 1024 Signature1.31
LUC-HMP 1024 Signature with precomputation1.32
LUC-HMP 1024 Verification1.31
LUC-HMP 1024 Verification with precomputation1.40
ESIGN 2046 Signature0.29
ESIGN 2046 Verification0.09
XTR-DH 171 Key-Pair Generation0.47
XTR-DH 171 Key Agreement0.93
XTR-DH 342 Key-Pair Generation1.32
XTR-DH 342 Key Agreement2.61
DH 1024 Key-Pair Generation0.30
DH 1024 Key-Pair Generation with precomputation0.52
DH 1024 Key Agreement0.77
DH 2048 Key-Pair Generation1.50
DH 2048 Key-Pair Generation with precomputation1.66
DH 2048 Key Agreement2.51
LUCDIF 512 Key-Pair Generation0.20
LUCDIF 512 Key-Pair Generation with precomputation0.20
LUCDIF 512 Key Agreement0.41
LUCDIF 1024 Key-Pair Generation0.67
LUCDIF 1024 Key-Pair Generation with precomputation0.66
LUCDIF 1024 Key Agreement1.12
MQV 1024 Key-Pair Generation0.28
MQV 1024 Key-Pair Generation with precomputation0.25
MQV 1024 Key Agreement0.57
MQV 2048 Key-Pair Generation1.48
MQV 2048 Key-Pair Generation with precomputation0.61
MQV 2048 Key Agreement2.78
ECIES over GF(p) 256 Encryption3.30
ECIES over GF(p) 256 Encryption with precomputation2.68
ECIES over GF(p) 256 Decryption2.28
ECDSA over GF(p) 256 Signature1.68
ECDSA over GF(p) 256 Signature with precomputation1.39
ECDSA over GF(p) 256 Verification5.32
ECDSA over GF(p) 256 Verification with precomputation2.33
ECDHC over GF(p) 256 Key-Pair Generation1.69
ECDHC over GF(p) 256 Key-Pair Generation with precomputation1.35
ECDHC over GF(p) 256 Key Agreement1.66
ECMQVC over GF(p) 256 Key-Pair Generation1.66
ECMQVC over GF(p) 256 Key-Pair Generation with precomputation1.35
ECMQVC over GF(p) 256 Key Agreement5.25
ECIES over GF(2^n) 233 Encryption10.49
ECIES over GF(2^n) 233 Encryption with precomputation3.17
ECIES over GF(2^n) 233 Decryption5.88
ECNR over GF(2^n) 233 Signature5.22
ECNR over GF(2^n) 233 Signature with precomputation1.65
ECNR over GF(2^n) 233 Verification6.40
ECNR over GF(2^n) 233 Verification with precomputation2.86
ECDHC over GF(2^n) 233 Key-Pair Generation5.23
ECDHC over GF(2^n) 233 Key-Pair Generation with precomputation1.63
ECDHC over GF(2^n) 233 Key Agreement5.17
ECMQVC over GF(2^n) 233 Key-Pair Generation5.30
ECMQVC over GF(2^n) 233 Key-Pair Generation with precomputation1.59
ECMQVC over GF(2^n) 233 Key Agreement6.47
Throughput Geometric Average: 545.10 Test ended at Sun Nov 22 11:35:40 2009
 (64-bit, cryptopp shared library). 

Recommendation: add some machine/cpu data from "cryptest.exe v" to cryptest.exe b", so one can identify the compilation etc. conditions under which the benchmark tests ran. Or later on (or after you've tried several options) these listings become rather useless (unless you took precautions and named the files appropriately, which not everybody does :-().


On Nov 21, 2009, at  23:16 , Wei Dai wrote:

There is no easy way to do this, as far as I can tell. Crypto++ doesn't actually use GAS directly. It contains inline assembly, which GCC mixes with assembly code that it generates, and then passes on to the assembler. The code that GCC generates is in AT&T syntax, which NASM doesn't support, I think.

BTW, apparently someone is working on getting the latest GAS to work on Mac OS X. See http://gcc.gnu.org/ml/gcc/2009-09/msg00146.html.

--------------------------------------------------
From: "Mouse" <[email protected]>
Sent: Wednesday, November 18, 2009 4:38 AM
To: "Crypto++ Users" <[email protected]>
Subject: Re: Performance in Mac OS X

Is it possible to configure Crypto++ to use NASM instead of GAS? If so
- any guidance?

I'll post 64-bit Mac OS X numbers later on.

On Nov 17, 2009, at  17:27 , Wei Dai wrote:

I'm pretty sure GPLv3 came out way after GNU AS
supported .intel_syntax. I
suspect that Apple doesn't want to upgrade because they've made too
many
changes to the assembler and don't want to port those changes to a
later
version of GNU AS.

I guess it wouldn't hurt to ask Apple directly. Does anyone know if
they
have an open source outreach/liason person?

BTW, on 64-bit Mac OS X, the performance difference should be much
smaller,
if you compile Crypto++ into a 64-bit binary. (I don't remember if
that
happens automatically, or if you have to set some compiler flags.)

--------------------------------------------------
From: "Zooko Wilcox-O'Hearn" <[email protected]>
Sent: Tuesday, November 17, 2009 2:09 PM
To: "Wei Dai" <[email protected]>
Cc: "Jose Cisneros" <[email protected]>; "Crypto++ Users"
<[email protected]>
Subject: Re: Performance in Mac OS X

On Tuesday, 2009-11-17, at 13:47 , Wei Dai wrote:

That's because the assembler in Mac OS X is based on a very old
version
of GNU AS, which doesn't support .intel_syntax. The  assembly code
in
Crypto++ is written in Intel syntax to be  compatible with Microsoft
compilers/assemblers.


It is indeed a very old version.  It calls itself "v1.38".  GNU AS
v1.38
was released so long ago that I can't figure out when it was.   It
was
released before 1996, and probably many years before 1996.

I think that Apple refuses to upgrade to the new GNU assembler
because
the new one is under GPLv3 and Apple doesn't like that.

So, I don't know if or how this situation is ever going to be
improved.
Apple will patch its ancient version of as to do the new  syntax?
Wei Dai
will write old-style-syntax variants of all his  assembly just for
Mac OS
X?  Apple will give up and accept GPLv3- licensed assembler?  All
Apple
users will instead install some open  source operating system on
their
machines?

I guess what will happen is Crypto++ will continue to be much
slower  on
Mac OS X than on other systems.  Maybe this doesn't matter in
practice.
Just how slow is it?  Slow enough that it diminishes your  battery
life?
Slow enough that it worsens the user experience?

Maybe someone who cares about this issue should write to Apple and
request that their assembler support Intel syntax.

Regards,

Zooko


--
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 "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.

Reply via email to