Struct threshold_secret_sharing::packed::PackedSecretSharing [] [src]

pub struct PackedSecretSharing {
    pub threshold: usize,
    pub share_count: usize,
    pub secret_count: usize,
    pub prime: i64,
    pub omega_secrets: i64,
    pub omega_shares: i64,
}

Parameters for the packed variant of Shamir secret sharing, specifying number of secrets shared together, total number of shares, and privacy threshold.

This scheme generalises Shamir's scheme by simultaneously sharing several secrets, at the expense of leaving a gap between the privacy threshold and the reconstruction limit.

The Fast Fourier Transform is used for efficiency reasons, allowing most operations run to quasilinear time O(n.log(n)) in share_count. An implication of this is that secrets and shares are positioned on positive powers of respectively an n-th and m-th principal root of unity, where n is a power of 2 and m a power of 3.

As a result there exist several constraints between the various parameters:

  • prime must be a prime large enough to hold the secrets we plan to share
  • share_count must be at least secret_count + threshold (the reconstruction limit)
  • secret_count + threshold + 1 must be a power of 2
  • share_count + 1 must be a power of 3
  • omega_secrets must be a (secret_count + threshold + 1)-th root of unity
  • omega_shares must be a (share_count + 1)-th root of unity

An optional paramgen feature provides methods for finding suitable parameters satisfying these somewhat complex requirements, in addition to several fixed parameter choices.

Fields

Maximum number of shares that can be known without exposing the secrets (privacy threshold).

Number of shares to split the secrets into.

Number of secrets to share together.

Prime defining the Zp field in which computation is taking place.

m-th principal root of unity in Zp, where m = secret_count + threshold + 1 must be a power of 2.

n-th principal root of unity in Zp, where n = share_count + 1 must be a power of 3.

Methods

impl PackedSecretSharing
[src]

Minimum number of shares required to reconstruct secrets.

For this scheme this is always secret_count + threshold

Generate share_count shares for the secrets vector.

The length of secrets must be secret_count. It is safe to pad with anything, including zeros.

Reconstruct the secrets from a large enough subset of the shares.

indices are the ranks of the known shares as output by the share method, while values are the actual values of these shares. Both must have the same number of elements, and at least reconstruct_limit.

The resulting vector is of length secret_count.

Trait Implementations

impl Debug for PackedSecretSharing
[src]

Formats the value using the given formatter.

impl Copy for PackedSecretSharing
[src]

impl Clone for PackedSecretSharing
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for PackedSecretSharing
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.