From d8f05980e3992b4c236e23647cf46fbf8cd18f3b Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Mon, 11 Mar 2013 01:40:29 +0100 Subject: [PATCH] minimal --- ecmult.h | 4 ++-- tests.cpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ecmult.h b/ecmult.h index ca0c890..036a014 100644 --- a/ecmult.h +++ b/ecmult.h @@ -141,8 +141,8 @@ void ECMult(Context &ctx, GroupElemJac &out, const GroupElemJac &a, const Number // printf("an2.len=%i\n", an2.GetBits()); gn.SplitInto(ct, 128, gn1, gn2); - WNAF<129> wa1(ct, an1, WINDOW_A); - WNAF<129> wa2(ct, an2, WINDOW_A); + WNAF<128> wa1(ct, an1, WINDOW_A); + WNAF<128> wa2(ct, an2, WINDOW_A); WNAF<128> wg1(ct, gn1, WINDOW_G); WNAF<128> wg2(ct, gn2, WINDOW_G); GroupElemJac a2; a2.SetMulLambda(a); diff --git a/tests.cpp b/tests.cpp index 4981432..7c0ab7d 100644 --- a/tests.cpp +++ b/tests.cpp @@ -68,6 +68,7 @@ void test_run_point_times_order() { test_point_times_order(j); x.SetSquare(x); } + assert(x.ToString() == "7603CB59B0EF6C63FE6084792A0C378CDB3233A80F8A9A09A877DEAD31B38C45"); // 0x02 ^ (2^500) } void test_wnaf(const Number &number, int w) { @@ -99,7 +100,7 @@ void test_wnaf(const Number &number, int w) { void test_run_wnaf() { Context ctx; Number range(ctx), min(ctx), n(ctx); - range.SetHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"); + range.SetHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"); // 2^1024-1 min = range; min.Shift1(); min.Negate(); for (int i=0; i<100; i++) { n.SetPseudoRand(range); n.SetAdd(ctx,n,min);