Skip to content

Commit 500f438

Browse files
author
Jeffrey Ryan
committed
Remedy some GCC warnings
The `#ifdef SMALLTABLES` change eliminates the unused variable warning, and the changes to the sc25519_window4 prototype silences the `-Wstringop-overflow=` warnings in GCC. The prototype seems to be wrong b/c it requires an array of size 85, but the function definition only uses 64 bytes, the caller expects it only needs 64 bytes, and the 85 seems to be a copy/paste issue from window3 (Props to @moneromooo-monero for finding that) Resolves #8
1 parent 633500a commit 500f438

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ 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
{

crypto_sign/ed25519/amd64-64-24k/sc25519.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void sc25519_mul_shortsc(sc25519 *r, const sc25519 *x, const shortsc25519 *y);
5555
/* Convert s into a representation of the form \sum_{i=0}^{63}r[i]2^(4*i)
5656
* with r[i] in {-8,...,7}
5757
*/
58-
void sc25519_window4(signed char r[85], const sc25519 *s);
58+
void sc25519_window4(signed char r[64], const sc25519 *s);
5959

6060
void sc25519_slide(signed char r[256], const sc25519 *s, int swindowsize);
6161

0 commit comments

Comments
 (0)