RAILGUN Reloaded
    Preparing search index...

    Baby Jubjub EDDSA-Poseidon, built on the prime-order subgroup primitives.

    Hierarchy

    • RailJubCurvePoint
      • EddsaPoseidon
    Index
    • Returns bigint

    • Returns the subgroup order used by the FROST and DKG primitives.

      Returns any

      The Baby Jubjub subgroup order.

    • Returns the additive identity for the Baby Jubjub subgroup.

      Returns Point<bigint>

      The affine identity point.

    • Samples a scalar uniformly from the subgroup order.

      Parameters

      • rejectionSampling: boolean = true

        When true, uses rejection sampling to avoid bias.

      Returns bigint

      A uniformly sampled scalar.

    • Multiplies the subgroup generator by a scalar.

      Parameters

      • k: bigint

        Scalar multiplier.

      Returns Point<bigint>

      The resulting affine point.

    • Multiplies an affine point by a scalar.

      Parameters

      • A: Point<bigint>

        Affine point.

      • k: bigint

        Scalar multiplier.

      Returns Point<bigint>

      The resulting affine point.

    • Serializes an affine subgroup point using RFC 8032-style compression.

      Parameters

      • A: Point<bigint>

        Affine point to serialize.

      Returns Uint8Array

      The compressed 32-byte point encoding.

    • Deserializes a compressed point and verifies subgroup membership.

      Parameters

      • buf: Uint8Array

        Compressed point bytes.

      Returns Point<bigint>

      The decoded affine point.

    • Serializes a scalar into the canonical 32-byte form expected by the repo.

      Parameters

      • s: bigint

        Scalar to serialize.

      Returns Uint8Array

      The serialized scalar bytes.

    • Deserializes a scalar from the canonical 32-byte form.

      Parameters

      • buf: Uint8Array

        Serialized scalar bytes.

      Returns bigint

      The decoded scalar.

    • Compares two affine points for coordinate equality.

      Parameters

      • a: Point<bigint>

        First affine point.

      • b: Point<bigint>

        Second affine point.

      Returns boolean

      true when both coordinates match.

    • Converts a scalar into the repo's canonical 32-byte little-endian form.

      Parameters

      • a: bigint

        Scalar to encode.

      Returns Uint8Array<ArrayBufferLike>

      Encoded bytes.

    • Decodes a scalar from the repo's canonical 32-byte little-endian form.

      Parameters

      • a: Uint8Array

        Encoded bytes.

      Returns bigint

      The decoded scalar.

    • Reduces a bigint modulo the full curve order.

      Parameters

      • x: bigint

        Value to reduce.

      Returns any

      The reduced scalar.

    • Reduces a bigint modulo the prime-order subgroup.

      Parameters

      • x: bigint

        Value to reduce.

      Returns any

      The reduced scalar.

    • Computes a multiplicative inverse in the subgroup field.

      Parameters

      • a: bigint

        Scalar to invert.

      Returns bigint

      The multiplicative inverse modulo the subgroup order.

    • Applies EdDSA bit pruning to a 32-byte buffer.

      Parameters

      • buff: Uint8Array

        Input bytes.

      Returns Uint8Array<ArrayBuffer>

      The pruned buffer.

    • Derives the Baby Jubjub secret scalar for the provided private key.

      Parameters

      • prv: Uint8Array

        Private key bytes.

      Returns bigint

      The derived subgroup scalar divided by the cofactor.

    • Maps an Edwards point into Montgomery coordinates when the mapping exists.

      Parameters

      • ed: { x: bigint; y: bigint }

        Edwards affine point.

        • x: bigint

          Edwards x-coordinate.

        • y: bigint

          Edwards y-coordinate.

      Returns { u: bigint; v: bigint }

      The mapped Montgomery coordinates.

    • Derives the Baby Jubjub public key for a 32-byte private key.

      Parameters

      • prv: Uint8Array

        Private key bytes.

      Returns [bigint, bigint]

      The affine Baby Jubjub public key.

    • Signs an arbitrary message byte array using EDDSA-Poseidon.

      Parameters

      • prv: Uint8Array

        Private key bytes.

      • msg: Uint8Array

        Message bytes to sign.

      Returns { R8: [bigint, bigint]; S: bigint }

      The generated signature.

    • Verifies an EDDSA-Poseidon signature.

      Parameters

      • msg: Uint8Array

        Message bytes that were signed.

      • sig: Signature

        Signature to verify.

      • A: any

        Public key.

      Returns boolean

      true when the signature is valid.

    • Packs an affine Baby Jubjub point into its compressed form.

      Parameters

      • point: Point<bigint>

        Affine point to pack.

      Returns Uint8Array

      Compressed point bytes.

    • Unpacks a compressed Baby Jubjub public key.

      Parameters

      • bytesIn: Uint8Array

        Compressed point bytes.

      Returns any

      The unpacked affine point or null if invalid.

    curveOrder: any = order
    generator: any = Base8
    Fr: any = FrValue
    order: any = subOrder
    identity: Point<bigint> = ...
    fieldPrime: any = r
    blake512: (msg: Input, opts?: Object) => Uint8Array = blake512