Use specialized formulas for doubling

The new function is about 20% faster, and signature
verification is now about 7% faster.