-/* Generates RSA public and private keys. This initializes the data
- structures; they should be freed with rsa_clear_private_key and
- rsa_clear_public_key. */
+/*
+ * Key generation progress meter callback
+ */
+void
+keygen_progress(int p, int n, void *arg)
+{
+ const char progress_chars[] = ".o+O?";
+
+ if ((p < 0) || (p > (sizeof(progress_chars) - 2)))
+ p = sizeof(progress_chars) - 2;
+
+ putchar(progress_chars[p]);
+ fflush(stdout);
+}
+
+/*
+ * Generates RSA public and private keys. This initializes the data
+ * structures; they should be freed with rsa_clear_private_key and
+ * rsa_clear_public_key.
+ */