bignum.h
Go to the documentation of this file.00001
00016 #ifndef BIGNUM_H
00017 #define BIGNUM_H
00018
00019 struct bignum;
00020
00021 struct bignum * bignum_init(void);
00022 void bignum_deinit(struct bignum *n);
00023 size_t bignum_get_unsigned_bin_len(struct bignum *n);
00024 int bignum_get_unsigned_bin(const struct bignum *n, u8 *buf, size_t *len);
00025 int bignum_set_unsigned_bin(struct bignum *n, const u8 *buf, size_t len);
00026 int bignum_cmp(const struct bignum *a, const struct bignum *b);
00027 int bignum_cmp_d(const struct bignum *a, unsigned long b);
00028 int bignum_add(const struct bignum *a, const struct bignum *b,
00029 struct bignum *c);
00030 int bignum_sub(const struct bignum *a, const struct bignum *b,
00031 struct bignum *c);
00032 int bignum_mul(const struct bignum *a, const struct bignum *b,
00033 struct bignum *c);
00034 int bignum_mulmod(const struct bignum *a, const struct bignum *b,
00035 const struct bignum *c, struct bignum *d);
00036 int bignum_exptmod(const struct bignum *a, const struct bignum *b,
00037 const struct bignum *c, struct bignum *d);
00038
00039 #endif
00040