Class ClassGroup

Class group element represented as a binary quadratic form (a, b, c) with discriminant d = b^2 - 4ac

Constructors

Properties

a: bigint
b: bigint
c: bigint
discriminant: bigint

Methods

  • Repeated squaring (n times)

    Parameters

    • n: number | bigint

    Returns void

  • Exponentiation by a BigInt

    Parameters

    • exponent: bigint

    Returns void

  • Serialize to bytes with specified size (matches Rust GMP serialize) targetSize is in bytes (half the total buffer size for a or b)

    Parameters

    • OptionaltargetSize: number

    Returns Uint8Array

  • Get the size in bits of the discriminant

    Parameters

    • discriminant: bigint

    Returns number