From f647e03166adc4aaeb3027d8fb33916474162989 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Fri, 26 Dec 2014 12:15:46 -0600 Subject: [PATCH] crypto: Add crypto_cipher_tk_bits --- src/crypto.c | 5 +++++ src/crypto.h | 1 + 2 files changed, 6 insertions(+) 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,