Tuesday, April 29, 2008

It's been a month

I've been trying to figure out Montgomery Multiplication on the Via C7 processors. The texts available online haven't been too helpful.

I had quickly whipped up an integration of Via's sample code into openssl. I benchmarked it by running with openssl's s_client and s_server. My initial integration turned out to be slower than just using openssl.

The number of buffer copies to align the data was to blame. During the next half-week, I learned enough about Montgomery multiplication to be confident to try my hand at implementing a more streamlined version. The more streamlined version is faster with a 30% speed up.

I was using the binary method of modular exponentiation while openssl used the fixed window method. Both use Montgomery multiplication. Mine used the hardware one. OpenSSL used its software.

I'd have to spend more time to get my implementation tweaked to remove unnecessary memset(,0,) to clear memory and begin to use the fixed window method.

No comments: