@did-btc1/key-pair
    Preparing search index...

    Class PublicKeyUtils

    Utility class for Multikey operations/ PublicKeyUtils

    Index

    Constructors

    Methods

    • Lifts a 32-byte x-only coordinate into a full secp256k1 point (x, y).

      Parameters

      • xBytes: Uint8Array

        32-byte x-coordinate

      Returns Uint8Array

      65-byte uncompressed public key (starts with 0x04)

    • Computes modular exponentiation: (base^exp) % mod. Used for computing modular square roots.

      Parameters

      • base: bigint

        The base value

      • exp: bigint

        The exponent value

      • mod: bigint

        The modulus value

      Returns bigint

      The result of the modular exponentiation

    • Computes sqrt(a) mod p using Tonelli-Shanks algorithm. This finds y such that y^2 ≡ a mod p.

      Parameters

      • a: bigint

        The value to find the square root of

      • p: bigint

        The prime modulus

      Returns bigint

      The square root of a mod p