diff --git a/src/crypto.c b/src/crypto.c index 07e82b80..e6f6d862 100644 --- a/src/crypto.c +++ b/src/crypto.c @@ -53,6 +53,11 @@ int crypto_cipher_key_len(enum crypto_cipher cipher) return 0; } +int crypto_cipher_tk_bits(enum crypto_cipher cipher) +{ + return crypto_cipher_key_len(cipher) * 8; +} + int crypto_psk_from_passphrase(const char *passphrase, const unsigned char *ssid, size_t ssid_len, unsigned char *out_psk) diff --git a/src/crypto.h b/src/crypto.h index e0b2df35..320c03da 100644 --- a/src/crypto.h +++ b/src/crypto.h @@ -32,6 +32,7 @@ enum crypto_cipher { }; int crypto_cipher_key_len(enum crypto_cipher cipher); +int crypto_cipher_tk_bits(enum crypto_cipher cipher); int crypto_psk_from_passphrase(const char *passphrase, const unsigned char *ssid, size_t ssid_len,