#include <stdlib.h>#include <limits.h>#include <string.h>#include <stdio.h>#include <time.h>#include "bigint.h"#include "crypto.h"Go to the source code of this file.
Functions | |
| static bigint * | bi_int_multiply (BI_CTX *ctx, bigint *bia, comp b) |
| Perform a multiply between a bigint an an (unsigned) integer. | |
| static bigint * | bi_int_divide (BI_CTX *ctx, bigint *biR, comp denom) |
| static bigint __malloc * | alloc (BI_CTX *ctx, int size) |
| static bigint * | trim (bigint *bi) |
| static void | more_comps (bigint *bi, int n) |
| BI_CTX * | bi_initialize (void) |
| Start a new bigint context. | |
| void | bi_terminate (BI_CTX *ctx) |
| Close the bigint context and free any resources. | |
| bigint * | bi_copy (bigint *bi) |
| Increment the number of references to this object. | |
| void | bi_permanent (bigint *bi) |
| Simply make a bigint object "unfreeable" if bi_free() is called on it. | |
| void | bi_depermanent (bigint *bi) |
| Take a permanent object and make it eligible for freedom. | |
| void | bi_free (BI_CTX *ctx, bigint *bi) |
| Free a bigint object so it can be used again. | |
| bigint * | int_to_bi (BI_CTX *ctx, comp i) |
| Convert an (unsigned) integer into a bigint. | |
| bigint * | bi_clone (BI_CTX *ctx, const bigint *bi) |
| Do a full copy of the bigint object. | |
| bigint * | bi_add (BI_CTX *ctx, bigint *bia, bigint *bib) |
| Perform an addition operation between two bigints. | |
| bigint * | bi_subtract (BI_CTX *ctx, bigint *bia, bigint *bib, int *is_negative) |
| Perform a subtraction operation between two bigints. | |
| bigint * | bi_divide (BI_CTX *ctx, bigint *u, bigint *v, int is_mod) |
| Does both division and modulo calculations. | |
| static bigint * | bi_int_divide (BI_CTX *ctx __unused, bigint *biR, comp denom) |
| bigint * | bi_import (BI_CTX *ctx, const uint8_t *data, int size) |
| Allow a binary sequence to be imported as a bigint. | |
| void | bi_export (BI_CTX *ctx, bigint *x, uint8_t *data, int size) |
| Take a bigint and convert it into a byte sequence. | |
| void | bi_set_mod (BI_CTX *ctx, bigint *bim, int mod_offset) |
| Pre-calculate some of the expensive steps in reduction. | |
| void | bi_free_mod (BI_CTX *ctx, int mod_offset) |
| Used when cleaning various bigints at the end of a session. | |
| static bigint * | regular_multiply (BI_CTX *ctx, bigint *bia, bigint *bib) |
| Perform a standard multiplication between two bigints. | |
| bigint * | bi_multiply (BI_CTX *ctx, bigint *bia, bigint *bib) |
| Perform a multiplication operation between two bigints. | |
| int | bi_compare (bigint *bia, bigint *bib) |
| Compare two bigints. | |
| static int | find_max_exp_index (bigint *biexp) |
| static int | exp_bit_is_one (bigint *biexp, int offset) |
| bigint * | bi_mod_power (BI_CTX *ctx, bigint *bi, bigint *biexp) |
| Perform a modular exponentiation. | |
| bigint * | bi_mod_power2 (BI_CTX *ctx, bigint *bi, bigint *bim, bigint *biexp) |
| Perform a modular exponentiation using a temporary modulus. | |
1.5.7.1