#
# ====================================================================
# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
# project. The module is, however, dual licensed under OpenSSL and
# CRYPTOGAMS licenses depending on where you obtain it. For further
# details see http://www.openssl.org/~appro/cryptogams/.
# ====================================================================
#
# October 2012
#
# The module implements bn_GF2m_mul_2x2 polynomial multiplication used
# in bn_gf2m.c. It's kind of low-hanging mechanical port from C for
# the time being... Except that it has two code paths: one suitable
# for all SPARCv9 processors and one for VIS3-capable ones. Former
# delivers ~25-45% more, more for longer keys, heaviest DH and DSA
# verify operations on venerable UltraSPARC II. On T4 VIS3 code is
# ~100-230% faster than gcc-generated code and ~35-90% faster than
# the pure SPARCv9 code path.
$tab="%l0";
@T=("%g2","%g3");
@i=("%g4","%g5");
#include <sparc_arch.h>
#include <openssl/fipssyms.h>
#ifdef __arch64__
#endif
#ifdef __PIC__
#endif
.align 16
.align 16
or %i2,$a,$a
or %i4,$b,$b
and $b,@i[0],@i[0]
and $b,@i[1],@i[1]
and @i[0],`0xf<<3`,@i[0]
and @i[1],`0xf<<3`,@i[1]
and @i[0],`0xf<<3`,@i[0]
for($n=1;$n<14;$n++) {
and @i[1],`0xf<<3`,@i[1]
push(@i,shift(@i)); push(@T,shift(@T));
}
.asciz "GF(2^m) Multiplication for SPARCv9, CRYPTOGAMS by <appro\@openssl.org>"
.align 4
print $code;
close STDOUT;