secretutil

Contains all the auxillary functions to do linear secret sharing (LSS) over an access structure. Mainly, we represent the access structure as a binary tree. This could also support matrices for representing access structures.

class secretutil.SecretUtil(groupObj, verbose=True)[source]

Bases: object

P(coeff, x)[source]
calculateSharesDict(secret, tree)[source]

calculate shares from given secret and returns a dict as {attribute:shares} pairs

calculateSharesList(secret, tree)[source]

calculate shares from given secret and returns a list of shares.

createPolicy(policy_string)[source]
genShares(secret, k, n)[source]
getAttributeList(Node)[source]
getCoefficients(tree)[source]
prune(policy, attributes)[source]

determine whether a given set of attributes satisfies the policy

recoverCoefficients(list)[source]

recovers the coefficients over a binary tree.

recoverSecret(shares)[source]

take shares and attempt to recover secret by taking sum of coeff * share for all shares. if user indeed has at least k of n shares, then secret will be recovered.

strip_index(node_str)[source]