DSA per: http://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=69EF0068309954F8912E7214E7BA0148?doi=10.1.1.38.8014&rep=rep1&type=pdf "The Elliptic Curve Digital Signature Algorithm (ECDSA)" "FIPS 186-3" => http://csrc.nist.gov/publications/fips/fips186-3/fips_186-3.pdf (let* ((ch (fileVal "pias")) (q (ch (expt 2 159) 1)) (z (+ 1 (* q (+ 1 (quotient (expt 2 1023) q))))) (p (ch z q))) (cons p q)) Now to find a primitive root of q. This: http://www.math.niu.edu/~rusin/known-math/95/primitive.root may be the best of the poor art of finding roots. I need a function to find the small factors of q-1. p is one more than some multiple of q