summaryrefslogtreecommitdiff
path: root/rsa.h
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2002-10-09 21:32:44 +0200
committerNiels Möller <nisse@lysator.liu.se>2002-10-09 21:32:44 +0200
commit6322f02baa9d09fa1b292a7136ddc5bdb9f50879 (patch)
tree8e120e4116178fd62031ced4e721e5c14e6a111a /rsa.h
parent5ee81e7ebb5c6ccabf119eb4b7c6508bb8099d41 (diff)
downloadnettle-6322f02baa9d09fa1b292a7136ddc5bdb9f50879.tar.gz
* rsa-decrypt.c (rsa_decrypt): Constification.
* rsa-encrypt.c (rsa_encrypt): Likewise. * rsa.c (rsa_compute_root): Likewise. * rsa_md5.c (rsa_md5_sign): Likewise. (rsa_md5_verify): Likewise. * rsa_sha1.c (rsa_sha1_sign): Likewise. (rsa_sha1_verify): Likewise. Rev: src/nettle/rsa-decrypt.c:1.2 Rev: src/nettle/rsa-encrypt.c:1.2 Rev: src/nettle/rsa.c:1.9 Rev: src/nettle/rsa.h:1.15 Rev: src/nettle/rsa_md5.c:1.6 Rev: src/nettle/rsa_sha1.c:1.6
Diffstat (limited to 'rsa.h')
-rw-r--r--rsa.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/rsa.h b/rsa.h
index 9f98db1a..7ba9a4a0 100644
--- a/rsa.h
+++ b/rsa.h
@@ -133,23 +133,23 @@ rsa_prepare_private_key(struct rsa_private_key *key);
/* PKCS#1 style signatures */
void
-rsa_md5_sign(struct rsa_private_key *key,
+rsa_md5_sign(const struct rsa_private_key *key,
struct md5_ctx *hash,
mpz_t signature);
int
-rsa_md5_verify(struct rsa_public_key *key,
+rsa_md5_verify(const struct rsa_public_key *key,
struct md5_ctx *hash,
const mpz_t signature);
void
-rsa_sha1_sign(struct rsa_private_key *key,
+rsa_sha1_sign(const struct rsa_private_key *key,
struct sha1_ctx *hash,
mpz_t signature);
int
-rsa_sha1_verify(struct rsa_public_key *key,
+rsa_sha1_verify(const struct rsa_public_key *key,
struct sha1_ctx *hash,
const mpz_t signature);
@@ -161,7 +161,7 @@ rsa_sha1_verify(struct rsa_public_key *key,
/* Returns 1 on success, 0 on failure, which happens if the
* message is too long for the key. */
int
-rsa_encrypt(struct rsa_public_key *key,
+rsa_encrypt(const struct rsa_public_key *key,
/* For padding */
void *random_ctx, nettle_random_func random,
unsigned length, const uint8_t *cleartext,
@@ -173,14 +173,15 @@ rsa_encrypt(struct rsa_public_key *key,
* failure, which happens if decryption failed or if the message
* didn't fit. */
int
-rsa_decrypt(struct rsa_private_key *key,
+rsa_decrypt(const struct rsa_private_key *key,
unsigned *length, uint8_t *cleartext,
const mpz_t ciphertext);
/* Compute x, the e:th root of m. Calling it with x == m is allowed. */
void
-rsa_compute_root(struct rsa_private_key *key, mpz_t x, const mpz_t m);
+rsa_compute_root(const struct rsa_private_key *key,
+ mpz_t x, const mpz_t m);
/* Key generation */