Skip to content

Commit 5b3f3a8

Browse files
ambarusherbertx
authored andcommitted
crypto: dh - return unsigned value for crypto_dh_key_len()
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>
1 parent cb195b3 commit 5b3f3a8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

crypto/dh_helper.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static inline unsigned int dh_data_size(const struct dh *p)
3333
return p->key_size + p->p_size + p->g_size;
3434
}
3535

36-
int crypto_dh_key_len(const struct dh *p)
36+
unsigned int crypto_dh_key_len(const struct dh *p)
3737
{
3838
return DH_KPP_SECRET_MIN_SIZE + dh_data_size(p);
3939
}

include/crypto/dh.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ struct dh {
5353
*
5454
* Return: size of the key in bytes
5555
*/
56-
int crypto_dh_key_len(const struct dh *params);
56+
unsigned int crypto_dh_key_len(const struct dh *params);
5757

5858
/**
5959
* crypto_dh_encode_key() - encode the private key

0 commit comments

Comments
 (0)