INNER CODE UNIT · TypeScript

degree

privy-io/shamir-secret-sharing · src/index.ts:251

  const degree = threshold - 1;

  for (let i = 0; i < secretLength; i++) {
    const byte = secret[i]!;
    const coefficients = newCoefficients(byte, degree);

    for (let j = 0; j < shares; ++j) {
      const x = xCoordinates[j]!;
      const y = evaluate(coefficients, x, degree);
      result[j]![i] = y;
    }
  }

  return result;
}

/**
 * Combines `shares` to reconstruct the secret.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…