Skip to main content

reconstruct

Function reconstruct 

Source
pub fn reconstruct(shares: &[Share]) -> Result<Vec<u8>, String>
Expand description

Reconstruct the secret from a set of shares via Lagrange interpolation at x = 0. Requires at least the original k shares (fewer under-determines the polynomial and yields a wrong secret); all shares must have equal-length y and distinct x. Providing more than k is fine (consistent, overdetermined).