1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-24 20:45:17 -07:00

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:44:51 +01:00
parent 6a7fbccfd8
commit a6d317b2f3
2 changed files with 3 additions and 11 deletions

View File

@ -11,7 +11,6 @@
#include "utils.h" #include "utils.h"
#include "curve25519_sandy2x.h" #include "curve25519_sandy2x.h"
#include "../ref10/x25519_ref10.h"
#include "../scalarmult_curve25519.h" #include "../scalarmult_curve25519.h"
#include "fe.h" #include "fe.h"
#include "fe51.h" #include "fe51.h"
@ -61,18 +60,10 @@ crypto_scalarmult_curve25519_sandy2x(unsigned char *q, const unsigned char *n,
return 0; return 0;
} }
static int
crypto_scalarmult_curve25519_sandy2x_base(unsigned char *q,
const unsigned char *n)
{
return crypto_scalarmult_curve25519_ref10_implementation.
mult_base(q, n);
}
struct crypto_scalarmult_curve25519_implementation struct crypto_scalarmult_curve25519_implementation
crypto_scalarmult_curve25519_sandy2x_implementation = { crypto_scalarmult_curve25519_sandy2x_implementation = {
SODIUM_C99(.mult = ) crypto_scalarmult_curve25519_sandy2x, SODIUM_C99(.mult = ) crypto_scalarmult_curve25519_sandy2x,
SODIUM_C99(.mult_base = ) crypto_scalarmult_curve25519_sandy2x_base SODIUM_C99(.mult_base = ) NULL
}; };
#endif #endif

View File

@ -30,7 +30,8 @@ crypto_scalarmult_curve25519(unsigned char *q, const unsigned char *n,
int int
crypto_scalarmult_curve25519_base(unsigned char *q, const unsigned char *n) 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 size_t