$search
#include "includes.h"#include "common.h"#include "bignum.h"#include <tommath.h>

Go to the source code of this file.
Functions | |
| int | bignum_add (const struct bignum *a, const struct bignum *b, struct bignum *c) |
| int | bignum_cmp (const struct bignum *a, const struct bignum *b) |
| int | bignum_cmp_d (const struct bignum *a, unsigned long b) |
| void | bignum_deinit (struct bignum *n) |
| int | bignum_exptmod (const struct bignum *a, const struct bignum *b, const struct bignum *c, struct bignum *d) |
| int | bignum_get_unsigned_bin (const struct bignum *n, u8 *buf, size_t *len) |
| size_t | bignum_get_unsigned_bin_len (struct bignum *n) |
| struct bignum * | bignum_init (void) |
| int | bignum_mul (const struct bignum *a, const struct bignum *b, struct bignum *c) |
| int | bignum_mulmod (const struct bignum *a, const struct bignum *b, const struct bignum *c, struct bignum *d) |
| int | bignum_set_unsigned_bin (struct bignum *n, const u8 *buf, size_t len) |
| int | bignum_sub (const struct bignum *a, const struct bignum *b, struct bignum *c) |
| int bignum_add | ( | const struct bignum * | a, | |
| const struct bignum * | b, | |||
| struct bignum * | c | |||
| ) |
bignum_add - c = a + b : Bignum from bignum_init() : Bignum from bignum_init() : Bignum from bignum_init(); used to store the result of a + b Returns: 0 on success, -1 on failure
| int bignum_cmp | ( | const struct bignum * | a, | |
| const struct bignum * | b | |||
| ) |
bignum_cmp - Signed comparison : Bignum from bignum_init() : Bignum from bignum_init() Returns: 0 on success, -1 on failure
| int bignum_cmp_d | ( | const struct bignum * | a, | |
| unsigned long | b | |||
| ) |
bignum_cmd_d - Compare bignum to standard integer : Bignum from bignum_init() : Small integer Returns: 0 on success, -1 on failure
| void bignum_deinit | ( | struct bignum * | n | ) |
bignum_deinit - Free bignum
: Bignum from bignum_init()
| int bignum_exptmod | ( | const struct bignum * | a, | |
| const struct bignum * | b, | |||
| const struct bignum * | c, | |||
| struct bignum * | d | |||
| ) |
bignum_exptmod - Modular exponentiation: d = a^b (mod c) : Bignum from bignum_init(); base : Bignum from bignum_init(); exponent : Bignum from bignum_init(); modulus : Bignum from bignum_init(); used to store the result of a^b (mod c) Returns: 0 on success, -1 on failure
| int bignum_get_unsigned_bin | ( | const struct bignum * | n, | |
| u8 * | buf, | |||
| size_t * | len | |||
| ) |
bignum_get_unsigned_bin - Set binary buffer to unsigned bignum
: Bignum from bignum_init() : Buffer for the binary number : Length of the buffer, can be NULL if buffer is known to be long enough. Set to used buffer length on success if not NULL. Returns: 0 on success, -1 on failure
| size_t bignum_get_unsigned_bin_len | ( | struct bignum * | n | ) |
bignum_get_unsigned_bin - Get length of bignum as an unsigned binary buffer
: Bignum from bignum_init() Returns: Length of n if written to a binary buffer
| struct bignum* bignum_init | ( | void | ) | [read] |
| int bignum_mul | ( | const struct bignum * | a, | |
| const struct bignum * | b, | |||
| struct bignum * | c | |||
| ) |
bignum_mul - c = a * b : Bignum from bignum_init() : Bignum from bignum_init() : Bignum from bignum_init(); used to store the result of a * b Returns: 0 on success, -1 on failure
| int bignum_mulmod | ( | const struct bignum * | a, | |
| const struct bignum * | b, | |||
| const struct bignum * | c, | |||
| struct bignum * | d | |||
| ) |
bignum_mulmod - d = a * b (mod c) : Bignum from bignum_init() : Bignum from bignum_init() : Bignum from bignum_init(); modulus : Bignum from bignum_init(); used to store the result of a * b (mod c) Returns: 0 on success, -1 on failure
| int bignum_set_unsigned_bin | ( | struct bignum * | n, | |
| const u8 * | buf, | |||
| size_t | len | |||
| ) |
bignum_set_unsigned_bin - Set bignum based on unsigned binary buffer
: Bignum from bignum_init(); to be set to the given value : Buffer with unsigned binary value : Length of buf in octets Returns: 0 on success, -1 on failure
| int bignum_sub | ( | const struct bignum * | a, | |
| const struct bignum * | b, | |||
| struct bignum * | c | |||
| ) |
bignum_sub - c = a - b : Bignum from bignum_init() : Bignum from bignum_init() : Bignum from bignum_init(); used to store the result of a - b Returns: 0 on success, -1 on failure