Skip to content

Commit

Permalink
crypto: dh - return unsigned value for crypto_dh_key_len()
Browse files Browse the repository at this point in the history
DH_KPP_SECRET_MIN_SIZE and dh_data_size() are both returning
unsigned values.

Signed-off-by: Tudor Ambarus <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
ambarus authored and herbertx committed Oct 12, 2017
1 parent cb195b3 commit 5b3f3a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crypto/dh_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion include/crypto/dh.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5b3f3a8

Please sign in to comment.