The bare bits = 0;
raises a clang static analysis issue.
0--------------------------------------------------------------------------------
1An issue has been found in ./src/ecmult_gen_impl.h:153:5
2Type: Dead assignment
3Description: Value stored to 'bits' is never read
4
50: ./src/ecmult_gen_impl.h:153:5 - Value stored to 'bits' is never read
6--------------------------------------------------------------------------------
The line was introduced in 2f6c8019114743e46a741fc6a01f9c6600ccdb5d (when secp256k1_ecmult_gen()
lived in src/ecmult_impl.h
) with the purpose of clearing stack variables that might have secret info.
However, without that context, the purpose for clearing isn’t obvious from reading the code. Aside from making clang happy, the function name should help it be understood.