Function curveFromECParams

Parse certificate EC parameters and generate curve object

  • Parameters

    • params: ECParameters

      Public key parameters

    • lowS: boolean = false

      Low order

    Returns Readonly<{
        create: ((hash: CHash) => CurveFn);
        CURVE: Readonly<{
            a: bigint;
            allowedPrivateKeyLengths?: readonly number[];
            allowInfinityPoint?: boolean;
            b: bigint;
            bits2int?: ((bytes: Uint8Array) => bigint);
            bits2int_modN?: ((bytes: Uint8Array) => bigint);
            clearCofactor?: ((c: ProjConstructor<bigint>, point: ProjPointType<bigint>) => ProjPointType<bigint>);
            endo?: {
                beta: bigint;
                splitScalar: ((k: bigint) => {
                    k1: bigint;
                    k1neg: boolean;
                    k2: bigint;
                    k2neg: boolean;
                });
            };
            Fp: IField<bigint>;
            Gx: bigint;
            Gy: bigint;
            h: bigint;
            hash: CHash;
            hEff?: bigint;
            hmac: ((key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array);
            isTorsionFree?: ((c: ProjConstructor<bigint>, point: ProjPointType<bigint>) => boolean);
            lowS: boolean;
            n: bigint;
            nBitLength: number;
            nByteLength: number;
            p: bigint;
            randomBytes: ((bytesLength?: number) => Uint8Array);
            wrapPrivateKey?: boolean;
        }>;
        getPublicKey: ((privateKey: PrivKey, isCompressed?: boolean) => Uint8Array);
        getSharedSecret: ((privateA: PrivKey, publicB: Hex, isCompressed?: boolean) => Uint8Array);
        ProjectivePoint: ProjConstructor<bigint>;
        sign: ((msgHash: Hex, privKey: PrivKey, opts?: SignOpts) => RecoveredSignatureType);
        Signature: SignatureConstructor;
        utils: {
            normPrivateKeyToScalar: ((key: PrivKey) => bigint);
            precompute: ((windowSize?: number, point?: ProjPointType<bigint>) => ProjPointType<bigint>);
            randomPrivateKey: (() => Uint8Array);
            isValidPrivateKey(privateKey: PrivKey): boolean;
        };
        verify: ((signature: Hex | {
            r: bigint;
            s: bigint;
        }, msgHash: Hex, publicKey: Hex, opts?: VerOpts) => boolean);
    }>