I saw a lot of clear
functions used to clear local scalar, ge or gej variable in the last step of function, does this necessary? I thought the local variables should be no longer exists(or used) after function quit. Is this a manual destruct for local variable? Because it takes longer time(maybe just a small longer time) than just leave them alone.
Here are example codes.
0static void secp256k1_ecmult_gen(const secp256k1_ecmult_gen_context *ctx, secp256k1_gej *r, const secp256k1_scalar *gn) {
1 secp256k1_ge add;
2 secp256k1_scalar gnb;
3 int bits;
4 // ........
5 secp256k1_ge_clear(&add);
6 secp256k1_scalar_clear(&gnb);
7}