|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--demo.Dealer
The dealer class runs the sharing operations loosely as the first client.
Constructor Summary | |
Dealer()
Creates a new instance of Dealer |
Method Summary | |
protected java.math.BigInteger[] |
generateValues(int numBits)
Calls ShareUtil.generateValues() . |
protected java.lang.String |
getRound()
The current round number. |
protected java.lang.String |
getSecret()
Get the secret as a string. |
protected void |
init(int n,
int k,
java.math.BigInteger secret,
java.math.BigInteger p,
java.math.BigInteger q,
java.math.BigInteger g,
java.math.BigInteger h,
int numBits)
Initializes the dealer and starts the secret sharing. |
protected java.math.BigInteger |
recoverSecret()
Takes the appropriate steps to recover the secret. |
protected java.lang.String |
recoverShares()
Attempts to recover shares found to be bad by validateShares() . |
protected void |
renewShares()
Attempts to renew the shares of all of the clients. |
protected int |
validateShares()
Used to validate the clients. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Dealer()
Method Detail |
protected void init(int n, int k, java.math.BigInteger secret, java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger g, java.math.BigInteger h, int numBits) throws DealerException
Initializes the dealer and starts the secret sharing.
n
- The number of clients.k
- The threshold number.secret
- The secret to share.p
- The prime modulus p.q
- The prime modulus q.g
- The prime modulus g.h
- The prime modulus h.numBits
- The number of bits for all randomly generated values.
DealerException
- An indication of error during initialization.protected java.lang.String getSecret()
Get the secret as a string.
protected java.lang.String getRound()
The current round number.
protected java.math.BigInteger[] generateValues(int numBits)
Calls ShareUtil.generateValues()
.
numBits
- The number of bits to use in the random values.
BigInteger
array.protected java.lang.String recoverShares() throws DealerException
Attempts to recover shares found to be bad by validateShares()
.
DealerException
- An indication of an error during recovery.protected int validateShares()
Used to validate the clients. It creates a list of bad shares for recoverShares()
.
protected java.math.BigInteger recoverSecret() throws DealerException
Takes the appropriate steps to recover the secret.
BigInteger
.
DealerException
- An indication of error during the attempt to recover the secret.protected void renewShares() throws DealerException
Attempts to renew the shares of all of the clients.
DealerException
- An indication of an error while renewing shares.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |