import { type Address } from 'viem'; /** * Parse a DER-encoded ECDSA signature into r and s components. * * DER format: 0x30 0x02 0x02 */ export declare function parseDerSignature(der: Uint8Array): { r: Uint8Array; s: Uint8Array; }; /** * Parse a DER-encoded SPKI public key to extract the uncompressed secp256k1 point (65 bytes). * * SPKI structure for secp256k1: * SEQUENCE { * SEQUENCE { OID ecPublicKey, OID secp256k1 } * BIT STRING { 0x00 (unused bits) 0x04 } * } */ export declare function parseDerPublicKey(der: Uint8Array): Uint8Array; /** * Apply EIP-2 low-s normalization. * If s > secp256k1n/2, replace s with secp256k1n - s. */ export declare function normalizeSignature(r: Uint8Array, s: Uint8Array): { r: Uint8Array; s: Uint8Array; }; /** * Resolve the recovery parameter (yParity) by trying 0 and 1, * then comparing the recovered address against the expected address. * Uses viem's recoverAddress internally. */ export declare function resolveRecoveryParam(digest: Uint8Array, r: Uint8Array, s: Uint8Array, address: Address): Promise; /** * Derive Ethereum address from an uncompressed secp256k1 public key (65 bytes). * address = keccak256(pubkey[1:])[12:] */ export declare function publicToAddress(pubkey: Uint8Array): Address; /** Convert a Uint8Array to a BigInt */ export declare function bytesToBigInt(bytes: Uint8Array): bigint; /** Convert a BigInt to a 32-byte Uint8Array */ export declare function bigIntTo32Bytes(value: bigint): Uint8Array;