Documentation ¶
Index ¶
Constants ¶
View Source
const ( PX_OFFSET = 0 PY_OFFSET = 8 FFTYPE_OFFSET = 40 SHARE_SIZE = 41 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Shamir ¶
type Shamir struct { ElementType int }
Define shamir configuration: MinShares -> minimum number of shares to generate secret MaxShares -> maximum number of shares distributed ElementType -> defines prime
func (Shamir) GenerateSecret ¶
Generate secret from shares S[0],...,S[N-1], where S[i] = (sx[i], sy[i]) = (x, poly(x)) secret = Sum_fromj=0_to_N-1 sy[j] * Prod_from_m=0,m!=j_to_m=N-1 ( sx[m] / (sx[m] - sx[j]))
sx[i] is an integer, sy[i] is a FF in Montgomery
func (Shamir) GenerateShares ¶
Generate shares in Montgomery for a given poly p(x), generate N shares (N=MaxShares) s[1], s[1],...,s[N] such that s[i] = p(i) for 0 < i < N and s[0] = secret (s[0] is not a share) is in Regular fmt
func (Shamir) GetMaxShares ¶
func (Shamir) GetMinShares ¶
Click to show internal directories.
Click to hide internal directories.