public class ThresholdTreeSecretSharing extends java.lang.Object implements LinearSecretSharing<Policy>, org.cryptimeleon.math.serialization.StandaloneRepresentable
ThresholdTreeSecretSharing is a LinearSecretSharing which shares a secret not only among a single
ThresholdPolicy's children, but among a whole tree of ThresholdPolicys.
That way a secret can be shared among complex expression represented by a hierarchy of ThresholdPolicy.
It is assumed that each inner node of the hierarchy is a ThresholdPolicy and each leaf implements
both Policy and PolicyFact.
| Constructor and Description |
|---|
ThresholdTreeSecretSharing(org.cryptimeleon.math.serialization.Representation repr) |
ThresholdTreeSecretSharing(ThresholdPolicy policy,
org.cryptimeleon.math.structures.rings.zn.Zp field,
SecretSharingSchemeProvider lsssInstanceProvider)
Create a new
ThresholdTreeSecretSharing instance. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkShareConsistency(org.cryptimeleon.math.structures.rings.zn.Zp.ZpElement secret,
java.util.Map<java.lang.Integer,org.cryptimeleon.math.structures.rings.zn.Zp.ZpElement> shares)
Outputs true if the given (full) set of shares is consistent with the given secret, meaning that all qualified
subsets of the shares will recreate the given secret.
|
java.util.Map<java.lang.Integer,org.cryptimeleon.math.structures.rings.zn.Zp.ZpElement> |
completeShares(org.cryptimeleon.math.structures.rings.zn.Zp.ZpElement secret,
java.util.Map<java.lang.Integer,org.cryptimeleon.math.structures.rings.zn.Zp.ZpElement> partialShares)
Takes a partial set of shares and completes it to a full set of shares for the given secret.
|
boolean |
equals(java.lang.Object o) |
org.cryptimeleon.math.serialization.Representation |
getRepresentation() |
org.cryptimeleon.math.structures.rings.zn.Zp |
getSharedRing()
Returns the ring over which the secret is being shared.
|
java.util.Map<java.lang.Integer,Policy> |
getShareReceiverMap()
Returns the map that assigns each index i of a share \(s_i\) to its share receiver.
|
java.util.Map<java.lang.Integer,org.cryptimeleon.math.structures.rings.zn.Zp.ZpElement> |
getShares(org.cryptimeleon.math.structures.rings.zn.Zp.ZpElement secret)
Randomly generates shares \(s_i\) for the given secret.
|
java.util.Map<java.lang.Integer,org.cryptimeleon.math.structures.rings.zn.Zp.ZpElement> |
getSolvingVector(java.util.Set<? extends Policy> setOfShareReceivers)
Instructs how to reconstruct a shared secret using the shares of a given set of share receivers
setOfShareReceivers. |
int |
hashCode() |
boolean |
isQualified(java.util.Set<? extends Policy> setOfShareReceivers)
Checks whether or not the given set of share receivers will be able to recreate the secret
by pooling their shares \(\{s_i \; | \; \text{getShareReceiver}(i) \in \text{setOfShareReceivers}\}\).
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetShareReceiver, getSharesOfReceiver, getSharesOfReceivers, isQualified, reconstructpublic ThresholdTreeSecretSharing(ThresholdPolicy policy, org.cryptimeleon.math.structures.rings.zn.Zp field, SecretSharingSchemeProvider lsssInstanceProvider)
ThresholdTreeSecretSharing instance.policy - root node of the ThresholdPolicy tree to share the secret amongfield - Zp over which the secret shall be sharedlsssInstanceProvider - SecretSharingSchemeProvider to be used for construction of the
LinearSecretSharing instances for the tree's inner nodesjava.lang.IllegalArgumentException - if the given ThresholdPolicy contains any node which is neither a
ThresholdPolicy nor a PolicyFactpublic ThresholdTreeSecretSharing(org.cryptimeleon.math.serialization.Representation repr)
public java.util.Map<java.lang.Integer,org.cryptimeleon.math.structures.rings.zn.Zp.ZpElement> getShares(org.cryptimeleon.math.structures.rings.zn.Zp.ZpElement secret)
throws WrongAccessStructureException
LinearSecretSharinggetShareReceiver(i) to determine which share belongs to which share receiver.getShares in interface LinearSecretSharing<Policy>WrongAccessStructureExceptionpublic java.util.Map<java.lang.Integer,org.cryptimeleon.math.structures.rings.zn.Zp.ZpElement> getSolvingVector(java.util.Set<? extends Policy> setOfShareReceivers) throws NoSatisfyingSet, WrongAccessStructureException
LinearSecretSharingsetOfShareReceivers.
More specifically, computes a vector of coefficients \(a_i\) such that
\(\sum a_i \cdot s_i = \text{secret}\) for the \(s_i\) output by getShares(secret).
Only shares \(s_i\) with getShareReceiver(i) contained in setOfShareReceivers
appear in this sum (one can imagine that all other \(a_i\) are 0).getSolvingVector in interface LinearSecretSharing<Policy>setOfShareReceivers - the set of share receivers to calculate the solving vector forgetShareReceiver(i) is contained in setOfShareReceivers.NoSatisfyingSet - if the given set of share receivers cannot reconstruct the secret,
i.e. isQualified(setOfShareReceivers) == falseWrongAccessStructureExceptionpublic java.util.Map<java.lang.Integer,Policy> getShareReceiverMap()
LinearSecretSharinggetShareReceiverMap in interface LinearSecretSharing<Policy>public boolean isQualified(java.util.Set<? extends Policy> setOfShareReceivers) throws WrongAccessStructureException
LinearSecretSharingisQualified in interface LinearSecretSharing<Policy>setOfShareReceivers - the set of share receivers to checkWrongAccessStructureExceptionpublic org.cryptimeleon.math.structures.rings.zn.Zp getSharedRing()
LinearSecretSharinggetSharedRing in interface LinearSecretSharing<Policy>public java.util.Map<java.lang.Integer,org.cryptimeleon.math.structures.rings.zn.Zp.ZpElement> completeShares(org.cryptimeleon.math.structures.rings.zn.Zp.ZpElement secret,
java.util.Map<java.lang.Integer,org.cryptimeleon.math.structures.rings.zn.Zp.ZpElement> partialShares)
throws java.lang.IllegalArgumentException
LinearSecretSharingisQualified(S) == true this method will simply recreate the full set of shares.
The contract is that the two S in the following are distributed identically:
completeShares in interface LinearSecretSharing<Policy>secret - the desired secret for the completed sharespartialShares - the set of partial shares \(\{s_i \; | \; i \in \text{getSharesOfReceivers}(X)\}\)getShares(secret)
(if the given partial shares are distributed as in getShares())java.lang.IllegalArgumentException - if partialShares cannot be completed to secretpublic boolean checkShareConsistency(org.cryptimeleon.math.structures.rings.zn.Zp.ZpElement secret,
java.util.Map<java.lang.Integer,org.cryptimeleon.math.structures.rings.zn.Zp.ZpElement> shares)
LinearSecretSharingcheckShareConsistency in interface LinearSecretSharing<Policy>public org.cryptimeleon.math.serialization.Representation getRepresentation()
getRepresentation in interface org.cryptimeleon.math.serialization.Representablepublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object