  Assuming the Generalized Riemann Hypothesis, we design a deterministic
algorithm that, given a prime p and positive integer m=o(sqrt(p)/(log p)^4),
outputs an elliptic curve E over the finite field F_p for which the cardinality
of E(F_p) is divisible by m. The running time of the algorithm is
mp^(1/2+o(1)), and this leads to more efficient constructions of rational
functions over F_p whose image is small relative to p. We also give an
unconditional version of the algorithm that works for almost all primes p, and
give a probabilistic algorithm with subexponential time complexity.
