Fix wnaf_const documentation with respect to return value and number of words set

This commit is contained in:
Jonas Nick 2017-08-09 10:54:30 +02:00
parent b8c26a3990
commit 768514bac0
1 changed files with 4 additions and 3 deletions

View File

@ -42,11 +42,12 @@
} while(0) } while(0)
/** Convert a number to WNAF notation. The number becomes represented by sum(2^{wi} * wnaf[i], i=0..return_val) /** Convert a number to WNAF notation.
* with the following guarantees: * 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] an odd integer between -(1 << w) and (1 << w)
* - each wnaf[i] is nonzero * - 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 * 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.) * Multiplications Secure against Side Channel Attacks`, Okeya and Tagaki. M. Joye (Ed.)