I'm developing a way to deterministically generate private keys for arbitrary elliptic curves based on some user-input (a brain-wallet). Currently, I'm using the Scrypt password hashing algorithm with robust difficulty parameters to hash a number of input parameters into a key.
The output of Scrypt should be uniformly distributed among $[0, 2^{b})$ where ${b}$ is the number of output bits used from the Scrypt algorithm output. But valid elliptic curve private keys must be less than the curve's finite field order $N$, distributed evenly among $[0, N)$. Thus, using the output of Scrypt directly as a private key mod $N$ would create a small bias in the resulting keys that are generated - bad news, so I need to avoid that.
Normally if you were generating private keys using a secure RNG, you would simply retry the RNG until you got a number less than $N$, and you could safely use that as a private key.
Is there a safe way to deterministically iterate the output of Scrypt, such that we preserve the pseudo-random distribution of Scrypt's output, without having to re-run Scrypt with new parameters?
One way I considered was hashing the output of scrypt with SHA256 or SHA512 until it was less than $N$, but this wouldn't work so well for curves larger than 512 bits, such as P521.
Another less elegant solution is to simply reject any input parameters which produce a key larger than $N$. It should be very rare for it to ever occur, so perhaps I can get away with it? Are there any common curves out there whose order $N$ is not a significant fraction of its next-highest power of two?