|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ostore.security.SafeBigInt
BigInteger is broken in two respects for use with our cryptographic code; this class makes it hard to run into such problems.
Constructor Summary | |
---|---|
SafeBigInt(BigInteger bi)
|
|
SafeBigInt(byte[] val)
Don't construct negative numbers. |
|
SafeBigInt(InputBuffer buffer)
|
|
SafeBigInt(int signum,
byte[] magnitude)
|
|
SafeBigInt(int bitLength,
int certainty,
Random rnd)
|
|
SafeBigInt(int numBits,
Random rnd)
|
|
SafeBigInt(String val)
|
|
SafeBigInt(String val,
int radix)
|
Method Summary | |
---|---|
SafeBigInt |
add(SafeBigInt val)
|
int |
bitLength()
|
int |
compareTo(SafeBigInt val)
|
SafeBigInt |
divide(SafeBigInt val)
|
boolean |
equals(Object other)
|
SafeBigInt |
gcd(SafeBigInt val)
|
int |
intValue()
|
boolean |
isProbablePrime(int certainty)
|
SafeBigInt |
mod(SafeBigInt m)
|
SafeBigInt |
modInverse(SafeBigInt m)
|
SafeBigInt |
modPow(SafeBigInt exponent,
SafeBigInt m)
|
SafeBigInt |
multiply(SafeBigInt val)
|
void |
serialize(OutputBuffer buffer)
Add the object to the buffer . |
SafeBigInt |
shiftLeft(int n)
|
BigInteger |
toBigInteger()
|
byte[] |
toByteArray()
Strips leading zeroes off super.toByteArray () . |
String |
toString()
|
String |
toString(int radix)
|
static SafeBigInt |
valueOf(long val)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SafeBigInt(byte[] val)
public SafeBigInt(int signum, byte[] magnitude)
public SafeBigInt(int bitLength, int certainty, Random rnd)
public SafeBigInt(int numBits, Random rnd)
public SafeBigInt(String val)
public SafeBigInt(String val, int radix)
public SafeBigInt(BigInteger bi)
public SafeBigInt(InputBuffer buffer)
Method Detail |
public void serialize(OutputBuffer buffer)
QuickSerializable
buffer
.
serialize
in interface QuickSerializable
buffer
- the output buffer to add the object topublic SafeBigInt add(SafeBigInt val)
public SafeBigInt multiply(SafeBigInt val)
public SafeBigInt modInverse(SafeBigInt m)
public boolean isProbablePrime(int certainty)
public int compareTo(SafeBigInt val)
public int bitLength()
public boolean equals(Object other)
equals
in class Object
public BigInteger toBigInteger()
public SafeBigInt mod(SafeBigInt m)
public SafeBigInt gcd(SafeBigInt val)
public SafeBigInt divide(SafeBigInt val)
public SafeBigInt shiftLeft(int n)
public SafeBigInt modPow(SafeBigInt exponent, SafeBigInt m)
public int intValue()
public String toString()
toString
in class Object
public String toString(int radix)
public byte[] toByteArray()
super.toByteArray ()
.
public static SafeBigInt valueOf(long val)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |