From 768514bac095061563a1e8db6a8fd0cda1e470bf Mon Sep 17 00:00:00 2001 From: Jonas Nick Date: Wed, 9 Aug 2017 10:54:30 +0200 Subject: [PATCH] Fix wnaf_const documentation with respect to return value and number of words set --- src/ecmult_const_impl.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ecmult_const_impl.h b/src/ecmult_const_impl.h index 0db314c48e0cd..67f02e94a0f5d 100644 --- a/src/ecmult_const_impl.h +++ b/src/ecmult_const_impl.h @@ -42,11 +42,12 @@ } while(0) -/** Convert a number to WNAF notation. The number becomes represented by sum(2^{wi} * wnaf[i], i=0..return_val) - * with the following guarantees: +/** Convert a number to WNAF notation. + * The number becomes represented by sum(2^{wi} * wnaf[i], i=0..WNAF_SIZE(w)+1) - return_val. + * It has the following guarantees: * - each wnaf[i] an odd integer between -(1 << w) and (1 << w) * - each wnaf[i] is nonzero - * - the number of words set is returned; this is always (WNAF_BITS + w - 1) / w + * - the number of words set is always WNAF_SIZE(w) + 1 * * Adapted from `The Width-w NAF Method Provides Small Memory and Fast Elliptic Scalar * Multiplications Secure against Side Channel Attacks`, Okeya and Tagaki. M. Joye (Ed.)