crypto: Add a function to get the ECDH prime length
crypto_ecdh_prime_len() can now be used to fetch the length (in octets) of the prime used in ECDH. Signed-off-by: Ilan Peer <ilan.peer@intel.com>
This commit is contained in:
parent
e8ae97aebe
commit
94773d40fa
3 changed files with 13 additions and 0 deletions
|
@ -916,5 +916,6 @@ struct wpabuf * crypto_ecdh_get_pubkey(struct crypto_ecdh *ecdh, int inc_y);
|
||||||
struct wpabuf * crypto_ecdh_set_peerkey(struct crypto_ecdh *ecdh, int inc_y,
|
struct wpabuf * crypto_ecdh_set_peerkey(struct crypto_ecdh *ecdh, int inc_y,
|
||||||
const u8 *key, size_t len);
|
const u8 *key, size_t len);
|
||||||
void crypto_ecdh_deinit(struct crypto_ecdh *ecdh);
|
void crypto_ecdh_deinit(struct crypto_ecdh *ecdh);
|
||||||
|
size_t crypto_ecdh_prime_len(struct crypto_ecdh *ecdh);
|
||||||
|
|
||||||
#endif /* CRYPTO_H */
|
#endif /* CRYPTO_H */
|
||||||
|
|
|
@ -2168,4 +2168,10 @@ void crypto_ecdh_deinit(struct crypto_ecdh *ecdh)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
size_t crypto_ecdh_prime_len(struct crypto_ecdh *ecdh)
|
||||||
|
{
|
||||||
|
return crypto_ec_prime_len(ecdh->ec);
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_ECC */
|
#endif /* CONFIG_ECC */
|
||||||
|
|
|
@ -1834,4 +1834,10 @@ fail:
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
size_t crypto_ecdh_prime_len(struct crypto_ecdh *ecdh)
|
||||||
|
{
|
||||||
|
return crypto_ec_prime_len(ecdh->ec);
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_ECC */
|
#endif /* CONFIG_ECC */
|
||||||
|
|
Loading…
Reference in a new issue