///
import type { OutputFormat, Output, StrictUint8Array } from './types'
export type MessageHashType = 'sha256' | 'keccak256' | 'sha3-256'
export type ExtraEntropy = true | null | StrictUint8Array
export type SchnorrExtraEntropy = StrictUint8Array | null
export function privateKeyIsValid(options: { privateKey: StrictUint8Array }): boolean
export function privateKeyToPublicKey(options: {
privateKey: StrictUint8Array
compressed?: boolean
format?: F
}): Output
export function publicKeyIsValid(options: {
publicKey: StrictUint8Array
compressed?: boolean
}): boolean
export function publicKeyConvert(options: {
publicKey: StrictUint8Array
compressed: boolean
format?: F
}): Output
export function publicKeyToX(options: {
publicKey: StrictUint8Array
format?: F
}): Output
export function xOnlyIsValid(options: { xOnly: StrictUint8Array }): boolean
export function privateKeyTweakAdd(options: {
privateKey: StrictUint8Array
tweak: StrictUint8Array
format?: F
}): Output
export function privateKeyTweakSubtract(options: {
privateKey: StrictUint8Array
tweak: StrictUint8Array
format?: F
}): Output
export function privateKeyTweakNegate(options: {
privateKey: StrictUint8Array
format?: F
}): Output
export function publicKeyTweakAddPoint(options: {
publicKey: StrictUint8Array
tweakPoint: StrictUint8Array
compressed?: boolean
format?: F
}): Output
export function publicKeyTweakAddScalar(options: {
publicKey: StrictUint8Array
tweak: StrictUint8Array
compressed?: boolean
format?: F
}): Output
export function publicKeyTweakMultiply(options: {
publicKey: StrictUint8Array
tweak: StrictUint8Array
compressed?: boolean
format?: F
}): Output
export function xOnlyTweakAdd(options: {
xOnly: StrictUint8Array
tweak: StrictUint8Array
compressed?: boolean
format?: F
}): Output
export interface EcdsaSignatureWithRecovery {
signature: Output
recovery: number
}
export function ecdsaSignHash<
F extends OutputFormat = 'uint8',
R extends boolean = false,
>(options: {
hash: StrictUint8Array
privateKey: StrictUint8Array
extraEntropy?: ExtraEntropy
der?: boolean
recovery?: R
format?: F
}): Promise : Output>
export function ecdsaSignHashSync<
F extends OutputFormat = 'uint8',
R extends boolean = false,
>(options: {
hash: StrictUint8Array
privateKey: StrictUint8Array
extraEntropy?: ExtraEntropy
der?: boolean
recovery?: R
format?: F
}): R extends true ? EcdsaSignatureWithRecovery : Output
export function ecdsaVerifyHash(options: {
signature: StrictUint8Array
hash: StrictUint8Array
publicKey: StrictUint8Array
}): Promise
export function ecdsaVerifyHashSync(options: {
signature: StrictUint8Array
hash: StrictUint8Array
publicKey: StrictUint8Array
}): boolean
export function ecdsaSignMessage<
F extends OutputFormat = 'uint8',
R extends boolean = false,
>(options: {
message: StrictUint8Array
hashType?: MessageHashType
privateKey: StrictUint8Array
extraEntropy?: ExtraEntropy
der?: boolean
recovery?: R
format?: F
}): Promise : Output>
export function ecdsaSignMessageSync<
F extends OutputFormat = 'uint8',
R extends boolean = false,
>(options: {
message: StrictUint8Array
hashType?: MessageHashType
privateKey: StrictUint8Array
extraEntropy?: ExtraEntropy
der?: boolean
recovery?: R
format?: F
}): R extends true ? EcdsaSignatureWithRecovery : Output
export function ecdsaVerifyMessage(options: {
message: StrictUint8Array
hashType?: MessageHashType
signature: StrictUint8Array
publicKey: StrictUint8Array
}): Promise
export function ecdsaVerifyMessageSync(options: {
message: StrictUint8Array
hashType?: MessageHashType
signature: StrictUint8Array
publicKey: StrictUint8Array
}): boolean
export function schnorrSign(options: {
data: StrictUint8Array
privateKey: StrictUint8Array
extraEntropy?: SchnorrExtraEntropy
format?: F
}): Promise