UNPKG

gowl-client-lib

Version:
537 lines (526 loc) 29.7 kB
import * as _noble_curves_abstract_modular from '@noble/curves/abstract/modular'; import * as _noble_curves_abstract_weierstrass from '@noble/curves/abstract/weierstrass'; import { ProjPointType } from '@noble/curves/abstract/weierstrass'; import * as _noble_curves_abstract_utils from '@noble/curves/abstract/utils'; export { p256 } from '@noble/curves/p256'; export { p384 } from '@noble/curves/p384'; export { p521 } from '@noble/curves/p521'; declare enum SupportedCurves { P256 = 256, P384 = 384, P521 = 521, SECP256K1 = 2561 } declare const CurveMap: { 256: Readonly<{ create: (hash: _noble_curves_abstract_utils.CHash) => _noble_curves_abstract_weierstrass.CurveFn; CURVE: ReturnType<(curve: _noble_curves_abstract_weierstrass.CurveType) => Readonly<{ readonly nBitLength: number; readonly nByteLength: number; readonly Fp: _noble_curves_abstract_modular.IField<bigint>; readonly n: bigint; readonly h: bigint; readonly hEff?: bigint; readonly Gx: bigint; readonly Gy: bigint; readonly allowInfinityPoint?: boolean; readonly a: bigint; readonly b: bigint; readonly allowedPrivateKeyLengths?: readonly number[]; readonly wrapPrivateKey?: boolean; readonly endo?: { beta: bigint; splitScalar: (k: bigint) => { k1neg: boolean; k1: bigint; k2neg: boolean; k2: bigint; }; }; readonly isTorsionFree?: ((c: _noble_curves_abstract_weierstrass.ProjConstructor<bigint>, point: _noble_curves_abstract_weierstrass.ProjPointType<bigint>) => boolean) | undefined; readonly clearCofactor?: ((c: _noble_curves_abstract_weierstrass.ProjConstructor<bigint>, point: _noble_curves_abstract_weierstrass.ProjPointType<bigint>) => _noble_curves_abstract_weierstrass.ProjPointType<bigint>) | undefined; readonly hash: _noble_curves_abstract_utils.CHash; readonly hmac: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array; readonly randomBytes: (bytesLength?: number) => Uint8Array; lowS: boolean; readonly bits2int?: (bytes: Uint8Array) => bigint; readonly bits2int_modN?: (bytes: Uint8Array) => bigint; readonly p: bigint; }>>; getPublicKey: (privateKey: _noble_curves_abstract_utils.PrivKey, isCompressed?: boolean) => Uint8Array; getSharedSecret: (privateA: _noble_curves_abstract_utils.PrivKey, publicB: _noble_curves_abstract_utils.Hex, isCompressed?: boolean) => Uint8Array; sign: (msgHash: _noble_curves_abstract_utils.Hex, privKey: _noble_curves_abstract_utils.PrivKey, opts?: _noble_curves_abstract_weierstrass.SignOpts) => _noble_curves_abstract_weierstrass.RecoveredSignatureType; verify: (signature: _noble_curves_abstract_utils.Hex | { r: bigint; s: bigint; }, msgHash: _noble_curves_abstract_utils.Hex, publicKey: _noble_curves_abstract_utils.Hex, opts?: _noble_curves_abstract_weierstrass.VerOpts) => boolean; ProjectivePoint: _noble_curves_abstract_weierstrass.ProjConstructor<bigint>; Signature: _noble_curves_abstract_weierstrass.SignatureConstructor; utils: { normPrivateKeyToScalar: (key: _noble_curves_abstract_utils.PrivKey) => bigint; isValidPrivateKey(privateKey: _noble_curves_abstract_utils.PrivKey): boolean; randomPrivateKey: () => Uint8Array; precompute: (windowSize?: number, point?: _noble_curves_abstract_weierstrass.ProjPointType<bigint>) => _noble_curves_abstract_weierstrass.ProjPointType<bigint>; }; }>; 384: Readonly<{ create: (hash: _noble_curves_abstract_utils.CHash) => _noble_curves_abstract_weierstrass.CurveFn; CURVE: ReturnType<(curve: _noble_curves_abstract_weierstrass.CurveType) => Readonly<{ readonly nBitLength: number; readonly nByteLength: number; readonly Fp: _noble_curves_abstract_modular.IField<bigint>; readonly n: bigint; readonly h: bigint; readonly hEff?: bigint; readonly Gx: bigint; readonly Gy: bigint; readonly allowInfinityPoint?: boolean; readonly a: bigint; readonly b: bigint; readonly allowedPrivateKeyLengths?: readonly number[]; readonly wrapPrivateKey?: boolean; readonly endo?: { beta: bigint; splitScalar: (k: bigint) => { k1neg: boolean; k1: bigint; k2neg: boolean; k2: bigint; }; }; readonly isTorsionFree?: ((c: _noble_curves_abstract_weierstrass.ProjConstructor<bigint>, point: _noble_curves_abstract_weierstrass.ProjPointType<bigint>) => boolean) | undefined; readonly clearCofactor?: ((c: _noble_curves_abstract_weierstrass.ProjConstructor<bigint>, point: _noble_curves_abstract_weierstrass.ProjPointType<bigint>) => _noble_curves_abstract_weierstrass.ProjPointType<bigint>) | undefined; readonly hash: _noble_curves_abstract_utils.CHash; readonly hmac: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array; readonly randomBytes: (bytesLength?: number) => Uint8Array; lowS: boolean; readonly bits2int?: (bytes: Uint8Array) => bigint; readonly bits2int_modN?: (bytes: Uint8Array) => bigint; readonly p: bigint; }>>; getPublicKey: (privateKey: _noble_curves_abstract_utils.PrivKey, isCompressed?: boolean) => Uint8Array; getSharedSecret: (privateA: _noble_curves_abstract_utils.PrivKey, publicB: _noble_curves_abstract_utils.Hex, isCompressed?: boolean) => Uint8Array; sign: (msgHash: _noble_curves_abstract_utils.Hex, privKey: _noble_curves_abstract_utils.PrivKey, opts?: _noble_curves_abstract_weierstrass.SignOpts) => _noble_curves_abstract_weierstrass.RecoveredSignatureType; verify: (signature: _noble_curves_abstract_utils.Hex | { r: bigint; s: bigint; }, msgHash: _noble_curves_abstract_utils.Hex, publicKey: _noble_curves_abstract_utils.Hex, opts?: _noble_curves_abstract_weierstrass.VerOpts) => boolean; ProjectivePoint: _noble_curves_abstract_weierstrass.ProjConstructor<bigint>; Signature: _noble_curves_abstract_weierstrass.SignatureConstructor; utils: { normPrivateKeyToScalar: (key: _noble_curves_abstract_utils.PrivKey) => bigint; isValidPrivateKey(privateKey: _noble_curves_abstract_utils.PrivKey): boolean; randomPrivateKey: () => Uint8Array; precompute: (windowSize?: number, point?: _noble_curves_abstract_weierstrass.ProjPointType<bigint>) => _noble_curves_abstract_weierstrass.ProjPointType<bigint>; }; }>; 521: Readonly<{ create: (hash: _noble_curves_abstract_utils.CHash) => _noble_curves_abstract_weierstrass.CurveFn; CURVE: ReturnType<(curve: _noble_curves_abstract_weierstrass.CurveType) => Readonly<{ readonly nBitLength: number; readonly nByteLength: number; readonly Fp: _noble_curves_abstract_modular.IField<bigint>; readonly n: bigint; readonly h: bigint; readonly hEff?: bigint; readonly Gx: bigint; readonly Gy: bigint; readonly allowInfinityPoint?: boolean; readonly a: bigint; readonly b: bigint; readonly allowedPrivateKeyLengths?: readonly number[]; readonly wrapPrivateKey?: boolean; readonly endo?: { beta: bigint; splitScalar: (k: bigint) => { k1neg: boolean; k1: bigint; k2neg: boolean; k2: bigint; }; }; readonly isTorsionFree?: ((c: _noble_curves_abstract_weierstrass.ProjConstructor<bigint>, point: _noble_curves_abstract_weierstrass.ProjPointType<bigint>) => boolean) | undefined; readonly clearCofactor?: ((c: _noble_curves_abstract_weierstrass.ProjConstructor<bigint>, point: _noble_curves_abstract_weierstrass.ProjPointType<bigint>) => _noble_curves_abstract_weierstrass.ProjPointType<bigint>) | undefined; readonly hash: _noble_curves_abstract_utils.CHash; readonly hmac: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array; readonly randomBytes: (bytesLength?: number) => Uint8Array; lowS: boolean; readonly bits2int?: (bytes: Uint8Array) => bigint; readonly bits2int_modN?: (bytes: Uint8Array) => bigint; readonly p: bigint; }>>; getPublicKey: (privateKey: _noble_curves_abstract_utils.PrivKey, isCompressed?: boolean) => Uint8Array; getSharedSecret: (privateA: _noble_curves_abstract_utils.PrivKey, publicB: _noble_curves_abstract_utils.Hex, isCompressed?: boolean) => Uint8Array; sign: (msgHash: _noble_curves_abstract_utils.Hex, privKey: _noble_curves_abstract_utils.PrivKey, opts?: _noble_curves_abstract_weierstrass.SignOpts) => _noble_curves_abstract_weierstrass.RecoveredSignatureType; verify: (signature: _noble_curves_abstract_utils.Hex | { r: bigint; s: bigint; }, msgHash: _noble_curves_abstract_utils.Hex, publicKey: _noble_curves_abstract_utils.Hex, opts?: _noble_curves_abstract_weierstrass.VerOpts) => boolean; ProjectivePoint: _noble_curves_abstract_weierstrass.ProjConstructor<bigint>; Signature: _noble_curves_abstract_weierstrass.SignatureConstructor; utils: { normPrivateKeyToScalar: (key: _noble_curves_abstract_utils.PrivKey) => bigint; isValidPrivateKey(privateKey: _noble_curves_abstract_utils.PrivKey): boolean; randomPrivateKey: () => Uint8Array; precompute: (windowSize?: number, point?: _noble_curves_abstract_weierstrass.ProjPointType<bigint>) => _noble_curves_abstract_weierstrass.ProjPointType<bigint>; }; }>; 2561: Readonly<{ create: (hash: _noble_curves_abstract_utils.CHash) => _noble_curves_abstract_weierstrass.CurveFn; CURVE: ReturnType<(curve: _noble_curves_abstract_weierstrass.CurveType) => Readonly<{ readonly nBitLength: number; readonly nByteLength: number; readonly Fp: _noble_curves_abstract_modular.IField<bigint>; readonly n: bigint; readonly h: bigint; readonly hEff?: bigint; readonly Gx: bigint; readonly Gy: bigint; readonly allowInfinityPoint?: boolean; readonly a: bigint; readonly b: bigint; readonly allowedPrivateKeyLengths?: readonly number[]; readonly wrapPrivateKey?: boolean; readonly endo?: { beta: bigint; splitScalar: (k: bigint) => { k1neg: boolean; k1: bigint; k2neg: boolean; k2: bigint; }; }; readonly isTorsionFree?: ((c: _noble_curves_abstract_weierstrass.ProjConstructor<bigint>, point: ProjPointType<bigint>) => boolean) | undefined; readonly clearCofactor?: ((c: _noble_curves_abstract_weierstrass.ProjConstructor<bigint>, point: ProjPointType<bigint>) => ProjPointType<bigint>) | undefined; readonly hash: _noble_curves_abstract_utils.CHash; readonly hmac: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array; readonly randomBytes: (bytesLength?: number) => Uint8Array; lowS: boolean; readonly bits2int?: (bytes: Uint8Array) => bigint; readonly bits2int_modN?: (bytes: Uint8Array) => bigint; readonly p: bigint; }>>; getPublicKey: (privateKey: _noble_curves_abstract_utils.PrivKey, isCompressed?: boolean) => Uint8Array; getSharedSecret: (privateA: _noble_curves_abstract_utils.PrivKey, publicB: _noble_curves_abstract_utils.Hex, isCompressed?: boolean) => Uint8Array; sign: (msgHash: _noble_curves_abstract_utils.Hex, privKey: _noble_curves_abstract_utils.PrivKey, opts?: _noble_curves_abstract_weierstrass.SignOpts) => _noble_curves_abstract_weierstrass.RecoveredSignatureType; verify: (signature: _noble_curves_abstract_utils.Hex | { r: bigint; s: bigint; }, msgHash: _noble_curves_abstract_utils.Hex, publicKey: _noble_curves_abstract_utils.Hex, opts?: _noble_curves_abstract_weierstrass.VerOpts) => boolean; ProjectivePoint: _noble_curves_abstract_weierstrass.ProjConstructor<bigint>; Signature: _noble_curves_abstract_weierstrass.SignatureConstructor; utils: { normPrivateKeyToScalar: (key: _noble_curves_abstract_utils.PrivKey) => bigint; isValidPrivateKey(privateKey: _noble_curves_abstract_utils.PrivKey): boolean; randomPrivateKey: () => Uint8Array; precompute: (windowSize?: number, point?: ProjPointType<bigint>) => ProjPointType<bigint>; }; }>; }; type SchnorrZKP = { V: ProjPointType<bigint>; r: bigint; }; declare enum Keys { Session = "session_key", Confirmation = "confirmation_key" } declare enum KeyTags { ClientKC = "KC_1_U", ServerKC = "KC_1_V" } declare function ModuloN(x: bigint, n: bigint): bigint; declare function HighEntropyRandom(from: bigint, to: bigint): Promise<bigint>; declare function GenerateKey(curve: SupportedCurves): Promise<bigint>; declare function IntTo4Bytes(i: number): Uint8Array; declare function ToBytes(data: Uint8Array | bigint | string | SchnorrZKP): Uint8Array; declare function CompareTo(a: bigint, b: bigint): number; declare function BytesToBigInt(bytes: Uint8Array): bigint; type RegisterOutput = { User: string; PI: string; T: string; }; type ClientAuthInit = { User: string; X1: string; X2: string; PI1_V: string; PI2_V: string; PI1_R: string; PI2_R: string; }; type ClientAuthInitPrivate = { PI: bigint; t: bigint; T: ProjPointType<bigint>; x1: bigint; x2: bigint; X1: ProjPointType<bigint>; X2: ProjPointType<bigint>; PI1: SchnorrZKP; PI2: SchnorrZKP; }; type ServerAuthInit = { X3: string; X4: string; PI3_V: string; PI4_V: string; PI3_R: string; PI4_R: string; Beta: string; PIBeta_V: string; PIBeta_R: string; }; type ClientAuthVerify = { ClientKCTag: string; Alpha: string; PIAlpha_V: string; PIAlpha_R: string; R: string; }; type ClientAuthVerifyPrivate = { X3: ProjPointType<bigint>; X4: ProjPointType<bigint>; PI3: SchnorrZKP; PI4: SchnorrZKP; Beta: ProjPointType<bigint>; PIBeta: SchnorrZKP; }; type ServerAuthVerify = { ServerKCTag: string; }; declare class Client { private userName; private password; private server; private curveKey; private curve; private G; private N; private clientAuthInit; private clientAuthVerify; private clientKCKey; private clientSessionKey; constructor(userName: string, password: string, server: string, curve: SupportedCurves); Register(): Promise<RegisterOutput | Error>; AuthInit(): Promise<ClientAuthInit | Error>; private ParseServerInit; AuthVerify(serverInit: ServerAuthInit): Promise<ClientAuthVerify | Error>; ValidateServer(serverVerify: ServerAuthVerify): Promise<void | Error>; GetSessionKey(): bigint | Error; } declare function GenerateZKPGProvided(curve: SupportedCurves, g: ProjPointType<bigint>, n: bigint, x: bigint, X: ProjPointType<bigint>, prover: string): Promise<SchnorrZKP>; declare function VerifyZKP(curve: SupportedCurves, generator: ProjPointType<bigint>, X: ProjPointType<bigint>, zkp: SchnorrZKP, prover: string): Promise<boolean>; declare function Hash(...args: Array<Uint8Array | bigint | string | SchnorrZKP>): Promise<bigint>; declare function HMac(key: bigint, messageString: string, senderID: string, receiverID: string, senderKey1: Uint8Array, senderKey2: Uint8Array, receiverKey1: Uint8Array, receiverKey2: Uint8Array): Promise<bigint>; declare function GetG(curve: SupportedCurves): ProjPointType<bigint>; declare function CalculateCofactor(curve: SupportedCurves): bigint; declare function GetCurve(curve: SupportedCurves): Readonly<{ create: (hash: _noble_curves_abstract_utils.CHash) => _noble_curves_abstract_weierstrass.CurveFn; CURVE: ReturnType<(curve: _noble_curves_abstract_weierstrass.CurveType) => Readonly<{ readonly nBitLength: number; readonly nByteLength: number; readonly Fp: _noble_curves_abstract_modular.IField<bigint>; readonly n: bigint; readonly h: bigint; readonly hEff?: bigint; readonly Gx: bigint; readonly Gy: bigint; readonly allowInfinityPoint?: boolean; readonly a: bigint; readonly b: bigint; readonly allowedPrivateKeyLengths?: readonly number[]; readonly wrapPrivateKey?: boolean; readonly endo?: { beta: bigint; splitScalar: (k: bigint) => { k1neg: boolean; k1: bigint; k2neg: boolean; k2: bigint; }; }; readonly isTorsionFree?: ((c: _noble_curves_abstract_weierstrass.ProjConstructor<bigint>, point: _noble_curves_abstract_weierstrass.ProjPointType<bigint>) => boolean) | undefined; readonly clearCofactor?: ((c: _noble_curves_abstract_weierstrass.ProjConstructor<bigint>, point: _noble_curves_abstract_weierstrass.ProjPointType<bigint>) => _noble_curves_abstract_weierstrass.ProjPointType<bigint>) | undefined; readonly hash: _noble_curves_abstract_utils.CHash; readonly hmac: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array; readonly randomBytes: (bytesLength?: number) => Uint8Array; lowS: boolean; readonly bits2int?: (bytes: Uint8Array) => bigint; readonly bits2int_modN?: (bytes: Uint8Array) => bigint; readonly p: bigint; }>>; getPublicKey: (privateKey: _noble_curves_abstract_utils.PrivKey, isCompressed?: boolean) => Uint8Array; getSharedSecret: (privateA: _noble_curves_abstract_utils.PrivKey, publicB: _noble_curves_abstract_utils.Hex, isCompressed?: boolean) => Uint8Array; sign: (msgHash: _noble_curves_abstract_utils.Hex, privKey: _noble_curves_abstract_utils.PrivKey, opts?: _noble_curves_abstract_weierstrass.SignOpts) => _noble_curves_abstract_weierstrass.RecoveredSignatureType; verify: (signature: _noble_curves_abstract_utils.Hex | { r: bigint; s: bigint; }, msgHash: _noble_curves_abstract_utils.Hex, publicKey: _noble_curves_abstract_utils.Hex, opts?: _noble_curves_abstract_weierstrass.VerOpts) => boolean; ProjectivePoint: _noble_curves_abstract_weierstrass.ProjConstructor<bigint>; Signature: _noble_curves_abstract_weierstrass.SignatureConstructor; utils: { normPrivateKeyToScalar: (key: _noble_curves_abstract_utils.PrivKey) => bigint; isValidPrivateKey(privateKey: _noble_curves_abstract_utils.PrivKey): boolean; randomPrivateKey: () => Uint8Array; precompute: (windowSize?: number, point?: _noble_curves_abstract_weierstrass.ProjPointType<bigint>) => _noble_curves_abstract_weierstrass.ProjPointType<bigint>; }; }> | Readonly<{ create: (hash: _noble_curves_abstract_utils.CHash) => _noble_curves_abstract_weierstrass.CurveFn; CURVE: ReturnType<(curve: _noble_curves_abstract_weierstrass.CurveType) => Readonly<{ readonly nBitLength: number; readonly nByteLength: number; readonly Fp: _noble_curves_abstract_modular.IField<bigint>; readonly n: bigint; readonly h: bigint; readonly hEff?: bigint; readonly Gx: bigint; readonly Gy: bigint; readonly allowInfinityPoint?: boolean; readonly a: bigint; readonly b: bigint; readonly allowedPrivateKeyLengths?: readonly number[]; readonly wrapPrivateKey?: boolean; readonly endo?: { beta: bigint; splitScalar: (k: bigint) => { k1neg: boolean; k1: bigint; k2neg: boolean; k2: bigint; }; }; readonly isTorsionFree?: ((c: _noble_curves_abstract_weierstrass.ProjConstructor<bigint>, point: _noble_curves_abstract_weierstrass.ProjPointType<bigint>) => boolean) | undefined; readonly clearCofactor?: ((c: _noble_curves_abstract_weierstrass.ProjConstructor<bigint>, point: _noble_curves_abstract_weierstrass.ProjPointType<bigint>) => _noble_curves_abstract_weierstrass.ProjPointType<bigint>) | undefined; readonly hash: _noble_curves_abstract_utils.CHash; readonly hmac: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array; readonly randomBytes: (bytesLength?: number) => Uint8Array; lowS: boolean; readonly bits2int?: (bytes: Uint8Array) => bigint; readonly bits2int_modN?: (bytes: Uint8Array) => bigint; readonly p: bigint; }>>; getPublicKey: (privateKey: _noble_curves_abstract_utils.PrivKey, isCompressed?: boolean) => Uint8Array; getSharedSecret: (privateA: _noble_curves_abstract_utils.PrivKey, publicB: _noble_curves_abstract_utils.Hex, isCompressed?: boolean) => Uint8Array; sign: (msgHash: _noble_curves_abstract_utils.Hex, privKey: _noble_curves_abstract_utils.PrivKey, opts?: _noble_curves_abstract_weierstrass.SignOpts) => _noble_curves_abstract_weierstrass.RecoveredSignatureType; verify: (signature: _noble_curves_abstract_utils.Hex | { r: bigint; s: bigint; }, msgHash: _noble_curves_abstract_utils.Hex, publicKey: _noble_curves_abstract_utils.Hex, opts?: _noble_curves_abstract_weierstrass.VerOpts) => boolean; ProjectivePoint: _noble_curves_abstract_weierstrass.ProjConstructor<bigint>; Signature: _noble_curves_abstract_weierstrass.SignatureConstructor; utils: { normPrivateKeyToScalar: (key: _noble_curves_abstract_utils.PrivKey) => bigint; isValidPrivateKey(privateKey: _noble_curves_abstract_utils.PrivKey): boolean; randomPrivateKey: () => Uint8Array; precompute: (windowSize?: number, point?: _noble_curves_abstract_weierstrass.ProjPointType<bigint>) => _noble_curves_abstract_weierstrass.ProjPointType<bigint>; }; }> | Readonly<{ create: (hash: _noble_curves_abstract_utils.CHash) => _noble_curves_abstract_weierstrass.CurveFn; CURVE: ReturnType<(curve: _noble_curves_abstract_weierstrass.CurveType) => Readonly<{ readonly nBitLength: number; readonly nByteLength: number; readonly Fp: _noble_curves_abstract_modular.IField<bigint>; readonly n: bigint; readonly h: bigint; readonly hEff?: bigint; readonly Gx: bigint; readonly Gy: bigint; readonly allowInfinityPoint?: boolean; readonly a: bigint; readonly b: bigint; readonly allowedPrivateKeyLengths?: readonly number[]; readonly wrapPrivateKey?: boolean; readonly endo?: { beta: bigint; splitScalar: (k: bigint) => { k1neg: boolean; k1: bigint; k2neg: boolean; k2: bigint; }; }; readonly isTorsionFree?: ((c: _noble_curves_abstract_weierstrass.ProjConstructor<bigint>, point: _noble_curves_abstract_weierstrass.ProjPointType<bigint>) => boolean) | undefined; readonly clearCofactor?: ((c: _noble_curves_abstract_weierstrass.ProjConstructor<bigint>, point: _noble_curves_abstract_weierstrass.ProjPointType<bigint>) => _noble_curves_abstract_weierstrass.ProjPointType<bigint>) | undefined; readonly hash: _noble_curves_abstract_utils.CHash; readonly hmac: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array; readonly randomBytes: (bytesLength?: number) => Uint8Array; lowS: boolean; readonly bits2int?: (bytes: Uint8Array) => bigint; readonly bits2int_modN?: (bytes: Uint8Array) => bigint; readonly p: bigint; }>>; getPublicKey: (privateKey: _noble_curves_abstract_utils.PrivKey, isCompressed?: boolean) => Uint8Array; getSharedSecret: (privateA: _noble_curves_abstract_utils.PrivKey, publicB: _noble_curves_abstract_utils.Hex, isCompressed?: boolean) => Uint8Array; sign: (msgHash: _noble_curves_abstract_utils.Hex, privKey: _noble_curves_abstract_utils.PrivKey, opts?: _noble_curves_abstract_weierstrass.SignOpts) => _noble_curves_abstract_weierstrass.RecoveredSignatureType; verify: (signature: _noble_curves_abstract_utils.Hex | { r: bigint; s: bigint; }, msgHash: _noble_curves_abstract_utils.Hex, publicKey: _noble_curves_abstract_utils.Hex, opts?: _noble_curves_abstract_weierstrass.VerOpts) => boolean; ProjectivePoint: _noble_curves_abstract_weierstrass.ProjConstructor<bigint>; Signature: _noble_curves_abstract_weierstrass.SignatureConstructor; utils: { normPrivateKeyToScalar: (key: _noble_curves_abstract_utils.PrivKey) => bigint; isValidPrivateKey(privateKey: _noble_curves_abstract_utils.PrivKey): boolean; randomPrivateKey: () => Uint8Array; precompute: (windowSize?: number, point?: _noble_curves_abstract_weierstrass.ProjPointType<bigint>) => _noble_curves_abstract_weierstrass.ProjPointType<bigint>; }; }> | Readonly<{ create: (hash: _noble_curves_abstract_utils.CHash) => _noble_curves_abstract_weierstrass.CurveFn; CURVE: ReturnType<(curve: _noble_curves_abstract_weierstrass.CurveType) => Readonly<{ readonly nBitLength: number; readonly nByteLength: number; readonly Fp: _noble_curves_abstract_modular.IField<bigint>; readonly n: bigint; readonly h: bigint; readonly hEff?: bigint; readonly Gx: bigint; readonly Gy: bigint; readonly allowInfinityPoint?: boolean; readonly a: bigint; readonly b: bigint; readonly allowedPrivateKeyLengths?: readonly number[]; readonly wrapPrivateKey?: boolean; readonly endo?: { beta: bigint; splitScalar: (k: bigint) => { k1neg: boolean; k1: bigint; k2neg: boolean; k2: bigint; }; }; readonly isTorsionFree?: ((c: _noble_curves_abstract_weierstrass.ProjConstructor<bigint>, point: ProjPointType<bigint>) => boolean) | undefined; readonly clearCofactor?: ((c: _noble_curves_abstract_weierstrass.ProjConstructor<bigint>, point: ProjPointType<bigint>) => ProjPointType<bigint>) | undefined; readonly hash: _noble_curves_abstract_utils.CHash; readonly hmac: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array; readonly randomBytes: (bytesLength?: number) => Uint8Array; lowS: boolean; readonly bits2int?: (bytes: Uint8Array) => bigint; readonly bits2int_modN?: (bytes: Uint8Array) => bigint; readonly p: bigint; }>>; getPublicKey: (privateKey: _noble_curves_abstract_utils.PrivKey, isCompressed?: boolean) => Uint8Array; getSharedSecret: (privateA: _noble_curves_abstract_utils.PrivKey, publicB: _noble_curves_abstract_utils.Hex, isCompressed?: boolean) => Uint8Array; sign: (msgHash: _noble_curves_abstract_utils.Hex, privKey: _noble_curves_abstract_utils.PrivKey, opts?: _noble_curves_abstract_weierstrass.SignOpts) => _noble_curves_abstract_weierstrass.RecoveredSignatureType; verify: (signature: _noble_curves_abstract_utils.Hex | { r: bigint; s: bigint; }, msgHash: _noble_curves_abstract_utils.Hex, publicKey: _noble_curves_abstract_utils.Hex, opts?: _noble_curves_abstract_weierstrass.VerOpts) => boolean; ProjectivePoint: _noble_curves_abstract_weierstrass.ProjConstructor<bigint>; Signature: _noble_curves_abstract_weierstrass.SignatureConstructor; utils: { normPrivateKeyToScalar: (key: _noble_curves_abstract_utils.PrivKey) => bigint; isValidPrivateKey(privateKey: _noble_curves_abstract_utils.PrivKey): boolean; randomPrivateKey: () => Uint8Array; precompute: (windowSize?: number, point?: ProjPointType<bigint>) => ProjPointType<bigint>; }; }>; declare function BigIntToByteArray(int: BigInt): Uint8Array; declare function EncodeToBase64(data: Uint8Array | BigInt): string; declare function BigIntFromBase64(base64: string): bigint; declare function PointFromBase64(curve: SupportedCurves, base64: string): ProjPointType<bigint>; declare function UrlSafeBase64Encode(data: Uint8Array | bigint): string; declare function UrlSafeBase64Decode(data: string): Uint8Array; export { BigIntFromBase64, BigIntToByteArray, BytesToBigInt, CalculateCofactor, Client, type ClientAuthInit, type ClientAuthInitPrivate, type ClientAuthVerify, type ClientAuthVerifyPrivate, CompareTo, CurveMap, EncodeToBase64, GenerateKey, GenerateZKPGProvided, GetCurve, GetG, HMac, Hash, HighEntropyRandom, IntTo4Bytes, KeyTags, Keys, ModuloN, PointFromBase64, type RegisterOutput, type SchnorrZKP, type ServerAuthInit, type ServerAuthVerify, SupportedCurves, ToBytes, UrlSafeBase64Decode, UrlSafeBase64Encode, VerifyZKP };