Appendix B. Directory of C++ Functions

Input/Output, Conversion, Comparison: Member Functions

LINT (void);

Constructor 1:

an uninitialized LINT object is generated

LINT (const char* str,
     int base);

Constructor 2:

LINT is constructed from a string of digits to base base

LINT (const UCHAR* byte,
      int len);

Constructor 3:

LINT is constructed from a byte vector with digits to base 28 according to IEEE P1363, significance of bits grows from left to right

LINT (const char* str);

Constructor 4:

LINT is constructed from an ASCII string with C-Syntax

LINT (const LINT&);

Constructor 5:

LINT is constructed from LINT (copy constructor)

LINT (signed int);

Constructor 6:

LINT is constructed from an integer of type int

LINT (signed long);

Constructor 7:

LINT is constructed from an integer of type long

LINT (unsigned char);

Constructor 8:

LINT is constructed from an integer of type unsigned char

LINT (USHORT);

Constructor 9:

LINT is constructed from an integer of type unsigned short

LINT (unsigned int);

Constructor 10:

LINT is constructed from an integer of type unsigned int

LINT (unsigned long);

Constructor 11:

LINT is constructed from an integer of type unsigned long

LINT (const CLINT);

Constructor 12:

LINT is constructed from an integer of type CLINT

inline char*
binstr (void) const;

representation of a LINT integer as a binary number

inline char*
decstr (void) const;

representation of a LINT integer as decimal number

inline void
disp (char* str);

display of a LINT integer with previous output of str

Static long
flags (ostream& s);

read static LINT status variable associated with ostream s

static long
flags (void);

read static LINT status variable associated with ostream cout

LINT&
fswap (LINT& b);

exchange of implicit argument a with argument b

inline char*
hexstr (void) const;

representation of a LINT integer as a hexadecimal number

UCHAR*
lint2byte (int* len) const;

transformation of a LINT integer into a byte vector, output of length in len, according to IEEE P1363, significance of bytes increasing from left to right

char*
lint2str (USHORT base,
     const int showbase = 0) const;

representation of a LINT integer as character string to base base, prefix 0x, or 0b if showbase > 0

inline char*
octstr (void) const;

representation of a LINT integer as an octal number

const LINT&
operator = (const LINT& b);

assignment ab

Void
purge (void);

clear implicit argument a by overwriting

static long
restoref (long int flags);

reset LINT status variable referring to ostream cout to the value in flags

static long
restoref (ostream& s,
    long int flags);

set the LINT status variable referring to ostream s to the value in flags

static long
setf (long int flags);

set status bits in flags in LINT status variable referring to ostream cout

static long
setf (ostream& s, long int flags);

set status bits of value flags in LINT status variable referring to ostream s

static long
unsetf (long int flags);

unset status bits of flags in LINT status variable referring to ostream cout

static long
unsetf (ostream& s, long int flags);

unset status bits in flags in LINT status variable referring to ostream s

Input/Output, Conversion, Comparison: Friend Functions

void
fswap (LINT& a, LINT& b);

exchange of a and b

UCHAR*
lint2byte (const LINT& a,
     int* len);

transformation of a into a byte vector, output of length in len, according to IEEE P1363, significance of bytes increasing from left to right

char*
lint2str (const LINT& a,
     USHORT base,
     int showbase);

representation of a as character string to base base, with prefix 0x, or 0b if showbase > 0

ostream&
LintBin (ostream& s);

ostream manipulator for binary representation of LINT integers

ostream&
LintDec (ostream& s);

ostream manipulator for decimal representation of LINT integers

ostream&
LintHex (ostream& s);

ostream manipulator for hex representation of LINT integers

ostream&
LintLwr (ostream& s);

ostream manipulator for use of lowercase letters in hex representation of LINT integers

ostream&
LintNobase (ostream& s);

ostream manipulator for omission of a prefix 0x or 0b in hex or binary representation of LINT integers

ostream&
LintNolength (ostream& s);

manipulator for the omission of binary length in the output LINT integers

ostream&
LintOct (ostream& s);

ostream manipulator for the octal representation of LINT integers

ostream&
LintShowbase (ostream& s);

ostream manipulator for the display of a prefix 0x (resp. 0b) in hex (resp. binary) representation of LINT integers

ostream&
LintShowlength (ostream& s);

ostream manipulator for display of the binary length in the output of LINT integers

ostream&
LintUpr (ostream& s);

ostream manipulator for use of uppercase letters in the hex representation of LINT integers

const int
operator != (const LINT& a,
    const LINT& b);

test a != b

const int
operator > (const LINT& a,
    const LINT& b);

comparison a < b

fstream&
operator << (fstream& s,
     const LINT& ln);

overloaded insert operator for writing LINT integers to files, output stream of type fstream

ofstream&
operator << (ofstream& s,
     const LINT& ln);

overloaded insert operator for writing LINT integers to files, output stream of type ofstream

ostream&
operator << (ostream& s,
     const LINT& ln);

overloaded insert operator for output of LINT integers, output stream of type ostream

const int
operator <= (const LINT& a,
     const LINT& b);

comparison a <= b

const int
operator == (const LINT& a,
     const LINT& b);

test a == b

const int
operator > (const LINT& a,
     const LINT& b);

comparison a > b

const int
operator >= (const LINT& a,
     const LINT& b);

comparison a >= b

fstream&
operator >> (fstream& s,
     LINT& ln);

overloaded extract operator for reading LINT integers from files, input/output stream of type fstream

ifstream&
operator >> (ifstream& s,
    LINT& ln);

overloaded extract operator for reading LINT integers from files, input stream of type ifstream

void
purge (LINT& a);

clear by overwriting

LINT_omanip<int>
ResetLintFlags (int flag);

manipulator to unset status bits of value flag in the LINT status variable

LINT_omanip<int>
SetLintFlags (int flag);

manipulator for setting status bits of the value flag in the LINT status variable

Basic Operations: Member Functions

const LINT&
add (const LINT& b);

addition c = a.add (b);

const LINT&
divr (const LINT& d, LINT& r);

division with remainder quotient = dividend.div (divisor, remainder);

const LINT&
mul (const LINT& b);

multiplication c = a.mul (b);

const LINT
operator -- (int);

decrement operator (postfix) a--;

const LINT& operator --
(void);

decrement operator (prefix) --a;

const LINT&
operator %= (const LINT& b);

remainder and assignment a %= b;

const LINT&
operator *= (const LINT& b);

multiplication and assignment a *= b;

const LINT&
operator /= (const LINT& b);

division and assignment a /= b;

const LINT
operator ++ (int);

increment operator (postfix) a++;

const LINT&
operator ++ (void);

increment operator (prefix) ++a;

const LINT&
operator += (const LINT& b);

addition and assignment a += b;

const LINT&
operator -= (const LINT& b);

subtraction and assignment a -= b;

const LINT&
sqr (void);

squaring c = a.sqr (b);

const LINT&
sub (const LINT& b);

subtraction c = a.sub (b);

Basic Operations: Friend Functions

const LINT
add (const LINT& a, const LINT& b);

addition c = add (a, b);

const LINT
divr (const LINT& a,
     const LINT& b, LINT& r);

division with remainder quotient = div (dividend, divisor, remainder);

const LINT
mul (const LINT& a, const LINT& b);

multiplication c = mul (a, b);

const LINT
operator - (const LINT& a,
     const LINT& b);

subtraction c = a - b;

const LINT
operator % (const LINT& a,
     const LINT& b);

remainder c = a % b;

const LINT
operator * (const LINT& a,
     const LINT& b);

multiplication c = a * b;

const LINT
operator / (const LINT& a,
     const LINT& b);

division c = a / b;

const LINT
operator + (const LINT& a,
     const LINT& b);

addition c = a + b;

const LINT
sqr (const LINT& a);

squaring b = sqr (a);

const LINT
sub (const LINT& a, const LINT& b);

subtraction c = sub (a, b);

Modular Arithmetic: Member Functions

const LINT&
madd (const LINT& b, const LINT& m);

modular addition, c = a.madd (b, m);

int
mequ (LINT& b, const LINT& m)
const;

comparison of a and b modulo m if (a.mequ (b, m)) ...

const LINT&
mexp (const LINT& e, const LINT& m);

modular exponentiation with Montgomery reduction for odd modulus m, c = a.mexp (e, m);

const LINT&
mexp (USHORT u, const LINT& m);

modular exponentiation with USHORT exponent, Montgomery reduction for odd modulus m, c = a.mexp (u, m);

const LINT&
mexp2 (USHORT u, const LINT& m);

modular exponentiation with power of two exponent 2u, c = a.mexp2 (u, m);

const LINT&
mexp5m (const LINT& e,
     const LINT& m);

modular exponentiation with Montgomery reduction for odd modulus m, c = a.mexpSm (e, m);

const LINT&
mexpkm (const LINT& e,
     const LINT& m);

modular exponentiation with Montgomery reduction for odd modulus m, c = a.mexpkm (e, m);

const LINT&
mmul (const LINT& b,
     const LINT& m);

modular multiplication, c = a.mmul (b, m);

const LINT&
mod (const LINT& m);

remainder b = a.mod (m);

const LINT&
mod2 (USHORT u);

remainder modulo power of two 2u, b = a.mod (u);

const LINT&
msqr (const LINT& m);

modular squaring, c = a.msqr (m);

const LINT&
msub (const LINT& b, const LINT& m);

modular subtraction, c = a.msub(b, m);

Modular Arithmetic: Friend Functions

LINT
madd (const LINT& a,
     const LINT& b,
     const LINT& m);

modular addition, c = madd (a, b, m);

Int
mequ (const LINT& a,
     const LINT& b,
     const LINT& m);

comparison of a and b modulo m if (mequ (a, b, m)) ...

LINT
mexp (const LINT& a,
     const LINT& e,
     const LINT& m);

modular exponentiation with Montgomery reduction for odd modulus m, c = mexp (a, e, m);

LINT
mexp (const LINT& a,
     USHORT u,
     const LINT& m);

modular exponentiation with USHORT exponent, Montgomery reduction for odd modulus m, c = mexp (a, u, m);

LINT
mexp (USHORT u,
     const LINT& e,
     const LINT& m);

modular exponentiation with USHORT base, Montgomery reduction for odd modulus m, c = mexp (u, e, m);

LINT
mexp2 (const LINT& a,
      USHORT u,
      const LINT& m);

modular exponentiation with power of two exponent 2u, c = mexp2 (a, u, m);

LINT
mexp5m (const LINT& a,
     const LINT& e,
     const LINT& m);

modular exponentiation with Montgomery reduction, only for odd modulus m, c = mexp5m (a, e, m);

LINT
mexpkm (const LINT& a,
     const LINT& b,
     const LINT& m);

modular exponentiation with Montgomery reduction, only for odd modulus m, c = mexpkm (a, e, m);

LINT
mmul (const LINT& a,
     const LINT& b,
     const LINT& m);

modular multiplication, c = mmul (a, b, m);

LINT
mod (const LINT& a,
     const LINT& m);

remainder b = mod (a, m);

LINT
mod2 (const LINT& a,
     USHORT u);

remainder modulo power of two 2u, b = mod (a, u);

LINT
msqr (const LINT& a,
     const LINT& m);

modular squaring, c = msqr (a, m);

LINT
msub (const LINT& a,
     const LINT& b,
     const LINT& m);

modular subtraction, c = msub(a, b, m);

Bitwise Operations: Member Functions

const LINT&
clearbit (const unsigned int i);

clear a bit at position i, a.clearbit (i);

const LINT&
operator &= (const LINT& b);

AND and assignment, a &= b;

const LINT&
operator ^= (const LINT& b);

XOR and assignment, a ^= b;

const LINT&
operator |= (const LINT& b);

OR and assignment, a |= b;

const LINT&
operator <<= (int i);

left shift and assignment, a <<= i;

const LINT&
operator >>= (int i);

right shift and assignment, a >>= i;

const LINT&
setbit (unsigned int i);

set a bit at position i, a. setbit (i);

const LINT&
shift (int i);

shift (left and right) by i bit positions, a.shift (i);

const int
testbit (unsigned int i) const;

test a bit at position i, a.testbit (i);

Bitwise Operations: Friend Functions

const LINT
operator & (const LINT& a,
     const LINT& b);

AND, c = a & b;

const LINT
operator ^ (const LINT& a,
     const LINT& b);

XOR, c = a ^ b;

const LINT
operator | (const LINT& a,
     const LINT& b);

OR, c = a | b;

const LINT
operator << (const LINT& a,
     int i);

left shift, b = a << i;

const LINT
operator >> (const LINT& a,
     int i);

right shift, b = a >> i;

const LINT
shift (const LINT& a, int i);

shift (left and right) by i bit positions, b = shift (a, i);

Number-Theoretic Member Functions

LINT
chinrem (const LINT& m,
     const LINT& b,
     const LINT& n) const;

return a solution x of the system of simultaneous congruences xa mod m and xb mod n, if a solution exists

LINT
gcd (const LINT& b);

return gcd of a and b

LINT
introot (void) const;

return integer part of the bth root of a

LINT
introot (const USHORT b)
const;

return integer part of the bth root of a

LINT
inv (const LINT& b) const;

return the multiplicative inverse of a mod b

int
iseven (void) const;

test a for divisibility by 2: true if a even

int
isodd (void) const;

test a for divisibility by 2: true if a odd

int
isprime (int nsp = 302,
     int rnds = 0) const;

test a for primality

LINT
issqr (void) const;

test a for being square

int
jacobi (const LINT& b) const;

return the Jacobi symbol (

Number-Theoretic Member Functions
LINT
lcm (const LINT& b) const;

return the least common multiple of a and b

unsigned int
ld (void) const;

return

Number-Theoretic Member Functions
LINT
root (void) const;

return the integer part of the square root of a

LINT
root (const LINT& p) const;

return the square root of a modulo an odd prime p

LINT
root (const LINT& p,
     const LINT& q) const;

return the square root of a modulo p*q, where p and q are odd primes

int
twofact (LINT& odd) const;

return the even part of a, odd contains the odd part of a

LINT
xgcd (const LINT& b,
     LINT& u, int& sign_u,
     LINT& v, int& sign_v)
     const;

extended Euclidean algorithm with return of gcd of a and b, u and v contain the absolute values of the factors of the linear combination g = sign_u*u*a + sign_v*v*b

Number-Theoretic Friend Functions

LINT
chinrem (unsigned noofeq,
     LINT** coeff);

return a solution of a system of simultaneous linear congruences. In coeff is passed a vector of pointers to LINT objects as coefficients a1, m1, a2, m2, a3, m3, ... of the congruence system with noofeq equations xai mod mi

LINT
extendprime (const LINT& pmin,
const LINT& pmax,
     const LINT& a,
     const LINT& q,
     const LINT& f);

return a prime p with pmin ≤ p ≤ pmax, with p ≡ a mod q and gcd(p − 1, f) = 1, f odd

LINT
extendprime (USHORT l,
     const LINT& a,
     const LINT& q,
     const LINT& f);

return a prime p of length l bits, i.e., 2l−1 ≤ p < 21, with pa mod q and gcd(p − 1, f) = 1, f odd

LINT
findprime (const LINT& pmin,
     const LINT& pmax,
     const LINT& f);

return a prime p with pmin ≤ p ≤ pmax and gcd(p − 1, f) = 1, f odd

LINT
findprime (USHORT l);

return a prime p of length l bits, i.e., 2l−1 ≤ p < 2l

LINT
findprime (USHORT l,
     const LINT& f);

return a prime p of length l bits, i.e., 2l−1 ≤ p < 2l and gcd(p − 1, f) = 1, f odd

LINT
gcd (const LINT& a,
     const LINT& b);

return gcd of a and b

LINT
introot (const LINT& a);

return the integer part of a

LINT
introot (const LINT& a,
     const USHORT b);

return the integer part of the bth root of a

LINT
inv (const LINT& a,
     const LINT& b);

return the multiplicative inverse of a mod b

int
iseven (const LINT& a);

test a for divisibility by 2: true if a even

int
isodd (const LINT& a);

test a for divisibility by 2: true if a odd

int
isprime (const LINT& p
     int nsp = 302, int rnds = 0);

test p for primality

LINT
issqr (const LINT& a);

test a for being a square

Int
jacobi (const LINT& a,
     const LINT& b);

return the Jacobi symbol (

Number-Theoretic Friend Functions
LINT
lcm (const LINT& a,
     const LINT& b);

return the least common multiple of a and b

unsigned int
ld (const LINT& a);

return

Number-Theoretic Friend Functions
LINT
nextprime (const LINT& a,
     const LINT& f);

return the smallest prime p above a with gcd(p − 1, f) = 1, f odd

LINT
primroot (unsigned noofprimes,
     LINT** primes);

return a primitive root modulo p. In noofprimes is passed the number of distinct prime factors of the group order p − 1, in primes a vector of pointers to LINT objects, beginning with p− 1, then come the prime divisors p1, ..., pk of the group order p − 1 = p1e1 ...pkek with k = noofprimes

LINT
root (const LINT& a);

return the integer part of the square root of a

LINT
root (const LINT& a,
     const LINT& p);

return the square root of a modulo an odd prime p

LINT
root (const LINT& a,
     const LINT& p,
     const LINT& q);

return the square root of a modulo p*q for p and q odd primes

LINT
strongprime (const LINT& pmin,
     const LINT& pmax,
     const LINT& f);

return a strong prime p with pmin ≤ p ≤ pmax, gcd(p − 1, f) = 1, f odd, default lengths lr, lt, ls of prime divisors r of p − 1, t of r − 1, s of p + 1: lt

Number-Theoretic Friend Functions
LINT
strongprime (const LINT& pmin,
     const LINT& pmax,
     USHORT lt,
     USHORT lr,
     USHORT ls,
     const LINT& f);

return a strong prime p with pmin ≤ p ≤ pmax, gcd(p − 1, f) = 1, f odd, lengths lr, lt, ls of prime divisors r of p − 1, t of r − 1, s of p + 1

LINT
strongprime (USHORT l);

return a strong prime p of length l bits, i.e., 2l−1 p < 21

LINT
strongprime (USHORT l,
     const LINT& f);

return a strong prime p of length l bits, i.e., 2l−1 p < 21, with gcd(p − 1, f) = 1, f odd

LINT
strongprime (USHORT l,
     USHORT lt,
     USHORT lr,
     USHORT ls,
     LINT& f);

return a strong prime p of length l bits, i.e., 2l−1 p < 21, with gcd(p − 1, f) = 1, f odd lt

Number-Theoretic Friend Functions
int
twofact (const LINT& even,
     LINT& odd);

return the even part of a, odd contains the odd part of a

LINT
xgcd (const LINT& a,
     const LINT& b,
     LINT& u, int& sign_u,
     LINT& v, int& sign_v);

extended Euclidean algorithm with return of gcd of a and b, u and v contain the absolute values of the factors of the linear combination g = sign_u*u*a + sign_v*v*b

Generation of Pseudorandom Numbers

LINT
randBBS (const LINT& rmin,
     const LINT& rmax);

return a LINT random number r with rmin ≤ r ≤ rmax

LINT
randBBS (int l);

return a LINT random number of length l bits

LINT
randl (const LINT& rmin,
     const LINT& rmax);

return a LINT random number r with rmin ≤ r ≤ rmax

LINT
randl (const int l);

return a LINT random number of length l bits

int
seedBBS (const LINT& seed);

initialization of BBS random number generator with initial value seed

void
seedl (const LINT& seed);

initialization of the 64-bit random number generator based on linear congruences with initial value seed

Miscellaneous Functions

LINT_ERRORS
Get_Warning_Status (void);

query error status of a LINT object

static void
Set_LINT_Error_Handler
     (void (*)(LINT_ERRORS err,
     const char*, int, int));

activation of a user routine for handling errors with LINT operations. The registered routine replaces the LINT standard error handler panic(); deactivation of registration of user routine and simultaneous reactivation of use routine panic() managed by the call Set_LINT_Error_Handler (NULL);

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.113.55