15 int bignum_cmp(
const struct bignum *a,
const struct bignum *b);
16 int bignum_cmp_d(
const struct bignum *a,
unsigned long b);
17 int bignum_add(
const struct bignum *a,
const struct bignum *b,
19 int bignum_sub(
const struct bignum *a,
const struct bignum *b,
21 int bignum_mul(
const struct bignum *a,
const struct bignum *b,
23 int bignum_mulmod(
const struct bignum *a,
const struct bignum *b,
24 const struct bignum *c,
struct bignum *d);
26 const struct bignum *c,
struct bignum *d);
int bignum_cmp(const struct bignum *a, const struct bignum *b)
Signed comparison.
Definition: bignum.c:111
int bignum_mulmod(const struct bignum *a, const struct bignum *b, const struct bignum *c, struct bignum *d)
d = a * b (mod c)
Definition: bignum.c:191
int bignum_exptmod(const struct bignum *a, const struct bignum *b, const struct bignum *c, struct bignum *d)
Modular exponentiation: d = a^b (mod c)
Definition: bignum.c:211
int bignum_add(const struct bignum *a, const struct bignum *b, struct bignum *c)
c = a + b
Definition: bignum.c:136
struct bignum * bignum_init(void)
Allocate memory for bignum.
Definition: bignum.c:26
int bignum_cmp_d(const struct bignum *a, unsigned long b)
Compare bignum to standard integer.
Definition: bignum.c:123
int bignum_set_unsigned_bin(struct bignum *n, const u8 *buf, size_t len)
Set bignum based on unsigned binary buffer.
Definition: bignum.c:95
int bignum_get_unsigned_bin(const struct bignum *n, u8 *buf, size_t *len)
Set binary buffer to unsigned bignum.
Definition: bignum.c:71
void bignum_deinit(struct bignum *n)
Free bignum.
Definition: bignum.c:43
size_t bignum_get_unsigned_bin_len(struct bignum *n)
Get length of bignum as an unsigned binary buffer.
Definition: bignum.c:57
int bignum_sub(const struct bignum *a, const struct bignum *b, struct bignum *c)
c = a - b
Definition: bignum.c:154
int bignum_mul(const struct bignum *a, const struct bignum *b, struct bignum *c)
c = a * b
Definition: bignum.c:172