Skip to main content

Module shamir

Module shamir 

Source
Expand description

Real Shamir secret sharing over the P-256 scalar field.

Splits a Scalar secret into N shares using a random polynomial of degree T-1. Any T shares can reconstruct the secret via Lagrange interpolation.

Structs§

Share
A Shamir share: (x, y) where x is the party index and y is a scalar. The secret y field is zeroized on drop.

Enums§

ShamirError
Errors during Shamir operations.

Functions§

recover_secret
Recover the secret (the polynomial evaluated at x=0) from at least t shares via Lagrange interpolation.
split_secret
Split a secret into n shares with threshold t. Any t of the n shares can reconstruct the secret.