Commit d8f432aa authored by Andy Polyakov's avatar Andy Polyakov
Browse files

Add ecp_nistz256-ppc64 module.



Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
parent b17ff188
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -275,7 +275,7 @@
	inherit_from	=> [ "parisc11_asm" ],
	perlasm_scheme	=> "64",
    },
    ppc64_asm => {
    ppc32_asm => {
	template	=> 1,
	cpuid_asm_src   => "ppccpuid.s ppccap.c",
	bn_asm_src      => "bn-ppc.s ppc-mont.s ppc64-mont.s",
@@ -285,8 +285,10 @@
	chacha_asm_src	=> "chacha-ppc.s",
	poly1305_asm_src=> "poly1305-ppc.s poly1305-ppcfp.s",
    },
    ppc32_asm => {
	inherit_from	=> [ "ppc64_asm" ],
	template	=> 1
    ppc64_asm => {
	inherit_from	=> [ "ppc32_asm" ],
	template	=> 1,
	ec_asm_src	=> "ecp_nistz256.c ecp_nistz256-ppc64.s",

    },
);
+2375 −0

File added.

Preview size limit exceeded, changes collapsed.

+1 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ GENERATE[ecp_nistz256-armv4.S]=asm/ecp_nistz256-armv4.pl $(PERLASM_SCHEME)
INCLUDE[ecp_nistz256-armv4.o]=..
GENERATE[ecp_nistz256-armv8.S]=asm/ecp_nistz256-armv8.pl $(PERLASM_SCHEME)
INCLUDE[ecp_nistz256-armv8.o]=..
GENERATE[ecp_nistz256-ppc64.s]=asm/ecp_nistz256-ppc64.pl $(PERLASM_SCHEME)

BEGINRAW[Makefile]
{- $builddir -}/ecp_nistz256-%.S:	{- $sourcedir -}/asm/ecp_nistz256-%.pl
+24 −0
Original line number Diff line number Diff line
@@ -131,6 +131,30 @@ int poly1305_init(void *ctx, const unsigned char key[16], void *func[2])
}
#endif

#ifdef ECP_NISTZ256_ASM
void ecp_nistz256_mul_mont(unsigned long res[4], const unsigned long a[4],
                           const unsigned long b[4]);

void ecp_nistz256_to_mont(unsigned long res[4], const unsigned long in[4]);
void ecp_nistz256_to_mont(unsigned long res[4], const unsigned long in[4])
{
    static const unsigned long RR[] = { 0x0000000000000003U,
                                        0xfffffffbffffffffU,
                                        0xfffffffffffffffeU,
                                        0x00000004fffffffdU };

    ecp_nistz256_mul_mont(res, in, RR);
}

void ecp_nistz256_from_mont(unsigned long res[4], const unsigned long in[4]);
void ecp_nistz256_from_mont(unsigned long res[4], const unsigned long in[4])
{
    static const unsigned long one[] = { 1, 0, 0, 0 };

    ecp_nistz256_mul_mont(res, in, one);
}
#endif

static sigjmp_buf ill_jmp;
static void ill_handler(int sig)
{