Skip to content

Commit 5efdaa1

Browse files
author
Jeffrey Ryan
committed
Remedy some GCC warnings
The `#ifdef SMALLTABLES` change eliminates the unused variable warning and the array size changes fix the arrays to be the right size for the call to `sc25519_window4`, and thus silences the `-Wstringop-overflow=` warning group in GCC. These changes should not at all affect the result of the operations, as the last 19 extra bytes in the array will remain unused.
1 parent 633500a commit 5efdaa1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

crypto_sign/ed25519/amd64-64-24k/ge25519_scalarmult_base.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ static const ge25519_niels ge25519_base_multiples_niels[] = {
1212
};
1313

1414
/* d */
15+
#ifdef SMALLTABLES
1516
static const fe25519 ecd = {{0x75EB4DCA135978A3, 0x00700A4D4141D8AB, 0x8CC740797779E898, 0x52036CEE2B6FFE73}};
17+
#endif
1618

1719
void ge25519_scalarmult_base(ge25519_p3 *r, const sc25519 *s)
1820
{
19-
signed char b[64];
21+
signed char b[85];
2022
int i;
2123
ge25519_niels t;
2224
fe25519 d;

src/amd64/amd64.c.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static void negate(ge25519* out)
109109
// similar to loops in existing implementation, but uses dynamic table instead of fixed `G`.
110110
static void scalarmult_p1p1(ge25519_p1p1* r, ge25519_pniels const* base, char const* sec)
111111
{
112-
signed char b[64];
112+
signed char b[85];
113113
ge25519_pniels t;
114114
ge25519_p3 tp3;
115115

0 commit comments

Comments
 (0)