From 541b783920114930de3edc55bb428fc8227e9c5d Mon Sep 17 00:00:00 2001 From: llamasoft Date: Tue, 26 Jul 2016 11:48:28 -0500 Subject: [PATCH] Fix secp256k1_ge_set_all_gej_var parameter order Rearranged secp256k1_ge_set_all_gej_var parameters so length comes after *a. --- src/ecmult_gen_impl.h | 2 +- src/group.h | 2 +- src/group_impl.h | 2 +- src/tests.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ecmult_gen_impl.h b/src/ecmult_gen_impl.h index b63c4d8..35f2546 100644 --- a/src/ecmult_gen_impl.h +++ b/src/ecmult_gen_impl.h @@ -77,7 +77,7 @@ static void secp256k1_ecmult_gen_context_build(secp256k1_ecmult_gen_context *ctx secp256k1_gej_add_var(&numsbase, &numsbase, &nums_gej, NULL); } } - secp256k1_ge_set_all_gej_var(1024, prec, precj, cb); + secp256k1_ge_set_all_gej_var(prec, precj, 1024, cb); } for (j = 0; j < 64; j++) { for (i = 0; i < 16; i++) { diff --git a/src/group.h b/src/group.h index d515716..02a7eba 100644 --- a/src/group.h +++ b/src/group.h @@ -65,7 +65,7 @@ static void secp256k1_ge_neg(secp256k1_ge *r, const secp256k1_ge *a); static void secp256k1_ge_set_gej(secp256k1_ge *r, secp256k1_gej *a); /** Set a batch of group elements equal to the inputs given in jacobian coordinates */ -static void secp256k1_ge_set_all_gej_var(size_t len, secp256k1_ge *r, const secp256k1_gej *a, const secp256k1_callback *cb); +static void secp256k1_ge_set_all_gej_var(secp256k1_ge *r, const secp256k1_gej *a, size_t len, const secp256k1_callback *cb); /** Set a batch of group elements equal to the inputs given in jacobian * coordinates (with known z-ratios). zr must contain the known z-ratios such diff --git a/src/group_impl.h b/src/group_impl.h index 3b579a3..d2c07a9 100644 --- a/src/group_impl.h +++ b/src/group_impl.h @@ -76,7 +76,7 @@ static void secp256k1_ge_set_gej_var(secp256k1_ge *r, secp256k1_gej *a) { r->y = a->y; } -static void secp256k1_ge_set_all_gej_var(size_t len, secp256k1_ge *r, const secp256k1_gej *a, const secp256k1_callback *cb) { +static void secp256k1_ge_set_all_gej_var(secp256k1_ge *r, const secp256k1_gej *a, size_t len, const secp256k1_callback *cb) { secp256k1_fe *az; secp256k1_fe *azi; size_t i; diff --git a/src/tests.c b/src/tests.c index 6425577..7d99bb9 100644 --- a/src/tests.c +++ b/src/tests.c @@ -2051,7 +2051,7 @@ void test_ge(void) { } } secp256k1_ge_set_table_gej_var(4 * runs + 1, ge_set_table, gej, zr); - secp256k1_ge_set_all_gej_var(4 * runs + 1, ge_set_all, gej, &ctx->error_callback); + secp256k1_ge_set_all_gej_var(ge_set_all, gej, 4 * runs + 1, &ctx->error_callback); for (i = 0; i < 4 * runs + 1; i++) { secp256k1_fe s; random_fe_non_zero(&s);