import { VerifiedShare, ShamirParams, ShamirConfig, ShareIndex, GF256Element, GF256Operations, GF256Polynomial, SplitResult, ReconstructionResult, ShareValidationResult } from './types';
/**
 * Irreducible polynomial for GF(2^8): x^8 + x^4 + x^3 + x + 1
 * Binary representation: 100011011 = 0x11B
 *
 * This polynomial is irreducible over GF(2), meaning it cannot be factored
 * into polynomials of lower degree with coefficients in GF(2).
 *
 * Proof of irreducibility:
 * - Degree 8 polynomial over GF(2)
 * - No roots in GF(2): f(0) = 1, f(1) = 1
 * - Not divisible by any degree 2, 3, or 4 irreducible polynomial
 * - This is verified by the AES specification (FIPS 197)
 */
declare const IRREDUCIBLE_POLY = 283;
/**
 * Pre-computed lookup tables for GF(2^8) operations.
 * Using lookup tables ensures constant-time operations.
 */
declare const EXP_TABLE: GF256Element[];
declare const LOG_TABLE: GF256Element[];
/**
 * GF(2^8) field operations with proven correctness.
 *
 * All operations are implemented using lookup tables for constant-time
 * execution, preventing timing side-channel attacks.
 */
export declare const GF256: GF256Operations;
/**
 * Create a polynomial over GF(2^8) with given coefficients.
 *
 * The polynomial is represented as:
 * f(x) = coefficients[0] + coefficients[1]*x + coefficients[2]*x^2 + ...
 */
export declare function createPolynomial(coefficients: GF256Element[]): GF256Polynomial;
/**
 * Generate a random polynomial of specified degree with given constant term.
 *
 * The polynomial f(x) is constructed such that f(0) = secret.
 * All other coefficients are uniformly random from GF(2^8).
 *
 * @param secret - The constant term (f(0) = secret)
 * @param degree - Degree of the polynomial (threshold - 1)
 * @param rng - Random number generator function
 */
export declare function generateRandomPolynomial(secret: GF256Element, degree: number, rng: (bytes: Uint8Array) => Uint8Array): GF256Polynomial;
/**
 * Compute Lagrange basis polynomial value at x=0.
 *
 * The Lagrange basis polynomial L_i(x) is defined as:
 * L_i(x) = Product_{j != i} (x - x_j) / (x_i - x_j)
 *
 * At x = 0:
 * L_i(0) = Product_{j != i} (-x_j) / (x_i - x_j)
 *        = Product_{j != i} x_j / (x_j - x_i)  [in GF(2^8), -x = x]
 *
 * Correctness proof:
 * - L_i(x_i) = 1 (all terms in product are 1)
 * - L_i(x_j) = 0 for j != i (numerator contains (x - x_j) = 0)
 * - This is the unique polynomial of degree <= n-1 with these properties
 *
 * @param indices - All x-coordinates of the interpolation points
 * @param i - Index of the basis polynomial to compute
 * @returns L_i(0) in GF(2^8)
 */
export declare function lagrangeBasisAtZero(indices: ShareIndex[], i: number): GF256Element;
/**
 * Reconstruct secret using Lagrange interpolation at x = 0.
 *
 * Given points (x_1, y_1), ..., (x_k, y_k), the interpolating polynomial is:
 * f(x) = Sum_{i=1}^{k} y_i * L_i(x)
 *
 * The secret is f(0) = Sum_{i=1}^{k} y_i * L_i(0)
 *
 * Correctness proof:
 * - Lagrange interpolation uniquely determines a polynomial of degree <= k-1
 * - For Shamir's scheme, the original polynomial has degree = threshold - 1
 * - With k = threshold shares, we recover the exact polynomial
 * - f(0) = secret by construction
 *
 * @param shares - Array of (index, value) pairs for a single byte position
 * @returns The reconstructed byte
 */
export declare function lagrangeInterpolateAtZero(shares: Array<{
    index: ShareIndex;
    value: GF256Element;
}>): GF256Element;
/**
 * Split a secret into shares using Shamir's Secret Sharing.
 *
 * Algorithm:
 * 1. For each byte of the secret:
 *    a. Generate random polynomial f(x) of degree (threshold - 1) with f(0) = secret_byte
 *    b. Evaluate f(x) at x = 1, 2, ..., totalShares
 * 2. Combine evaluations into shares
 * 3. Add integrity checksums
 *
 * Security properties:
 * - Any k shares can reconstruct the secret (completeness)
 * - k-1 shares reveal no information about the secret (perfect secrecy)
 *
 * @param secret - The secret to split
 * @param params - Shamir parameters (threshold, totalShares)
 * @param config - Optional configuration
 * @returns Split result with shares and metadata
 */
export declare function split(secret: Uint8Array, params: ShamirParams, config?: ShamirConfig): SplitResult;
/**
 * Reconstruct secret from shares using Lagrange interpolation.
 *
 * Algorithm:
 * 1. Verify we have enough shares (>= threshold)
 * 2. Optionally verify share checksums
 * 3. For each byte position:
 *    a. Collect (index, value) pairs from shares
 *    b. Apply Lagrange interpolation at x = 0
 * 4. Combine reconstructed bytes
 *
 * Correctness:
 * - With k >= threshold shares, Lagrange interpolation uniquely determines
 *   the original polynomial of degree (threshold - 1)
 * - The secret is f(0), which is recovered correctly
 *
 * @param shares - Shares to use for reconstruction
 * @param threshold - Minimum shares needed (must match original split)
 * @param config - Optional configuration
 * @returns Reconstruction result with secret and metadata
 */
export declare function reconstruct(shares: VerifiedShare[], threshold: number, config?: ShamirConfig): ReconstructionResult;
/**
 * Validate a single share.
 */
export declare function validateShare(share: VerifiedShare): ShareValidationResult;
/**
 * Verify that shares are compatible for reconstruction.
 * Checks that all shares have matching lengths and unique indices.
 */
export declare function verifyShareCompatibility(shares: VerifiedShare[]): ShareValidationResult;
/**
 * Constant-time select operation.
 * Returns a if condition is true, b otherwise.
 * Executes in constant time regardless of condition.
 */
export declare function constantTimeSelect(condition: boolean, a: GF256Element, b: GF256Element): GF256Element;
/**
 * Constant-time comparison of two byte arrays.
 * Returns true if equal, false otherwise.
 * Executes in constant time regardless of content.
 */
export declare function constantTimeEqual(a: Uint8Array, b: Uint8Array): boolean;
export { EXP_TABLE, LOG_TABLE, IRREDUCIBLE_POLY };
//# sourceMappingURL=verified-shamir.d.ts.map