bigint.h File Reference

#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_CTXbi_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.
bigintbi_copy (bigint *bi)
 Increment the number of references to this object.
bigintbi_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.
bigintbi_import (BI_CTX *ctx, const uint8_t *data, int len)
 Allow a binary sequence to be imported as a bigint.
bigintint_to_bi (BI_CTX *ctx, comp i)
 Convert an (unsigned) integer into a bigint.
bigintbi_add (BI_CTX *ctx, bigint *bia, bigint *bib)
 Perform an addition operation between two bigints.
bigintbi_subtract (BI_CTX *ctx, bigint *bia, bigint *bib, int *is_negative)
 Perform a subtraction operation between two bigints.
bigintbi_divide (BI_CTX *ctx, bigint *bia, bigint *bim, int is_mod)
 Does both division and modulo calculations.
bigintbi_multiply (BI_CTX *ctx, bigint *bia, bigint *bib)
 Perform a multiplication operation between two bigints.
bigintbi_mod_power (BI_CTX *ctx, bigint *bi, bigint *biexp)
 Perform a modular exponentiation.
bigintbi_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 Documentation

#define check (  ) 

#define bi_mod ( A,
 )     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,
 )     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,
 )     bi_multiply(A, bi_copy(B), B)

Definition at line 88 of file bigint.h.

Referenced by bi_mod_power().


Generated on Tue Apr 6 20:01:15 2010 for gPXE by  doxygen 1.5.7.1