1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-19 18:15:18 -07:00

Remove sandy2x fixed base scalar multiplication

Thanks to precomputation, the generic implementation is faster.

Don't even define a .mult_base placeholder for sandy2x

Avoid two indirections for fixed base multiplication until another
implementation possibly exists.
This commit is contained in:
Frank Denis 2020-02-06 00:26:52 +01:00
parent 64779327e9
commit 182415cb69
22 changed files with 5 additions and 1435 deletions

View File

@ -278,12 +278,10 @@
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\consts_namespace.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_namespace.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_base_namespace.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe51.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\curve25519_sandy2x.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe51_namespace.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_base.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\ref10\x25519_ref10.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_onetimeauth\poly1305\onetimeauth_poly1305.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_onetimeauth\poly1305\donna\poly1305_donna.h" />

View File

@ -623,9 +623,6 @@
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe.h">
<Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_base_namespace.h">
<Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder.h">
<Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
</ClInclude>
@ -638,9 +635,6 @@
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe51_namespace.h">
<Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_base.h">
<Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\ref10\x25519_ref10.h">
<Filter>crypto_scalarmult\curve25519\ref10</Filter>
</ClInclude>

View File

@ -278,12 +278,10 @@
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\consts_namespace.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_namespace.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_base_namespace.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe51.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\curve25519_sandy2x.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe51_namespace.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_base.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\ref10\x25519_ref10.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_onetimeauth\poly1305\onetimeauth_poly1305.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_onetimeauth\poly1305\donna\poly1305_donna.h" />

View File

@ -623,9 +623,6 @@
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe.h">
<Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_base_namespace.h">
<Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder.h">
<Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
</ClInclude>
@ -638,9 +635,6 @@
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe51_namespace.h">
<Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_base.h">
<Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\ref10\x25519_ref10.h">
<Filter>crypto_scalarmult\curve25519\ref10</Filter>
</ClInclude>

View File

@ -278,12 +278,10 @@
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\consts_namespace.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_namespace.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_base_namespace.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe51.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\curve25519_sandy2x.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe51_namespace.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_base.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\ref10\x25519_ref10.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_onetimeauth\poly1305\onetimeauth_poly1305.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_onetimeauth\poly1305\donna\poly1305_donna.h" />

View File

@ -623,9 +623,6 @@
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe.h">
<Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_base_namespace.h">
<Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder.h">
<Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
</ClInclude>
@ -638,9 +635,6 @@
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe51_namespace.h">
<Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_base.h">
<Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\ref10\x25519_ref10.h">
<Filter>crypto_scalarmult\curve25519\ref10</Filter>
</ClInclude>

View File

@ -278,12 +278,10 @@
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\consts_namespace.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_namespace.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_base_namespace.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe51.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\curve25519_sandy2x.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe51_namespace.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_base.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\ref10\x25519_ref10.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_onetimeauth\poly1305\onetimeauth_poly1305.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_onetimeauth\poly1305\donna\poly1305_donna.h" />

View File

@ -623,9 +623,6 @@
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe.h">
<Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_base_namespace.h">
<Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder.h">
<Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
</ClInclude>
@ -638,9 +635,6 @@
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe51_namespace.h">
<Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_base.h">
<Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\ref10\x25519_ref10.h">
<Filter>crypto_scalarmult\curve25519\ref10</Filter>
</ClInclude>

View File

@ -278,12 +278,10 @@
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\consts_namespace.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_namespace.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_base_namespace.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe51.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\curve25519_sandy2x.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe51_namespace.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_base.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\ref10\x25519_ref10.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_onetimeauth\poly1305\onetimeauth_poly1305.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_onetimeauth\poly1305\donna\poly1305_donna.h" />

View File

@ -623,9 +623,6 @@
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe.h">
<Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_base_namespace.h">
<Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder.h">
<Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
</ClInclude>
@ -638,9 +635,6 @@
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe51_namespace.h">
<Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_base.h">
<Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\ref10\x25519_ref10.h">
<Filter>crypto_scalarmult\curve25519\ref10</Filter>
</ClInclude>

View File

@ -278,12 +278,10 @@
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\consts_namespace.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_namespace.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_base_namespace.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe51.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\curve25519_sandy2x.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe51_namespace.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_base.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\ref10\x25519_ref10.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_onetimeauth\poly1305\onetimeauth_poly1305.h" />
<ClInclude Include="..\..\..\..\src\libsodium\crypto_onetimeauth\poly1305\donna\poly1305_donna.h" />

View File

@ -623,9 +623,6 @@
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe.h">
<Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_base_namespace.h">
<Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder.h">
<Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
</ClInclude>
@ -638,9 +635,6 @@
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe51_namespace.h">
<Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_base.h">
<Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\ref10\x25519_ref10.h">
<Filter>crypto_scalarmult\curve25519\ref10</Filter>
</ClInclude>

View File

@ -516,12 +516,10 @@
<ClInclude Include="src\libsodium\crypto_scalarmult\curve25519\sandy2x\consts_namespace.h" />
<ClInclude Include="src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_namespace.h" />
<ClInclude Include="src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe.h" />
<ClInclude Include="src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_base_namespace.h" />
<ClInclude Include="src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder.h" />
<ClInclude Include="src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe51.h" />
<ClInclude Include="src\libsodium\crypto_scalarmult\curve25519\sandy2x\curve25519_sandy2x.h" />
<ClInclude Include="src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe51_namespace.h" />
<ClInclude Include="src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_base.h" />
<ClInclude Include="src\libsodium\crypto_scalarmult\curve25519\ref10\x25519_ref10.h" />
<ClInclude Include="src\libsodium\crypto_onetimeauth\poly1305\onetimeauth_poly1305.h" />
<ClInclude Include="src\libsodium\crypto_onetimeauth\poly1305\donna\poly1305_donna.h" />

View File

@ -614,9 +614,6 @@
<ClInclude Include="src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_base_namespace.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder.h">
<Filter>Header Files</Filter>
</ClInclude>
@ -629,9 +626,6 @@
<ClInclude Include="src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe51_namespace.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_base.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\libsodium\crypto_scalarmult\curve25519\ref10\x25519_ref10.h">
<Filter>Header Files</Filter>
</ClInclude>

View File

@ -127,8 +127,7 @@ noinst_HEADERS = \
crypto_scalarmult/curve25519/sandy2x/fe51_mul.S \
crypto_scalarmult/curve25519/sandy2x/fe51_nsquare.S \
crypto_scalarmult/curve25519/sandy2x/fe51_pack.S \
crypto_scalarmult/curve25519/sandy2x/ladder.S \
crypto_scalarmult/curve25519/sandy2x/ladder_base.S
crypto_scalarmult/curve25519/sandy2x/ladder.S
if HAVE_AVX_ASM
libsodium_la_SOURCES += \
@ -141,8 +140,6 @@ libsodium_la_SOURCES += \
crypto_scalarmult/curve25519/sandy2x/fe51_namespace.h \
crypto_scalarmult/curve25519/sandy2x/fe_frombytes_sandy2x.c \
crypto_scalarmult/curve25519/sandy2x/ladder.h \
crypto_scalarmult/curve25519/sandy2x/ladder_base.h \
crypto_scalarmult/curve25519/sandy2x/ladder_base_namespace.h \
crypto_scalarmult/curve25519/sandy2x/ladder_namespace.h \
crypto_scalarmult/curve25519/sandy2x/sandy2x.S
endif

View File

@ -123,8 +123,6 @@ host_triplet = @host@
@HAVE_AVX_ASM_TRUE@ crypto_scalarmult/curve25519/sandy2x/fe51_namespace.h \
@HAVE_AVX_ASM_TRUE@ crypto_scalarmult/curve25519/sandy2x/fe_frombytes_sandy2x.c \
@HAVE_AVX_ASM_TRUE@ crypto_scalarmult/curve25519/sandy2x/ladder.h \
@HAVE_AVX_ASM_TRUE@ crypto_scalarmult/curve25519/sandy2x/ladder_base.h \
@HAVE_AVX_ASM_TRUE@ crypto_scalarmult/curve25519/sandy2x/ladder_base_namespace.h \
@HAVE_AVX_ASM_TRUE@ crypto_scalarmult/curve25519/sandy2x/ladder_namespace.h \
@HAVE_AVX_ASM_TRUE@ crypto_scalarmult/curve25519/sandy2x/sandy2x.S
@ -359,8 +357,6 @@ am__libsodium_la_SOURCES_DIST = \
crypto_scalarmult/curve25519/sandy2x/fe51_namespace.h \
crypto_scalarmult/curve25519/sandy2x/fe_frombytes_sandy2x.c \
crypto_scalarmult/curve25519/sandy2x/ladder.h \
crypto_scalarmult/curve25519/sandy2x/ladder_base.h \
crypto_scalarmult/curve25519/sandy2x/ladder_base_namespace.h \
crypto_scalarmult/curve25519/sandy2x/ladder_namespace.h \
crypto_scalarmult/curve25519/sandy2x/sandy2x.S \
crypto_box/curve25519xchacha20poly1305/box_curve25519xchacha20poly1305.c \
@ -1002,8 +998,7 @@ noinst_HEADERS = \
crypto_scalarmult/curve25519/sandy2x/fe51_mul.S \
crypto_scalarmult/curve25519/sandy2x/fe51_nsquare.S \
crypto_scalarmult/curve25519/sandy2x/fe51_pack.S \
crypto_scalarmult/curve25519/sandy2x/ladder.S \
crypto_scalarmult/curve25519/sandy2x/ladder_base.S
crypto_scalarmult/curve25519/sandy2x/ladder.S
randombytes_internal_randombytes_internal_random_CFLAGS = @CFLAGS_RDRAND@
libsodium_la_LDFLAGS = $(AM_LDFLAGS) -export-dynamic -no-undefined \

View File

@ -15,7 +15,6 @@
#include "fe.h"
#include "fe51.h"
#include "ladder.h"
#include "ladder_base.h"
#define x1 var[0]
#define x2 var[1]
@ -61,54 +60,10 @@ crypto_scalarmult_curve25519_sandy2x(unsigned char *q, const unsigned char *n,
return 0;
}
#undef x2
#undef z2
#define x2 var[0]
#define z2 var[1]
static int
crypto_scalarmult_curve25519_sandy2x_base(unsigned char *q,
const unsigned char *n)
{
unsigned char *t = q;
fe var[3];
fe51 x_51;
fe51 z_51;
unsigned int i;
for (i = 0;i < 32; i++) {
t[i] = n[i];
}
t[0] &= 248;
t[31] &= 127;
t[31] |= 64;
ladder_base(var, t);
z_51.v[0] = (z2[1] << 26) + z2[0];
z_51.v[1] = (z2[3] << 26) + z2[2];
z_51.v[2] = (z2[5] << 26) + z2[4];
z_51.v[3] = (z2[7] << 26) + z2[6];
z_51.v[4] = (z2[9] << 26) + z2[8];
x_51.v[0] = (x2[1] << 26) + x2[0];
x_51.v[1] = (x2[3] << 26) + x2[2];
x_51.v[2] = (x2[5] << 26) + x2[4];
x_51.v[3] = (x2[7] << 26) + x2[6];
x_51.v[4] = (x2[9] << 26) + x2[8];
fe51_invert(&z_51, &z_51);
fe51_mul(&x_51, &x_51, &z_51);
fe51_pack(q, &x_51);
return 0;
}
struct crypto_scalarmult_curve25519_implementation
crypto_scalarmult_curve25519_sandy2x_implementation = {
SODIUM_C99(.mult = ) crypto_scalarmult_curve25519_sandy2x,
SODIUM_C99(.mult_base = ) crypto_scalarmult_curve25519_sandy2x_base
SODIUM_C99(.mult_base = ) NULL
};
#endif

View File

@ -1,18 +0,0 @@
#ifndef ladder_base_H
#define ladder_base_H
#ifdef __cplusplus
extern "C" {
#endif
#include "fe.h"
#include "ladder_base_namespace.h"
extern void ladder_base(fe *, const unsigned char *);
#ifdef __cplusplus
}
#endif
#endif /* ifndef ladder_base_H */

View File

@ -1,8 +0,0 @@
#ifndef ladder_base_namespace_H
#define ladder_base_namespace_H
#define ladder_base crypto_scalarmult_curve25519_sandy2x_ladder_base
#define _ladder_base _crypto_scalarmult_curve25519_sandy2x_ladder_base
#endif /* ifndef ladder_base_namespace_H */

View File

@ -8,7 +8,6 @@
#include "fe51_nsquare.S"
#include "fe51_pack.S"
#include "ladder.S"
#include "ladder_base.S"
#if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits

View File

@ -30,7 +30,8 @@ crypto_scalarmult_curve25519(unsigned char *q, const unsigned char *n,
int
crypto_scalarmult_curve25519_base(unsigned char *q, const unsigned char *n)
{
return implementation->mult_base(q, n);
return crypto_scalarmult_curve25519_ref10_implementation
.mult_base(q, n);
}
size_t