aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/dragonfly.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@codeaurora.org>2019-07-23 18:21:30 (GMT)
committerJouni Malinen <j@w1.fi>2019-07-23 18:21:30 (GMT)
commitbfb6a482f6ed805f01bfafe201a5a7226c55ee9b (patch)
tree4f5ef1b54dd8d591002e346c76bb75e75f198904 /src/common/dragonfly.c
parent036fc6bdbdc854f724a8651093d4a7678821dfa1 (diff)
downloadhostap-bfb6a482f6ed805f01bfafe201a5a7226c55ee9b.zip
hostap-bfb6a482f6ed805f01bfafe201a5a7226c55ee9b.tar.gz
hostap-bfb6a482f6ed805f01bfafe201a5a7226c55ee9b.tar.bz2
dragonfly: SAE/EAP-pwd min PWE derivation iteration count to shared code
Use a shared function to determine the k parameter, i.e., the minimum number of iterations of the PWE derivation loop, for SAE and EAP-pwd. This makes it easier to fine-tune the parameter based on the negotiated group, if desired. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Diffstat (limited to 'src/common/dragonfly.c')
-rw-r--r--src/common/dragonfly.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/common/dragonfly.c b/src/common/dragonfly.c
index e98bce6..233ae68 100644
--- a/src/common/dragonfly.c
+++ b/src/common/dragonfly.c
@@ -29,6 +29,25 @@ int dragonfly_suitable_group(int group, int ecc_only)
}
+unsigned int dragonfly_min_pwe_loop_iter(int group)
+{
+ if (group == 22 || group == 23 || group == 24) {
+ /* FFC groups for which pwd-value is likely to be >= p
+ * frequently */
+ return 40;
+ }
+
+ if (group == 1 || group == 2 || group == 5 || group == 14 ||
+ group == 15 || group == 16 || group == 17 || group == 18) {
+ /* FFC groups that have prime that is close to a power of two */
+ return 1;
+ }
+
+ /* Default to 40 (this covers most ECC groups) */
+ return 40;
+}
+
+
int dragonfly_get_random_qr_qnr(const struct crypto_bignum *prime,
struct crypto_bignum **qr,
struct crypto_bignum **qnr)