Low-level, non-optimized implementation using BigIntegers for any curve. See the ed25519 implementation for Curve 25519.