diff options
author | Niels Möller <nisse@lysator.liu.se> | 2013-04-26 14:39:27 +0200 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2013-04-26 14:39:27 +0200 |
commit | a78265874b34c2885ceb32e839698b2a892b274e (patch) | |
tree | 7e0e4c2ab7e4911c8801bfbaae684687ecf1e1e0 /rsa.h | |
parent | 64bb6b36b0b12873a9ad93b77bc006f6fd7a70da (diff) | |
download | nettle-a78265874b34c2885ceb32e839698b2a892b274e.tar.gz |
Use size_t for bignums, rsa and dsa.
Diffstat (limited to 'rsa.h')
-rw-r--r-- | rsa.h | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -95,7 +95,7 @@ struct rsa_public_key { /* Size of the modulo, in octets. This is also the size of all * signatures that are created or verified with this key. */ - unsigned size; + size_t size; /* Modulo */ mpz_t n; @@ -106,7 +106,7 @@ struct rsa_public_key struct rsa_private_key { - unsigned size; + size_t size; /* d is filled in by the key generation function; otherwise it's * completely unused. */ @@ -174,18 +174,18 @@ rsa_private_key_prepare(struct rsa_private_key *key); /* PKCS#1 style signatures */ int rsa_pkcs1_sign(const struct rsa_private_key *key, - unsigned length, const uint8_t *digest_info, + size_t length, const uint8_t *digest_info, mpz_t s); int rsa_pkcs1_sign_tr(const struct rsa_public_key *pub, const struct rsa_private_key *key, void *random_ctx, nettle_random_func *random, - unsigned length, const uint8_t *digest_info, + size_t length, const uint8_t *digest_info, mpz_t s); int rsa_pkcs1_verify(const struct rsa_public_key *key, - unsigned length, const uint8_t *digest_info, + size_t length, const uint8_t *digest_info, const mpz_t signature); int @@ -281,7 +281,7 @@ int rsa_encrypt(const struct rsa_public_key *key, /* For padding */ void *random_ctx, nettle_random_func *random, - unsigned length, const uint8_t *cleartext, + size_t length, const uint8_t *cleartext, mpz_t cipher); /* Message must point to a buffer of size *LENGTH. KEY->size is enough @@ -291,7 +291,7 @@ rsa_encrypt(const struct rsa_public_key *key, * didn't fit. */ int rsa_decrypt(const struct rsa_private_key *key, - unsigned *length, uint8_t *cleartext, + size_t *length, uint8_t *cleartext, const mpz_t ciphertext); /* Timing-resistant version, using randomized RSA blinding. */ @@ -299,7 +299,7 @@ int rsa_decrypt_tr(const struct rsa_public_key *pub, const struct rsa_private_key *key, void *random_ctx, nettle_random_func *random, - unsigned *length, uint8_t *message, + size_t *length, uint8_t *message, const mpz_t gibberish); /* Compute x, the e:th root of m. Calling it with x == m is allowed. */ @@ -364,7 +364,7 @@ int rsa_keypair_from_sexp(struct rsa_public_key *pub, struct rsa_private_key *priv, unsigned limit, - unsigned length, const uint8_t *expr); + size_t length, const uint8_t *expr); /* Keys in PKCS#1 format. */ @@ -402,7 +402,7 @@ _rsa_verify(const struct rsa_public_key *key, const mpz_t m, const mpz_t s); -unsigned +size_t _rsa_check_size(mpz_t n); void |