prime.h 531 B

12345678910111213141516
  1. /*
  2. * Copyright (c) 1995 Colin Plumb. All rights reserved.
  3. * For licensing and other legal details, see the file legal.c.
  4. */
  5. struct BigNum;
  6. /* Generate a prime >= bn. leaving the result in bn. */
  7. int primeGen(struct BigNum *bn, unsigned (*randfunc)(unsigned),
  8. int (*f)(void *arg, int c), void *arg, unsigned exponent, ...);
  9. /*
  10. * Generate a prime of the form bn + k*step. Step must be even and
  11. * bn must be odd.
  12. */
  13. int primeGenStrong(struct BigNum *bn, struct BigNum const *step,
  14. int (*f)(void *arg, int c), void *arg);