@li0ard/dstu - v0.1.8
    Preparing search index...

    Type Alias ECDSA

    ECDSA signer

    type ECDSA = {
        getPublicKey: (
            secretKey: TArg<Uint8Array>,
            isCompressed?: boolean,
        ) => TRet<Uint8Array>;
        getSharedSecret: (
            secretKeyA: TArg<Uint8Array>,
            publicKeyB: TArg<Uint8Array>,
            withCofactor?: boolean,
        ) => TRet<Uint8Array>;
        keygen: (
            isCompressed?: boolean,
        ) => { publicKey: TRet<Uint8Array>; secretKey: TRet<Uint8Array> };
        lengths: Readonly<
            {
                fieldByteLength: number;
                pointByteLength: number;
                scalarByteLength: number;
                signatureByteLength: number;
            },
        >;
        sign: (
            secretKey: TArg<Uint8Array>,
            digest: TArg<Uint8Array>,
            rand?: TArg<Uint8Array>,
        ) => TRet<Uint8Array>;
        verify: (
            publicKey: TArg<Uint8Array>,
            digest: TArg<Uint8Array>,
            signature: TArg<Uint8Array>,
        ) => boolean;
    }
    Index

    Properties

    getPublicKey: (
        secretKey: TArg<Uint8Array>,
        isCompressed?: boolean,
    ) => TRet<Uint8Array>

    Computes public key for a secret key

    Type Declaration

      • (secretKey: TArg<Uint8Array>, isCompressed?: boolean): TRet<Uint8Array>
      • Parameters

        • secretKey: TArg<Uint8Array>
        • OptionalisCompressed: boolean

          Whether to return compact (default), or full key

        Returns TRet<Uint8Array>

        Public key, full when isCompressed=false; short when isCompressed=true

    getSharedSecret: (
        secretKeyA: TArg<Uint8Array>,
        publicKeyB: TArg<Uint8Array>,
        withCofactor?: boolean,
    ) => TRet<Uint8Array>

    Compute the shared secret point from a secret key and peer public key.

    Type Declaration

      • (
            secretKeyA: TArg<Uint8Array>,
            publicKeyB: TArg<Uint8Array>,
            withCofactor?: boolean,
        ): TRet<Uint8Array>
      • Parameters

        • secretKeyA: TArg<Uint8Array>

          Local secret key bytes.

        • publicKeyB: TArg<Uint8Array>

          Peer public key bytes.

        • OptionalwithCofactor: boolean

          Whether to multiply result by curve cofactor? (default - true).

        Returns TRet<Uint8Array>

        Encoded shared point.

    keygen: (
        isCompressed?: boolean,
    ) => { publicKey: TRet<Uint8Array>; secretKey: TRet<Uint8Array> }

    Generate a secret/public key pair.

    Type Declaration

      • (
            isCompressed?: boolean,
        ): { publicKey: TRet<Uint8Array>; secretKey: TRet<Uint8Array> }
      • Parameters

        • OptionalisCompressed: boolean

          Whether to return compact (default), or full key

        Returns { publicKey: TRet<Uint8Array>; secretKey: TRet<Uint8Array> }

        Secret/public key pair.

    lengths: Readonly<
        {
            fieldByteLength: number;
            pointByteLength: number;
            scalarByteLength: number;
            signatureByteLength: number;
        },
    >

    Byte lengths for keys and signatures exposed by this curve.

    sign: (
        secretKey: TArg<Uint8Array>,
        digest: TArg<Uint8Array>,
        rand?: TArg<Uint8Array>,
    ) => TRet<Uint8Array>

    Signs a message hash with a secret key.

    Type Declaration

      • (
            secretKey: TArg<Uint8Array>,
            digest: TArg<Uint8Array>,
            rand?: TArg<Uint8Array>,
        ): TRet<Uint8Array>
      • Parameters

        • secretKey: TArg<Uint8Array>

          Secret key bytes.

        • digest: TArg<Uint8Array>

          Digest bytes.

        • Optionalrand: TArg<Uint8Array>

          Optional parameter for ephemeral key

        Returns TRet<Uint8Array>

        Encoded signature bytes.

    verify: (
        publicKey: TArg<Uint8Array>,
        digest: TArg<Uint8Array>,
        signature: TArg<Uint8Array>,
    ) => boolean

    Verifies a signature against message hash and public key.

    Type Declaration

      • (
            publicKey: TArg<Uint8Array>,
            digest: TArg<Uint8Array>,
            signature: TArg<Uint8Array>,
        ): boolean
      • Parameters

        • publicKey: TArg<Uint8Array>

          Public key

        • digest: TArg<Uint8Array>

          Digest bytes

        • signature: TArg<Uint8Array>

          Encoded signature bytes.

        Returns boolean

        Whether the signature is valid.