[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openssl-dev
Subject:    Re: MD5 optimized for AMD64 (+65% speedup)
From:       Andy Polyakov <appro () fy ! chalmers ! se>
Date:       2004-12-28 16:40:20
Message-ID: 41D18C74.5000903 () fy ! chalmers ! se
[Download RAW message or body]

>>> Keep in mind that [unlike Gladman's code] OpenSSL code has to be 
>>> position
>>> independent! It surely no problem on x86_64, but on x86 this puts you 
>>> in very
>>> tight spot. But I've sketched some 32-bit PIC code already [as 
>>> previously
>>> mentioned "I might have an opportunity to play with AES some day *this*
>>> year"], so give me few more days...
>>
>> oh i guess you need to throw away another register on 32-bit x86 to 
>> load up the table base address.
>> perhaps if you copied the key-schedule/context to the stack you could 
>> refer to it off %esp, and then use %ebp as a base register for the 
>> tables?  it would pay if you can amortize the stack copy over multiple 
>> blocks...
> 
> That would require [major] surgery to API and will most likely push a 
> bunch of "front-end" functions such as AES_cbc_encrypt to assembler... 
> As it's unlikely to result in further *significant* improvement, I'd 
> rather not:-)

Just for the record. As was shown by Dean one can expect ~30% 
*asymptotic* gain resulting from making a copy of key schedule into 
controlled place on stack. "Asymptotic" means for larger chunk-sizes 
only and implies API surgery. It also means that that small-packet 
oriented applications [such as ssh] are likely to suffer (though this 
can be avoided by maintaining two code-pathes and choosing one at 
run-time depending on input lenght:-) "Controlled place on stack" 
implies ""front-end" functions being implemented in assembler"... Is 
there interest for this? A.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@openssl.org
Automated List Manager                           majordomo@openssl.org
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic