Lines Matching full:bignum
12 #include "bignum.h"
23 * struct bignum is just typecast to mp_int.
27 * bignum_init - Allocate memory for bignum
28 * Returns: Pointer to allocated bignum or %NULL on failure
30 struct bignum * bignum_init(void)
32 struct bignum *n = os_zalloc(sizeof(mp_int));
44 * bignum_deinit - Free bignum
45 * @n: Bignum from bignum_init()
47 void bignum_deinit(struct bignum *n)
57 * bignum_get_unsigned_bin - Get length of bignum as an unsigned binary buffer
58 * @n: Bignum from bignum_init()
61 size_t bignum_get_unsigned_bin_len(struct bignum *n)
68 * bignum_get_unsigned_bin - Set binary buffer to unsigned bignum
69 * @n: Bignum from bignum_init()
75 int bignum_get_unsigned_bin(const struct bignum *n, u8 *buf, size_t *len)
83 wpa_printf(MSG_DEBUG, "BIGNUM: %s failed", __func__);
93 * bignum_set_unsigned_bin - Set bignum based on unsigned binary buffer
94 * @n: Bignum from bignum_init(); to be set to the given value
99 int bignum_set_unsigned_bin(struct bignum *n, const u8 *buf, size_t len)
102 wpa_printf(MSG_DEBUG, "BIGNUM: %s failed", __func__);
111 * @a: Bignum from bignum_init()
112 * @b: Bignum from bignum_init()
115 int bignum_cmp(const struct bignum *a, const struct bignum *b)
122 * bignum_cmd_d - Compare bignum to standard integer
123 * @a: Bignum from bignum_init()
127 int bignum_cmp_d(const struct bignum *a, unsigned long b)
135 * @a: Bignum from bignum_init()
136 * @b: Bignum from bignum_init()
137 * @c: Bignum from bignum_init(); used to store the result of a + b
140 int bignum_add(const struct bignum *a, const struct bignum *b,
141 struct bignum *c)
144 wpa_printf(MSG_DEBUG, "BIGNUM: %s failed", __func__);
153 * @a: Bignum from bignum_init()
154 * @b: Bignum from bignum_init()
155 * @c: Bignum from bignum_init(); used to store the result of a - b
158 int bignum_sub(const struct bignum *a, const struct bignum *b,
159 struct bignum *c)
162 wpa_printf(MSG_DEBUG, "BIGNUM: %s failed", __func__);
171 * @a: Bignum from bignum_init()
172 * @b: Bignum from bignum_init()
173 * @c: Bignum from bignum_init(); used to store the result of a * b
176 int bignum_mul(const struct bignum *a, const struct bignum *b,
177 struct bignum *c)
180 wpa_printf(MSG_DEBUG, "BIGNUM: %s failed", __func__);
189 * @a: Bignum from bignum_init()
190 * @b: Bignum from bignum_init()
191 * @c: Bignum from bignum_init(); modulus
192 * @d: Bignum from bignum_init(); used to store the result of a * b (mod c)
195 int bignum_mulmod(const struct bignum *a, const struct bignum *b,
196 const struct bignum *c, struct bignum *d)
200 wpa_printf(MSG_DEBUG, "BIGNUM: %s failed", __func__);
209 * @a: Bignum from bignum_init(); base
210 * @b: Bignum from bignum_init(); exponent
211 * @c: Bignum from bignum_init(); modulus
212 * @d: Bignum from bignum_init(); used to store the result of a^b (mod c)
215 int bignum_exptmod(const struct bignum *a, const struct bignum *b,
216 const struct bignum *c, struct bignum *d)
220 wpa_printf(MSG_DEBUG, "BIGNUM: %s failed", __func__);