would you recommend any other? or any other PRO tips?
The function that you mention use the method know as Scalar Multiplication, this method is also know as "double and add" it use a cycle that per each bit in the key
double the generation point G and only
adds to the result those whom are bits 1.
In the worst case it is near
256 cycle per key or if you have some precalculated data of those public keys divided in bytes instead bits you can reduce that cycle to
32 per key but that is still just a suggestion for that function.
The best way to proceed with it this kind of programs is just calculate the first key and with that first key do Public key additions to reach the next key this process will speed you program around 30 times
So instead of recalculate the public key each time with secp256k1_ec_pubkey_create
result=secp256k1_ec_pubkey_create(ctx, &pubkey_from_secp256k1.p, privkey);
next_key =secp256k1_ec_pubkey_create(ctx, &pubkey_from_secp256k1.p, privkey +1);
next_key =secp256k1_ec_pubkey_create(ctx, &pubkey_from_secp256k1.p, privkey +2);
next_key =secp256k1_ec_pubkey_create(ctx, &pubkey_from_secp256k1.p, privkey+3);
privkey + something is just an example to illustrate what i mean.
the program will do something like:
first_key=secp256k1_ec_pubkey_create(ctx, &pubkey_from_secp256k1.p, privkey);
next_key = some_publickey_addition(first_key,G);
next_key = some_publickey_addition(next_key ,G);
next_key = some_publickey_addition(next_key ,G);
...
next_key = some_publickey_addition(next_key ,G);
...
Only the first key is calculated in the old way and the subsequent keys are calculated in a faster way.
Another short cut is you don't need to calculate the Y value of all the subsequent keys (unless you are scanning for uncompressed keys) this may double the speed of the calculations.
Another short cut is endomorphism (This don't work on small puzzles) but it can multiply your speed up to 6 times for a general search.