#include "os_port.h"#include "bigint_impl.h"Go to the source code of this file.
Defines | |
| #define | check(A) |
| disappears in normal production mode | |
| #define | bi_mod(A, B) bi_divide(A, B, ctx->bi_mod[ctx->mod_offset], 1) |
| Find the residue of B. | |
| #define | bi_residue(A, B) bi_mod(A, B) |
| bi_residue() is technically the same as bi_mod(), but it uses the appropriate reduction technique (which is bi_mod() when doing classical reduction). | |
| #define | bi_square(A, B) bi_multiply(A, bi_copy(B), B) |
Functions | |
| BI_CTX * | bi_initialize (void) |
| Start a new bigint context. | |
| void | bi_terminate (BI_CTX *ctx) |
| Close the bigint context and free any resources. | |
| 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 * | bi_copy (bigint *bi) |
| Increment the number of references to this object. | |
| bigint * | bi_clone (BI_CTX *ctx, const bigint *bi) |
| Do a full copy of the bigint object. | |
| void | bi_export (BI_CTX *ctx, bigint *bi, uint8_t *data, int size) |
| Take a bigint and convert it into a byte sequence. | |
| bigint * | bi_import (BI_CTX *ctx, const uint8_t *data, int len) |
| Allow a binary sequence to be imported as a bigint. | |
| bigint * | int_to_bi (BI_CTX *ctx, comp i) |
| Convert an (unsigned) integer into a bigint. | |
| 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 *bia, bigint *bim, int is_mod) |
| Does both division and modulo calculations. | |
| bigint * | bi_multiply (BI_CTX *ctx, bigint *bia, bigint *bib) |
| Perform a multiplication operation between two bigints. | |
| 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. | |
| int | bi_compare (bigint *bia, bigint *bib) |
| Compare two bigints. | |
| 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. | |
| #define check | ( | A | ) |
disappears in normal production mode
Definition at line 34 of file bigint.h.
Referenced by bi_add(), bi_clone(), bi_compare(), bi_copy(), bi_depermanent(), bi_divide(), bi_export(), bi_free(), bi_int_divide(), bi_int_multiply(), bi_mod_power(), bi_multiply(), bi_permanent(), bi_subtract(), exp_bit_is_one(), find_max_exp_index(), linda_send_buf_in_use(), regular_multiply(), and trim().
| #define bi_mod | ( | A, | |||
| B | ) | bi_divide(A, B, ctx->bi_mod[ctx->mod_offset], 1) |
Find the residue of B.
bi_set_mod() must be called before hand.
Definition at line 68 of file bigint.h.
Referenced by bi_set_mod().
| #define bi_residue | ( | A, | |||
| B | ) | bi_mod(A, B) |
bi_residue() is technically the same as bi_mod(), but it uses the appropriate reduction technique (which is bi_mod() when doing classical reduction).
Definition at line 82 of file bigint.h.
Referenced by bi_mod_power().
| #define bi_square | ( | A, | |||
| B | ) | bi_multiply(A, bi_copy(B), B) |
1.5.7.1