chiark
/
gitweb
/
~mdw
/
catacomb
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f521d4c
)
pub/ed25519.c: Use the correct type for the field-element constants.
author
Mark Wooding
<mdw@distorted.org.uk>
Wed, 10 May 2017 20:03:51 +0000
(21:03 +0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Sun, 14 May 2017 13:58:41 +0000
(14:58 +0100)
This fixes a bug: `bz_pieces' had the wrong type, but likely worked
anyway by luck -- especially on little-endian machines.
pub/ed25519.c
patch
|
blob
|
blame
|
history
diff --git
a/pub/ed25519.c
b/pub/ed25519.c
index a5fe57b79f6d919e3f4bbb878b6f8c26a7f16a0b..e8a8d7842973ce7b5084bccfb5bbc8ba7a6e9481 100644
(file)
--- a/
pub/ed25519.c
+++ b/
pub/ed25519.c
@@
-86,7
+86,7
@@
const key_fetchdef ed25519_privfetch[] = {
#if F25519_IMPL == 26
# define P p26
#if F25519_IMPL == 26
# define P p26
- static const
int32
bx_pieces[] = {
+ static const
f25519_piece
bx_pieces[] = {
-14297830, -7645148, 16144683, -16471763, 27570974,
-2696100, -26142465, 8378389, 20764389, 8758491
}, by_pieces[] = {
-14297830, -7645148, 16144683, -16471763, 27570974,
-2696100, -26142465, 8378389, 20764389, 8758491
}, by_pieces[] = {
@@
-99,7
+99,7
@@
const key_fetchdef ed25519_privfetch[] = {
#endif
#if F25519_IMPL == 10
# define P p10
#endif
#if F25519_IMPL == 10
# define P p10
- static const
int16
bx_pieces[] = {
+ static const
f25519_piece
bx_pieces[] = {
282, 373, 242, 386, -467, 86, -423, 318, -437,
75, 236, -308, 421, 92, 439, -35, 400, 452,
82, -40, 160, 441, -51, 437, -365, 134
282, 373, 242, 386, -467, 86, -423, 318, -437,
75, 236, -308, 421, 92, 439, -35, 400, 452,
82, -40, 160, 441, -51, 437, -365, 134
@@
-114,7
+114,7
@@
const key_fetchdef ed25519_privfetch[] = {
};
#endif
};
#endif
-static const
scaf
_piece bz_pieces[NPIECE] = { 1, 0, /* ... */ };
+static const
f25519
_piece bz_pieces[NPIECE] = { 1, 0, /* ... */ };
#define BX ((const f25519 *)bx_pieces)
#define BY ((const f25519 *)by_pieces)
#define BZ ((const f25519 *)bz_pieces)
#define BX ((const f25519 *)bx_pieces)
#define BY ((const f25519 *)by_pieces)
#define BZ ((const f25519 *)bz_pieces)