]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
* nettle-meta.h: Moved the nettle_random_func and
authorNiels Möller <nisse@lysator.liu.se>
Wed, 9 Oct 2002 07:34:57 +0000 (09:34 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Wed, 9 Oct 2002 07:34:57 +0000 (09:34 +0200)
nettle_progress_func typedefs here...
* rsa.h: ... from here.

Rev: src/nettle/nettle-meta.h:1.7
Rev: src/nettle/rsa.h:1.14

nettle-meta.h
rsa.h

index b5375a853792d2042fbe1c906040ea8e78aa8b4d..759037c8f2c0a9a6bec7061a9a8ed04605bae147 100644 (file)
 
 #include <inttypes.h>
 
+/* Randomness. Used by key generation and dsa signature creation. */
+typedef void (*nettle_random_func)(void *ctx,
+                                  unsigned length, uint8_t *dst);
+
+/* Progress report function, mainly for key generation. */
+typedef void (*nettle_progress_func)(void *ctx,
+                                    int c);
+
 /* Ciphers */
 typedef void (*nettle_crypt_func)(void *ctx,
                                  unsigned length, uint8_t *dst,
diff --git a/rsa.h b/rsa.h
index 90a7f60bd6f24428adf75b8d6c83217a31e4e1af..9f98db1adc80523005b42a8943161a96276d6bfa 100644 (file)
--- a/rsa.h
+++ b/rsa.h
 #include "md5.h"
 #include "sha.h"
 
-/* Randomness function. This typedef doesn't really belong here, but
- * so far it's used only by rsa functions (encryption and key
- * generation) */
-typedef void (*nettle_random_func)(void *ctx,
-                                  unsigned length, uint8_t *dst);
+/* For nettle_random_func */
+#include "nettle-meta.h"
 
 
 /* For PKCS#1 to make sense, the size of the modulo, in octets, must
@@ -106,6 +103,11 @@ struct rsa_private_key
  * mpz_clear.
  */
 
+/* FIXME: For consistency, these functions ought to be renamed to
+ * rsa_public_key_init, rsa_public_key_clear, rsa_private_key_init,
+ * rsa_private_key_clear. Perhaps the prepare functions should be
+ * renamed too. Do this for nettle-2.0? */
 /* Calls mpz_init to initialize bignum storage. */
 void
 rsa_init_public_key(struct rsa_public_key *key);
@@ -183,10 +185,6 @@ rsa_compute_root(struct rsa_private_key *key, mpz_t x, const mpz_t m);
 
 /* Key generation */
 
-/* Progress report function. */
-typedef void (*nettle_progress_func)(void *ctx,
-                                    int c);
-
 /* Note that the key structs must be initialized first. */
 int
 rsa_generate_keypair(struct rsa_public_key *pub,