Home | History | Annotate | Download | only in wpa_supplicant

Lines Matching full:bignum

18 #include "bignum.h"
29 * struct bignum is just typecast to mp_int.
33 * bignum_init - Allocate memory for bignum
34 * Returns: Pointer to allocated bignum or %NULL on failure
36 struct bignum * bignum_init(void)
38 struct bignum *n = os_zalloc(sizeof(mp_int));
50 * bignum_deinit - Free bignum
51 * @n: Bignum from bignum_init()
53 void bignum_deinit(struct bignum *n)
63 * bignum_get_unsigned_bin - Get length of bignum as an unsigned binary buffer
64 * @n: Bignum from bignum_init()
67 size_t bignum_get_unsigned_bin_len(struct bignum *n)
74 * bignum_get_unsigned_bin - Set binary buffer to unsigned bignum
75 * @n: Bignum from bignum_init()
81 int bignum_get_unsigned_bin(const struct bignum *n, u8 *buf, size_t *len)
89 wpa_printf(MSG_DEBUG, "BIGNUM: %s failed", __func__);
99 * bignum_set_unsigned_bin - Set bignum based on unsigned binary buffer
100 * @a: Bignum from bignum_init(); to be set to the given value
105 int bignum_set_unsigned_bin(struct bignum *n, const u8 *buf, size_t len)
108 wpa_printf(MSG_DEBUG, "BIGNUM: %s failed", __func__);
117 * @a: Bignum from bignum_init()
118 * @b: Bignum from bignum_init()
121 int bignum_cmp(const struct bignum *a, const struct bignum *b)
128 * bignum_cmd_d - Compare bignum to standard integer
129 * @a: Bignum from bignum_init()
133 int bignum_cmp_d(const struct bignum *a, unsigned long b)
141 * @a: Bignum from bignum_init()
142 * @b: Bignum from bignum_init()
143 * @c: Bignum from bignum_init(); used to store the result of a + b
146 int bignum_add(const struct bignum *a, const struct bignum *b,
147 struct bignum *c)
150 wpa_printf(MSG_DEBUG, "BIGNUM: %s failed", __func__);
159 * @a: Bignum from bignum_init()
160 * @b: Bignum from bignum_init()
161 * @c: Bignum from bignum_init(); used to store the result of a - b
164 int bignum_sub(const struct bignum *a, const struct bignum *b,
165 struct bignum *c)
168 wpa_printf(MSG_DEBUG, "BIGNUM: %s failed", __func__);
177 * @a: Bignum from bignum_init()
178 * @b: Bignum from bignum_init()
179 * @c: Bignum from bignum_init(); used to store the result of a * b
182 int bignum_mul(const struct bignum *a, const struct bignum *b,
183 struct bignum *c)
186 wpa_printf(MSG_DEBUG, "BIGNUM: %s failed", __func__);
195 * @a: Bignum from bignum_init()
196 * @b: Bignum from bignum_init()
197 * @c: Bignum from bignum_init(); modulus
198 * @d: Bignum from bignum_init(); used to store the result of a * b (mod c)
201 int bignum_mulmod(const struct bignum *a, const struct bignum *b,
202 const struct bignum *c, struct bignum *d)
206 wpa_printf(MSG_DEBUG, "BIGNUM: %s failed", __func__);
215 * @a: Bignum from bignum_init(); base
216 * @b: Bignum from bignum_init(); exponent
217 * @c: Bignum from bignum_init(); modulus
218 * @d: Bignum from bignum_init(); used to store the result of a^b (mod c)
221 int bignum_exptmod(const struct bignum *a, const struct bignum *b,
222 const struct bignum *c, struct bignum *d)
226 wpa_printf(MSG_DEBUG, "BIGNUM: %s failed", __func__);