From 9c077904fd8459e3131beed2839c7011fca1c1a4 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Wed, 10 May 2017 21:03:51 +0100 Subject: [PATCH] pub/ed25519.c: Use the correct type for the field-element constants. This fixes a bug: `bz_pieces' had the wrong type, but likely worked anyway by luck -- especially on little-endian machines. --- pub/ed25519.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pub/ed25519.c b/pub/ed25519.c index a5fe57b7..e8a8d784 100644 --- a/pub/ed25519.c +++ b/pub/ed25519.c @@ -86,7 +86,7 @@ const key_fetchdef ed25519_privfetch[] = { #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[] = { @@ -99,7 +99,7 @@ const key_fetchdef ed25519_privfetch[] = { #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 @@ -114,7 +114,7 @@ const key_fetchdef ed25519_privfetch[] = { }; #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) -- 2.11.0