#include "includes.h"
#include "common.h"
#include "bignum.h"
#include <tommath.h>
Include dependency graph for bignum.c:
Go to the source code of this file.
Functions | |
bignum * | bignum_init (void) |
Allocate memory for bignum. | |
void | bignum_deinit (struct bignum *n) |
Free bignum. | |
size_t | bignum_get_unsigned_bin_len (struct bignum *n) |
Get length of bignum as an unsigned binary buffer. | |
int | bignum_get_unsigned_bin (const struct bignum *n, u8 *buf, size_t *len) |
Set binary buffer to unsigned bignum. | |
int | bignum_set_unsigned_bin (struct bignum *n, const u8 *buf, size_t len) |
Set bignum based on unsigned binary buffer. | |
int | bignum_cmp (const struct bignum *a, const struct bignum *b) |
Signed comparison. | |
int | bignum_cmp_d (const struct bignum *a, unsigned long b) |
Compare bignum to standard integer. | |
int | bignum_add (const struct bignum *a, const struct bignum *b, struct bignum *c) |
c = a + b | |
int | bignum_sub (const struct bignum *a, const struct bignum *b, struct bignum *c) |
c = a - b | |
int | bignum_mul (const struct bignum *a, const struct bignum *b, struct bignum *c) |
c = a * b | |
int | bignum_mulmod (const struct bignum *a, const struct bignum *b, const struct bignum *c, struct bignum *d) |
d = a * b (mod c) | |
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). |
Alternatively, this software may be distributed under the terms of BSD license.
See README and COPYING for more details.
Definition in file bignum.c.
|
c = a + b
Definition at line 155 of file bignum.c. Here is the call graph for this function: |
|
Signed comparison.
|
|
Compare bignum to standard integer.
|
|
Free bignum.
|
|
Modular exponentiation: d = a^b (mod c).
Definition at line 234 of file bignum.c. Here is the call graph for this function: |
|
Set binary buffer to unsigned bignum.
Definition at line 86 of file bignum.c. Here is the call graph for this function: |
|
Get length of bignum as an unsigned binary buffer.
|
|
Allocate memory for bignum.
Definition at line 38 of file bignum.c. Here is the call graph for this function: |
|
c = a * b
Definition at line 193 of file bignum.c. Here is the call graph for this function: |
|
d = a * b (mod c)
Definition at line 213 of file bignum.c. Here is the call graph for this function: |
|
Set bignum based on unsigned binary buffer.
Definition at line 111 of file bignum.c. Here is the call graph for this function: |
|
c = a - b
Definition at line 174 of file bignum.c. Here is the call graph for this function: |