[Cryptech Tech] Headsup: Perfopt branch merged into modexp master

Joachim Strömbergson joachim at secworks.se
Fri Jun 26 15:17:50 UTC 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Aloha!

I've just merged a first set of changes to the modexp core to improve
the performance. The main changes are:

* init and add parts of the montprod inner loop fused. This removes
about 30-40% of the cycles in a modexp operation.


* operand size in montprod, memories and all sub modules are now generic
and can be changed during build time. Testbenches needs to be updated
and operand size used now is 32 bit. There is a wrapper in rtl/support
to allow test implementation of montprod with different operand sizes.
I've tested with 64 and 128 bit operands. Timing is no problem, size
scales linearly. On the Novena we might have resource problems using 128
bit operands, but 64 bits seems to be possible. 64 bits means cutting
the number of cycles in half.

Note that the API memories needs to be adjusted manually due to
replication that varies with size. The generic size needs to be tested
before being used.


* Modexp now supports explicit exponent length. For short exponents
(e=65537) the performance gain is huge compared to having the same
operand length as the modulus.

NOTE: This changes means that padding of the exponent should NOT be done
anymore. For e=65537 the length should be set to one (1) word.

This change provides some performance gains for big exponents too since
the padding has been eliminated. For 1024 bit exponent the performance
gain is about 3%.


I've built a Novena FPGA with a modexp with the perfopt changes.
Focus now is to complete operand size change to 64 bits.

- -- 
Med vänlig hälsning, Yours

Joachim Strömbergson - Alltid i harmonisk svängning.
========================================================================
 Joachim Strömbergson          Secworks AB          joachim at secworks.se
========================================================================
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBCAAGBQJVjW0eAAoJEF3cfFQkIuyNg2QP/iokVK0kQC53lZ7Xp6ctT9GC
9/3bH4ICwt3WVd5eAg5Aj1w9L0+MLYGKn0u8iFU+UwWSQPfkxPKYfON8vwK2qnh3
E4M9lTNSzVZotWcu4NIKvUhk0KZhdPgnkoTjljAoSsbRZ87Eb+UeIg1q/cMgzaHt
UGhp05Pr0EzR9lvmpp6K/HQp3jvvYByThLmhJ56zszEGP0qezB8IFjJtkZ4jQK5o
tLW4F60A9YmcIDkgM0nNL31RfsAbTjn8fKAZYEI1+nniGzy1/iT/jgQ8SPvWAkMx
OxDCsYTz8u4H2HSFywvyvZGPkS4r6PzP8COI7p+ObixfchJhH5PhoACq8sLjyEvk
ZYzBbWMdNL4qnAFx2DND/5B/7oIN8feTMZLeac/Jue0v2yp4xsmnu5XP06Na/9CI
tORxCIldn2ihG4lRzc2BeQNxc9Z0TUdOab6r8EOFh1n4HhZyIyPRUEIUyR4i3Vnf
e0yLb1cR6y64EXZPxyED26AFkDYgFVsoyoPn/Rm1cm1AWp6Hd3WPaHGw9gqM1loZ
7pZ3rG0oMo85WTl+jn6FFqJDDhVDCz76nwwDGpCIwwuduXo4wMuDhHZUAK9/+Z4l
9rbRIeNKGwKiuBDt367bq6NWz1hLF9w3e2xrCMXb71Vr5oZbfhGrkWCZh0OLn9sE
Ffb03NQo1BTm6CUXeGVH
=NwV4
-----END PGP SIGNATURE-----


More information about the Tech mailing list