|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcryptix.math.BigNum
cryptix.math.BigInteger
A class implementing arbitrary-length integers. java.math.BigInteger is preferred for new code.
Copyright © 1995-1997
Systemics Ltd on behalf of the
Cryptix Development Team.
All rights reserved.
$Revision: 1.5 $
Field Summary | |
static BigInteger |
one
|
static BigInteger |
zero
|
Fields inherited from class cryptix.math.BigNum |
BITS, LBITS, LMASK, LRADIX, MASK, RADIX |
Constructor Summary | |
BigInteger()
|
|
BigInteger(BigInteger from)
|
|
BigInteger(byte[] buffer)
|
|
BigInteger(int from)
|
|
BigInteger(java.lang.String hexString)
|
Method Summary | |
BigInteger |
add(BigInteger a,
BigInteger b)
|
BigInteger |
add(int a)
|
BigInteger |
assign(BigInteger n)
|
BigInteger |
assign(int n)
|
int |
bitLength()
|
java.lang.Object |
clone()
|
int |
cmp(BigInteger a)
|
void |
copy(java.lang.Object src)
|
BigInteger |
dec()
|
BigInteger |
div(BigInteger a,
BigInteger b)
|
boolean |
equals(java.lang.Object o)
Tests whether another object is equal to this one. |
protected void |
finalize()
|
void |
fromByteArray(byte[] buf)
|
static BigInteger |
fromJavaMathBigInteger(java.math.BigInteger from)
Convert from a java.math.BigInteger to a cryptix.math.BigInteger. |
void |
fromString(java.lang.String inHex)
|
BigInteger |
gcd(BigNum a,
BigNum b)
|
BigInteger |
inc()
|
BigInteger |
inverseModN(BigInteger a,
BigInteger n)
|
static void |
main(java.lang.String[] args)
|
BigInteger |
mod(BigInteger a,
BigInteger b)
|
BigInteger |
modExp(BigInteger power,
BigInteger modulo)
|
BigInteger |
mul(BigInteger a,
BigInteger b)
|
protected static byte[] |
newBuffer(int bitLen)
An internal function to create a buffer big enough in which to store a number. |
static void |
self_test(java.io.PrintWriter out)
|
BigInteger |
shiftLeft(int n)
|
BigInteger |
shiftRight(int n)
|
BigInteger |
sub(BigInteger a,
BigInteger b)
|
byte[] |
toByteArray()
Convert a number into a byte array. |
java.math.BigInteger |
toJavaMathBigInteger()
Convert this cryptix.math.BigInteger to a java.math.BigInteger. |
java.lang.String |
toString()
|
static BigInteger |
zero()
|
Methods inherited from class cryptix.math.BigNum |
add_unsigned, add_unsigned, add, add, assign, bignum_hashCode, bit, bitLength, byteLength, check_state, cmp, copy, dec, display, display, div, div, euclid, even, extended_euclid, fromBinary, gcd, grow, inc, intoBinary, inverseModN, isOne, isZero, mod, modExp, modMul, modMulRecip, mul, odd, one, recip, shiftLeft, shiftLeft, shiftLeftOnce, shiftRight, shiftRight, shiftRightOnce, sub_unsigned, sub_unsigned, sub, sub, ucmp, zero |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final BigInteger zero
public static final BigInteger one
Constructor Detail |
public BigInteger()
public BigInteger(int from)
public BigInteger(BigInteger from)
public BigInteger(java.lang.String hexString)
public BigInteger(byte[] buffer)
Method Detail |
public int bitLength()
public java.lang.Object clone()
clone
in class BigNum
public void copy(java.lang.Object src)
copy
in class BigNum
public BigInteger assign(BigInteger n)
public BigInteger assign(int n)
public void fromString(java.lang.String inHex)
public java.lang.String toString()
protected void finalize()
finalize
in class BigNum
public BigInteger modExp(BigInteger power, BigInteger modulo)
public BigInteger inverseModN(BigInteger a, BigInteger n)
public BigInteger mod(BigInteger a, BigInteger b)
public BigInteger mul(BigInteger a, BigInteger b)
public BigInteger div(BigInteger a, BigInteger b)
public BigInteger add(BigInteger a, BigInteger b)
public BigInteger add(int a)
public BigInteger sub(BigInteger a, BigInteger b)
public BigInteger gcd(BigNum a, BigNum b)
public int cmp(BigInteger a)
public boolean equals(java.lang.Object o)
Note: since BigIntegers are mutable, it was a mistake to override
equals. Also, equals
and hashCode
should
always be overridden together.
public BigInteger inc()
public BigInteger dec()
public BigInteger shiftLeft(int n)
public BigInteger shiftRight(int n)
public static BigInteger zero()
protected static byte[] newBuffer(int bitLen)
bitLen
- The number of bits in the number.
public byte[] toByteArray()
public void fromByteArray(byte[] buf)
public java.math.BigInteger toJavaMathBigInteger()
public static BigInteger fromJavaMathBigInteger(java.math.BigInteger from)
from
- the java.math.BigInteger
public static void main(java.lang.String[] args)
public static void self_test(java.io.PrintWriter out) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |