提交 d8f432aa 编写于 作者: A Andy Polyakov

Add ecp_nistz256-ppc64 module.

Reviewed-by: NRich Salz <rsalz@openssl.org>
上级 b17ff188
...@@ -275,7 +275,7 @@ ...@@ -275,7 +275,7 @@
inherit_from => [ "parisc11_asm" ], inherit_from => [ "parisc11_asm" ],
perlasm_scheme => "64", perlasm_scheme => "64",
}, },
ppc64_asm => { ppc32_asm => {
template => 1, template => 1,
cpuid_asm_src => "ppccpuid.s ppccap.c", cpuid_asm_src => "ppccpuid.s ppccap.c",
bn_asm_src => "bn-ppc.s ppc-mont.s ppc64-mont.s", bn_asm_src => "bn-ppc.s ppc-mont.s ppc64-mont.s",
...@@ -285,8 +285,10 @@ ...@@ -285,8 +285,10 @@
chacha_asm_src => "chacha-ppc.s", chacha_asm_src => "chacha-ppc.s",
poly1305_asm_src=> "poly1305-ppc.s poly1305-ppcfp.s", poly1305_asm_src=> "poly1305-ppc.s poly1305-ppcfp.s",
}, },
ppc32_asm => { ppc64_asm => {
inherit_from => [ "ppc64_asm" ], inherit_from => [ "ppc32_asm" ],
template => 1 template => 1,
ec_asm_src => "ecp_nistz256.c ecp_nistz256-ppc64.s",
}, },
); );
此差异已折叠。
...@@ -21,6 +21,7 @@ GENERATE[ecp_nistz256-armv4.S]=asm/ecp_nistz256-armv4.pl $(PERLASM_SCHEME) ...@@ -21,6 +21,7 @@ GENERATE[ecp_nistz256-armv4.S]=asm/ecp_nistz256-armv4.pl $(PERLASM_SCHEME)
INCLUDE[ecp_nistz256-armv4.o]=.. INCLUDE[ecp_nistz256-armv4.o]=..
GENERATE[ecp_nistz256-armv8.S]=asm/ecp_nistz256-armv8.pl $(PERLASM_SCHEME) GENERATE[ecp_nistz256-armv8.S]=asm/ecp_nistz256-armv8.pl $(PERLASM_SCHEME)
INCLUDE[ecp_nistz256-armv8.o]=.. INCLUDE[ecp_nistz256-armv8.o]=..
GENERATE[ecp_nistz256-ppc64.s]=asm/ecp_nistz256-ppc64.pl $(PERLASM_SCHEME)
BEGINRAW[Makefile] BEGINRAW[Makefile]
{- $builddir -}/ecp_nistz256-%.S: {- $sourcedir -}/asm/ecp_nistz256-%.pl {- $builddir -}/ecp_nistz256-%.S: {- $sourcedir -}/asm/ecp_nistz256-%.pl
......
...@@ -131,6 +131,30 @@ int poly1305_init(void *ctx, const unsigned char key[16], void *func[2]) ...@@ -131,6 +131,30 @@ int poly1305_init(void *ctx, const unsigned char key[16], void *func[2])
} }
#endif #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 sigjmp_buf ill_jmp;
static void ill_handler(int sig) static void ill_handler(int sig)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册