Poly

scalus.crypto.accumulator.Poly$package.Poly
object Poly

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Poly.type

Members list

Value members

Concrete methods

def apply(coeffs: BigInt*): Poly
def fromBigInts(coeffs: Vector[BigInt]): Poly

Build a Poly from BigInt coefficients (already reduced mod p).

Build a Poly from BigInt coefficients (already reduced mod p).

Attributes

def product(elements: Vector[BigInt]): Poly

Compute product polynomial ∏(x + aᵢ).

Compute product polynomial ∏(x + aᵢ).

Uses subproduct tree for large inputs, iterative for small.

Attributes

def productTree(elements: Vector[BigInt]): Poly

Compute product polynomial ∏(x + aᵢ) using a binary subproduct tree.

Compute product polynomial ∏(x + aᵢ) using a binary subproduct tree.

O(n log²n) with NTT, vs O(n²) for iterative multiplication.

Uses java.math.BigInteger arrays internally to avoid Scalar/BigInt wrapper overhead.

Attributes

Concrete fields

val one: Poly
val zero: Poly

Extensions

Extensions

extension (a: Poly)
def %(b: Poly): Poly
def *(b: Poly): Poly

Multiply two polynomials. Auto-selects between naive and NTT based on size.

Multiply two polynomials. Auto-selects between naive and NTT based on size.

Attributes

def +(b: Poly): Poly
def -(b: Poly): Poly
def /(b: Poly): Poly
def /%(b: Poly): (Poly, Poly)

Polynomial long division returning (quotient, remainder).

Polynomial long division returning (quotient, remainder).

Attributes

def coefficients: Vector[BigInt]
def degree: Int
def eval(x: BigInt): BigInt

Evaluate polynomial at x using Horner's method.

Evaluate polynomial at x using Horner's method.

Attributes

def extGcd(b: Poly): (Poly, Poly, Poly)

Extended Euclidean algorithm for polynomials.

Extended Euclidean algorithm for polynomials.

Returns (gcd, s, t) where sa + tb = gcd, with gcd monic.

Attributes

def isZero: Boolean