Commit 47eae4be authored by Niels Möller's avatar Niels Möller

Use size_t for ecc functions.

parent 95ce5d75
...@@ -48,7 +48,7 @@ ecc_ecdsa_sign (const struct ecc_curve *ecc, ...@@ -48,7 +48,7 @@ ecc_ecdsa_sign (const struct ecc_curve *ecc,
/* Random nonce, must be invertible mod ecc group /* Random nonce, must be invertible mod ecc group
order. */ order. */
const mp_limb_t *kp, const mp_limb_t *kp,
unsigned length, const uint8_t *digest, size_t length, const uint8_t *digest,
mp_limb_t *rp, mp_limb_t *sp, mp_limb_t *rp, mp_limb_t *sp,
mp_limb_t *scratch) mp_limb_t *scratch)
{ {
......
...@@ -62,7 +62,7 @@ ecc_ecdsa_verify_itch (const struct ecc_curve *ecc) ...@@ -62,7 +62,7 @@ ecc_ecdsa_verify_itch (const struct ecc_curve *ecc)
int int
ecc_ecdsa_verify (const struct ecc_curve *ecc, ecc_ecdsa_verify (const struct ecc_curve *ecc,
const mp_limb_t *pp, /* Public key */ const mp_limb_t *pp, /* Public key */
unsigned length, const uint8_t *digest, size_t length, const uint8_t *digest,
const mp_limb_t *rp, const mp_limb_t *sp, const mp_limb_t *rp, const mp_limb_t *sp,
mp_limb_t *scratch) mp_limb_t *scratch)
{ {
......
...@@ -41,9 +41,9 @@ ...@@ -41,9 +41,9 @@
void void
ecc_hash (const struct ecc_curve *ecc, ecc_hash (const struct ecc_curve *ecc,
mp_limb_t *hp, mp_limb_t *hp,
unsigned length, const uint8_t *digest) size_t length, const uint8_t *digest)
{ {
if (length > ((unsigned) ecc->bit_size + 7) / 8) if (length > ((size_t) ecc->bit_size + 7) / 8)
length = (ecc->bit_size + 7) / 8; length = (ecc->bit_size + 7) / 8;
mpn_set_base256 (hp, ecc->size + 1, digest, length); mpn_set_base256 (hp, ecc->size + 1, digest, length);
......
...@@ -202,7 +202,7 @@ ecc_mod (mp_limb_t *rp, mp_size_t rn, mp_size_t mn, ...@@ -202,7 +202,7 @@ ecc_mod (mp_limb_t *rp, mp_size_t rn, mp_size_t mn,
void void
ecc_hash (const struct ecc_curve *ecc, ecc_hash (const struct ecc_curve *ecc,
mp_limb_t *hp, mp_limb_t *hp,
unsigned length, const uint8_t *digest); size_t length, const uint8_t *digest);
void void
cnd_copy (int cnd, mp_limb_t *rp, const mp_limb_t *ap, mp_size_t n); cnd_copy (int cnd, mp_limb_t *rp, const mp_limb_t *ap, mp_size_t n);
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
void void
ecdsa_sign (const struct ecc_scalar *key, ecdsa_sign (const struct ecc_scalar *key,
void *random_ctx, nettle_random_func *random, void *random_ctx, nettle_random_func *random,
unsigned digest_length, size_t digest_length,
const uint8_t *digest, const uint8_t *digest,
struct dsa_signature *signature) struct dsa_signature *signature)
{ {
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
int int
ecdsa_verify (const struct ecc_point *pub, ecdsa_verify (const struct ecc_point *pub,
unsigned length, const uint8_t *digest, size_t length, const uint8_t *digest,
const struct dsa_signature *signature) const struct dsa_signature *signature)
{ {
mp_limb_t size = pub->ecc->size; mp_limb_t size = pub->ecc->size;
......
...@@ -48,13 +48,13 @@ extern "C" { ...@@ -48,13 +48,13 @@ extern "C" {
void void
ecdsa_sign (const struct ecc_scalar *key, ecdsa_sign (const struct ecc_scalar *key,
void *random_ctx, nettle_random_func *random, void *random_ctx, nettle_random_func *random,
unsigned digest_length, size_t digest_length,
const uint8_t *digest, const uint8_t *digest,
struct dsa_signature *signature); struct dsa_signature *signature);
int int
ecdsa_verify (const struct ecc_point *pub, ecdsa_verify (const struct ecc_point *pub,
unsigned length, const uint8_t *digest, size_t length, const uint8_t *digest,
const struct dsa_signature *signature); const struct dsa_signature *signature);
void void
...@@ -72,7 +72,7 @@ ecc_ecdsa_sign (const struct ecc_curve *ecc, ...@@ -72,7 +72,7 @@ ecc_ecdsa_sign (const struct ecc_curve *ecc,
/* Random nonce, must be invertible mod ecc group /* Random nonce, must be invertible mod ecc group
order. */ order. */
const mp_limb_t *kp, const mp_limb_t *kp,
unsigned length, const uint8_t *digest, size_t length, const uint8_t *digest,
mp_limb_t *rp, mp_limb_t *sp, mp_limb_t *rp, mp_limb_t *sp,
mp_limb_t *scratch); mp_limb_t *scratch);
...@@ -82,7 +82,7 @@ ecc_ecdsa_verify_itch (const struct ecc_curve *ecc); ...@@ -82,7 +82,7 @@ ecc_ecdsa_verify_itch (const struct ecc_curve *ecc);
int int
ecc_ecdsa_verify (const struct ecc_curve *ecc, ecc_ecdsa_verify (const struct ecc_curve *ecc,
const mp_limb_t *pp, /* Public key */ const mp_limb_t *pp, /* Public key */
unsigned length, const uint8_t *digest, size_t length, const uint8_t *digest,
const mp_limb_t *rp, const mp_limb_t *sp, const mp_limb_t *rp, const mp_limb_t *sp,
mp_limb_t *scratch); mp_limb_t *scratch);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment