blob: e7627ef06dec461204de2ca877cdb3a2b1518c5c [file] [log] [blame]
Hai Shalom878cf7b2019-07-15 14:55:18 -07001/*
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
15struct crypto_bignum;
16struct crypto_ec;
17
18int dragonfly_suitable_group(int group, int ecc_only);
19int dragonfly_get_random_qr_qnr(const struct crypto_bignum *prime,
20 struct crypto_bignum **qr,
21 struct crypto_bignum **qnr);
22int dragonfly_is_quadratic_residue_blind(struct crypto_ec *ec,
23 const u8 *qr, const u8 *qnr,
24 const struct crypto_bignum *val);
25int dragonfly_generate_scalar(const struct crypto_bignum *order,
26 struct crypto_bignum *_rand,
27 struct crypto_bignum *_mask,
28 struct crypto_bignum *scalar);
29
30#endif /* DRAGONFLY_H */