Computes a width-(w) "Non-Adjacent Form" of a scalar.
Thanks to curve25519-dalek for the original implementation that informed this one.
The full scalar field MUST fit in 256 bits in this implementation.
The ciphersuite providing field operations
The scalar to convert
The window width (must be >= 2 and <= 8)
The NAF representation as an array of signed bytes
Computes a width-(w) "Non-Adjacent Form" of a scalar.
Thanks to curve25519-dalek for the original implementation that informed this one.
Safety
The full scalar field MUST fit in 256 bits in this implementation.