1*a1157835SDaniel Fojt /* 2*a1157835SDaniel Fojt * Shared Dragonfly functionality 3*a1157835SDaniel Fojt * Copyright (c) 2012-2016, Jouni Malinen <j@w1.fi> 4*a1157835SDaniel Fojt * Copyright (c) 2019, The Linux Foundation 5*a1157835SDaniel Fojt * 6*a1157835SDaniel Fojt * This software may be distributed under the terms of the BSD license. 7*a1157835SDaniel Fojt * See README for more details. 8*a1157835SDaniel Fojt */ 9*a1157835SDaniel Fojt 10*a1157835SDaniel Fojt #ifndef DRAGONFLY_H 11*a1157835SDaniel Fojt #define DRAGONFLY_H 12*a1157835SDaniel Fojt 13*a1157835SDaniel Fojt #define DRAGONFLY_MAX_ECC_PRIME_LEN 66 14*a1157835SDaniel Fojt 15*a1157835SDaniel Fojt struct crypto_bignum; 16*a1157835SDaniel Fojt struct crypto_ec; 17*a1157835SDaniel Fojt 18*a1157835SDaniel Fojt int dragonfly_suitable_group(int group, int ecc_only); 19*a1157835SDaniel Fojt unsigned int dragonfly_min_pwe_loop_iter(int group); 20*a1157835SDaniel Fojt int dragonfly_get_random_qr_qnr(const struct crypto_bignum *prime, 21*a1157835SDaniel Fojt struct crypto_bignum **qr, 22*a1157835SDaniel Fojt struct crypto_bignum **qnr); 23*a1157835SDaniel Fojt int dragonfly_is_quadratic_residue_blind(struct crypto_ec *ec, 24*a1157835SDaniel Fojt const u8 *qr, const u8 *qnr, 25*a1157835SDaniel Fojt const struct crypto_bignum *val); 26*a1157835SDaniel Fojt int dragonfly_generate_scalar(const struct crypto_bignum *order, 27*a1157835SDaniel Fojt struct crypto_bignum *_rand, 28*a1157835SDaniel Fojt struct crypto_bignum *_mask, 29*a1157835SDaniel Fojt struct crypto_bignum *scalar); 30*a1157835SDaniel Fojt 31*a1157835SDaniel Fojt #endif /* DRAGONFLY_H */ 32