|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Secret_Share.Share
This class stores the individual shares of the secret. Primarily it stores the share number, which is also the x value used in the generating functions. The share value is equal to f(x). There is also a commitment value equal to G(x)
They are all individually verifiable via a public version. Each share stores a copy of the public version of all n of the shares. The shares can also be verified via Pedersen's "E Array".
Version .2 added a copy function. It is needed for share recovery.
As of version .3, the share class functions correctly for share recovery.
Version .4 added getSerialized().
Constructor Summary | |
Share(int x,
java.math.BigInteger s,
java.math.BigInteger t,
java.math.BigInteger p,
java.math.BigInteger q,
java.math.BigInteger g,
java.math.BigInteger h,
java.math.BigInteger[] y,
int k)
Creates a new instance of Share . |
Method Summary | |
void |
add(Share addedShare,
java.math.BigInteger[] commitmentValue)
This method provides a way to add a subshare to a current share. |
Share |
copy()
Creates an exact copy of the share. |
void |
corruptShare(int numBits)
This is not actually a normal function for the share, it creates random values for the secret share and the commitment share. |
java.math.BigInteger[] |
getAllPublicVersion()
Return an array of length n with all of the public versions for all n share values. |
java.math.BigInteger |
getG()
Return the g value used by the current share. |
java.math.BigInteger |
getH()
Return the h value used by the current share. |
int |
getK()
The minimum number of shares required to recover the original secret. |
int |
getN()
Returns the number of shares according to this share. |
java.math.BigInteger |
getP()
The p value used by the current share. |
java.math.BigInteger |
getPublicVersion()
Returns the public version of this share. |
java.math.BigInteger |
getQ()
The q value used by the current share. |
java.math.BigInteger |
getSecretCommitment()
The secret commitment, equal to g(x). |
java.math.BigInteger |
getSecretShare()
The secret share, equal to f(x). |
byte[] |
getSerialized()
This method serializes the current object and returns that object in the form of a byte array. |
int |
getShareNumber()
Returns the share number of the current share. |
boolean |
relativeBasis(Share comparedShare)
Compares this share with another one. |
boolean |
selfVerify()
This function compares the current value contained by the share against the publicShareVersion contained by the current share. |
boolean |
verify(java.math.BigInteger[] commitmentValue)
Verifies the current share based on the commitment values that are passed as arguments to the split function. |
boolean |
verifyShare(Share questionedShare)
This function verifies a questionable share against the public version stored locally. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Share(int x, java.math.BigInteger s, java.math.BigInteger t, java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger g, java.math.BigInteger h, java.math.BigInteger[] y, int k) throws ShareException
Creates a new instance of Share
.
The prime modulus p must have the property that p-1 is divisible by q. Usually p-1 = (2 or 4) * q. P is used for the verifibility scheme while q is used as the sharing modulus.
The group members g and h must be in the sub-group of p generated by q. This is verified by raising g (or h) to the qth power and verifying that it is congruent to 1 mod p. G and h are used in the verifiability scheme.
k
- The minimum number of required shares to recover the secret.x
- The share numbers
- This share's portion of the secrett
- The confirmation value for this secret sharep
- The prime modulus p.q
- The prime modulus qg
- The group member g.h
- The group member h.y
- The public version of all of the secret shares
ShareException
- Indication of an error during share creation. Specific information may be available in the exception's message.Method Detail |
public int getShareNumber()
Returns the share number of the current share. The share number is equal to the value used to generate the share in the original polynomial, eg share number 3 would mean that f(3) and g(3) were used to generate this share.
public java.math.BigInteger getSecretShare()
The secret share, equal to f(x).
BigInteger
.public java.math.BigInteger getSecretCommitment()
The secret commitment, equal to g(x).
BigInteger
.public java.math.BigInteger getPublicVersion()
Returns the public version of this share.
BigInteger
equal to gs*ht (mod p).public java.math.BigInteger[] getAllPublicVersion()
Return an array of length n with all of the public versions for all n share values.
BigInteger
array with all of the public versions.public java.math.BigInteger getG()
Return the g value used by the current share. This function does not return a reference to the value contained by share, just a copy of it.
public java.math.BigInteger getH()
Return the h value used by the current share. This function does not return a reference to the value contained by share, just a copy of it.
public java.math.BigInteger getP()
The p value used by the current share. This function does not return a reference to the value contained by share, just a copy of it.
public java.math.BigInteger getQ()
The q value used by the current share. This function does not return a reference to the value contained by share, just a copy of it.
public int getK()
The minimum number of shares required to recover the original secret. This is the same value that was entered when the secret was originally shared.
public int getN()
Returns the number of shares according to this share. It is based on the publicShareVersion.length
.
public byte[] getSerialized() throws java.io.IOException
This method serializes the current object and returns that object in the form of a byte array. This is often very useful for encryption.
byte
array containing the serialized version of this object.
java.io.IOException
- Indicates that an I/O error occured while trying to serialize this class.public void add(Share addedShare, java.math.BigInteger[] commitmentValue) throws ShareAddException, ShareUtilException, ShareException
This method provides a way to add a subshare to a current share. The two shares must have the same basis (global values of p, q, g and h) and share number. The addition adds the value of the addedShare.getSecretShare()
to the current secret share and addedShare.getSecretCommitment()
to the secret commitment share.
Since adding two shares would cause the current share to be invalid against the public versions held by this share and all of the other shares from the splitting. Therefore, the commitment values that were generated along with the sub share are added into the public version held by this share for all shares. It is therefore necessary to make sure that all shares add the same set of sub-shares so that they all end up with the same public versions in the end.
commitmentValue
- A BigInteger
array of length k
that was created by the split function used to create the subshare.addedShare
- The specific share to add to this share
ShareException
- Indicates invalid commitment value length in the addedShare
ShareUtilException
- Indicates an error occurred with the share utilities called by this method.
ShareAddException
- Indicates an error with the arguments to the add function.public boolean relativeBasis(Share comparedShare)
Compares this share with another one. This is necessary to make sure that two shares came from the same splitting or one of them was part of share recovery or share renewal.
The two shares have a relative basis if they have the same p, q, g and h values.
comparedShare
- The share you are comparing.
compareShare
have the same public values.public boolean selfVerify() throws ShareUtilException
This function compares the current value contained by the share against the publicShareVersion
contained by the current share.
ShareUtilException
- Indicates an error in calculating the public version.public boolean verify(java.math.BigInteger[] commitmentValue) throws ShareUtilException, ShareException
Verifies the current share based on the commitment values that are passed as arguments to the split function. The key use of this function is to verify that the "dealer" of the shares sent shares generated by the functions f and g.
The commitment values should be the E array used by Pedersen in his VSS protocol. Essentially, value i in the array should be: g^a[i]*h^b[i] mod p where a[*] and b[*] are the coefficients of f(x) and g(x).
commitmentValue
- Pedersen's E array
ShareUtilException
- Indicates an error in verifying the share.
ShareException
- Indicates that the commitmentValue
array is the wrong lengthpublic boolean verifyShare(Share questionedShare) throws ShareException, ShareUtilException
This function verifies a questionable share against the public version stored locally. This function is primarily used by ShareUtil.recover
.
questionedShare
- The share you are trying to verify against the public version held within this share.
ShareException
- Indication of an error with the argument.
ShareUtilException
- Indication of an error attempting to calculate the public version of the questionedShare
.public Share copy() throws ShareException
Creates an exact copy of the share.
Share
.
ShareException
- Indication of an error during share creation. Specific information may be available in the exception's message.public void corruptShare(int numBits)
This is not actually a normal function for the share, it creates random values for the secret share and the commitment share.
numBits
- The number of bits for the secret share and the secret commitment.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |