Skip to content
Snippets Groups Projects
Commit 3f0c8f74 authored by Niels Möller's avatar Niels Möller
Browse files

* nettle-meta.h: Moved the nettle_random_func and

nettle_progress_func typedefs here...
* rsa.h: ... from here.

Rev: src/nettle/nettle-meta.h:1.7
Rev: src/nettle/rsa.h:1.14
parent bd5af52b
Branches
Tags
No related merge requests found
...@@ -28,6 +28,14 @@ ...@@ -28,6 +28,14 @@
#include <inttypes.h> #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 */ /* Ciphers */
typedef void (*nettle_crypt_func)(void *ctx, typedef void (*nettle_crypt_func)(void *ctx,
unsigned length, uint8_t *dst, unsigned length, uint8_t *dst,
......
...@@ -32,11 +32,8 @@ ...@@ -32,11 +32,8 @@
#include "md5.h" #include "md5.h"
#include "sha.h" #include "sha.h"
/* Randomness function. This typedef doesn't really belong here, but /* For nettle_random_func */
* so far it's used only by rsa functions (encryption and key #include "nettle-meta.h"
* generation) */
typedef void (*nettle_random_func)(void *ctx,
unsigned length, uint8_t *dst);
/* For PKCS#1 to make sense, the size of the modulo, in octets, must /* For PKCS#1 to make sense, the size of the modulo, in octets, must
...@@ -106,6 +103,11 @@ struct rsa_private_key ...@@ -106,6 +103,11 @@ struct rsa_private_key
* mpz_clear. * 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. */ /* Calls mpz_init to initialize bignum storage. */
void void
rsa_init_public_key(struct rsa_public_key *key); 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); ...@@ -183,10 +185,6 @@ rsa_compute_root(struct rsa_private_key *key, mpz_t x, const mpz_t m);
/* Key generation */ /* Key generation */
/* Progress report function. */
typedef void (*nettle_progress_func)(void *ctx,
int c);
/* Note that the key structs must be initialized first. */ /* Note that the key structs must be initialized first. */
int int
rsa_generate_keypair(struct rsa_public_key *pub, rsa_generate_keypair(struct rsa_public_key *pub,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment