Crypto Lib
    Preparing search index...

    Function splitSecret

    • Split a secret into n shares with a reconstruction threshold of threshold.

      Uses Shamir's Secret Sharing over GF(p) where p is the Ed25519 group order. The secret is the constant term of a random polynomial of degree (threshold - 1).

      Parameters

      • secret: string

        Hex-encoded 32-byte secret (interpreted as a scalar in GF(p)).

      • n: number

        Total number of shares to generate (must be >= threshold).

      • threshold: number

        Minimum shares required for reconstruction (must be >= 2).

      Returns SplitResult