Hai Shalom | 81f62d8 | 2019-07-22 12:10:00 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Shared Dragonfly functionality |
| 3 | * Copyright (c) 2012-2016, Jouni Malinen <j@w1.fi> |
| 4 | * Copyright (c) 2019, The Linux Foundation |
| 5 | * |
| 6 | * This software may be distributed under the terms of the BSD license. |
| 7 | * See README for more details. |
| 8 | */ |
| 9 | |
| 10 | #ifndef DRAGONFLY_H |
| 11 | #define DRAGONFLY_H |
| 12 | |
| 13 | #define DRAGONFLY_MAX_ECC_PRIME_LEN 66 |
| 14 | |
| 15 | struct crypto_bignum; |
| 16 | struct crypto_ec; |
| 17 | |
| 18 | int dragonfly_suitable_group(int group, int ecc_only); |
Hai Shalom | c356592 | 2019-10-28 11:58:20 -0700 | [diff] [blame] | 19 | unsigned int dragonfly_min_pwe_loop_iter(int group); |
Hai Shalom | 81f62d8 | 2019-07-22 12:10:00 -0700 | [diff] [blame] | 20 | int dragonfly_get_random_qr_qnr(const struct crypto_bignum *prime, |
| 21 | struct crypto_bignum **qr, |
| 22 | struct crypto_bignum **qnr); |
| 23 | int dragonfly_is_quadratic_residue_blind(struct crypto_ec *ec, |
| 24 | const u8 *qr, const u8 *qnr, |
| 25 | const struct crypto_bignum *val); |
| 26 | int dragonfly_generate_scalar(const struct crypto_bignum *order, |
| 27 | struct crypto_bignum *_rand, |
| 28 | struct crypto_bignum *_mask, |
| 29 | struct crypto_bignum *scalar); |
Hai Shalom | a20dcd7 | 2022-02-04 13:43:00 -0800 | [diff] [blame^] | 30 | int dragonfly_sqrt(struct crypto_ec *ec, const struct crypto_bignum *val, |
| 31 | struct crypto_bignum *res); |
Hai Shalom | 81f62d8 | 2019-07-22 12:10:00 -0700 | [diff] [blame] | 32 | |
| 33 | #endif /* DRAGONFLY_H */ |