RAILGUN Reloaded
    Preparing search index...
    eddsa: {
        privateKeyToPublicKey(
            privateKey: Uint8Array,
        ): [Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>];
        signPoseidon(
            key: Uint8Array,
            message: Uint8Array,
        ): [
            Uint8Array<ArrayBufferLike>,
            Uint8Array<ArrayBufferLike>,
            Uint8Array<ArrayBufferLike>,
        ];
        verifyEDDSA(
            message: Uint8Array,
            signature: EddsaSignature,
            pubkey: [Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>],
        ): boolean;
    } = ...

    Type Declaration

    • privateKeyToPublicKey: function
      • Convert a babyJubJub private key to its public key.

        Parameters

        • privateKey: Uint8Array

          32-byte private key.

        Returns [Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>]

        The public key as a tuple of two 32-byte big-endian coordinates.

    • signPoseidon: function
      • Sign a message under the babyJubJub EDDSA scheme using Poseidon as the hash function. The message bytes are interpreted as a big-endian field element.

        Parameters

        • key: Uint8Array

          32-byte private key.

        • message: Uint8Array

          Message bytes to sign.

        Returns [
            Uint8Array<ArrayBufferLike>,
            Uint8Array<ArrayBufferLike>,
            Uint8Array<ArrayBufferLike>,
        ]

        Signature as a 3-tuple [R8x, R8y, S], each 32 bytes.

    • verifyEDDSA: function
      • Verify a babyJubJub EDDSA signature created with Poseidon. Signatures whose S falls outside [0, L) are rejected as malleable, and any malformed point (off-curve, identity, or small-subgroup) fails to verify.

        Parameters

        • message: Uint8Array

          Original message bytes.

        • signature: EddsaSignature

          Signature decoded into { R8, S } shape.

        • pubkey: [Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>]

          Public key tuple matching the signing key.

        Returns boolean

        True when the signature verifies.