OSDN Git Service

crypto: dh - return unsigned value for crypto_dh_key_len()
authorTudor-Dan Ambarus <tudor.ambarus@microchip.com>
Fri, 29 Sep 2017 09:21:05 +0000 (12:21 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 12 Oct 2017 14:55:05 +0000 (22:55 +0800)
DH_KPP_SECRET_MIN_SIZE and dh_data_size() are both returning
unsigned values.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/dh_helper.c
include/crypto/dh.h

index 69869da..a413b31 100644 (file)
@@ -33,7 +33,7 @@ static inline unsigned int dh_data_size(const struct dh *p)
        return p->key_size + p->p_size + p->g_size;
 }
 
-int crypto_dh_key_len(const struct dh *p)
+unsigned int crypto_dh_key_len(const struct dh *p)
 {
        return DH_KPP_SECRET_MIN_SIZE + dh_data_size(p);
 }
index f638998..71e1bb2 100644 (file)
@@ -53,7 +53,7 @@ struct dh {
  *
  * Return: size of the key in bytes
  */
-int crypto_dh_key_len(const struct dh *params);
+unsigned int crypto_dh_key_len(const struct dh *params);
 
 /**
  * crypto_dh_encode_key() - encode the private key