Skip to content

Commit cac7c55

Browse files
committed
Merge bitcoin#470: Fix wnaf_const documentation
768514b Fix wnaf_const documentation with respect to return value and number of words set (Jonas Nick) Pull request description: Tree-SHA512: e2e49036c5930c74fff12626957a43000e5f86180791f2b857d279e83c609663ee5cbee4c3380f3df3d29e493f40051d63a8eff1badeea99e06652d9e72f4d29
2 parents b8c26a3 + 768514b commit cac7c55

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/ecmult_const_impl.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,12 @@
4242
} while(0)
4343

4444

45-
/** Convert a number to WNAF notation. The number becomes represented by sum(2^{wi} * wnaf[i], i=0..return_val)
46-
* with the following guarantees:
45+
/** Convert a number to WNAF notation.
46+
* The number becomes represented by sum(2^{wi} * wnaf[i], i=0..WNAF_SIZE(w)+1) - return_val.
47+
* It has the following guarantees:
4748
* - each wnaf[i] an odd integer between -(1 << w) and (1 << w)
4849
* - each wnaf[i] is nonzero
49-
* - the number of words set is returned; this is always (WNAF_BITS + w - 1) / w
50+
* - the number of words set is always WNAF_SIZE(w) + 1
5051
*
5152
* Adapted from `The Width-w NAF Method Provides Small Memory and Fast Elliptic Scalar
5253
* Multiplications Secure against Side Channel Attacks`, Okeya and Tagaki. M. Joye (Ed.)

0 commit comments

Comments
 (0)