import { TEth } from '../models/TEth'; interface ICrypto { randomBytes(size: number): Uint8Array; randomUUID(): `${string}-${string}-${string}-${string}-${string}`; createECDH(curve: string): any; sha256(mix: string | TEth.Hex | Uint8Array): Promise; encrypt(buffer: string | TEth.Hex | Uint8Array, opts: IEncryptionParams & { encoding?: undefined | 'binary'; }): Promise; encrypt(buffer: string | TEth.Hex | Uint8Array, opts: IEncryptionParams & { encoding: 'hex'; }): Promise; encrypt(buffer: string | TEth.Hex | Uint8Array, opts: IEncryptionParams & { encoding: 'utf8'; }): Promise; decrypt(buffer: TEth.Hex | Uint8Array, opts: IEncryptionParams & { encoding?: undefined | 'binary'; }): Promise; decrypt(buffer: TEth.Hex | Uint8Array, opts: IEncryptionParams & { encoding: 'hex'; }): Promise; decrypt(buffer: TEth.Hex | Uint8Array, opts: IEncryptionParams & { encoding: 'utf8'; }): Promise; } interface IEncryptionParams { secret: string | Uint8Array; encoding?: 'binary' | 'hex' | 'utf8'; } declare abstract class CryptoBase implements ICrypto { abstract randomBytes(size: number): Uint8Array; abstract randomUUID(): `${string}-${string}-${string}-${string}-${string}`; abstract createECDH(curve: string): any; sha256(mix: string | TEth.Hex | Uint8Array, opts?: { encoding?: undefined | 'binary'; }): Promise; sha256(mix: string | TEth.Hex | Uint8Array, opts?: { encoding: 'hex'; }): Promise; encrypt(mix: string | TEth.Hex | Uint8Array, opts: IEncryptionParams & { encoding?: undefined | 'binary'; }): Promise; encrypt(mix: string | TEth.Hex | Uint8Array, opts: IEncryptionParams & { encoding: 'hex'; }): Promise; encrypt(mix: string | TEth.Hex | Uint8Array, opts: IEncryptionParams & { encoding: 'utf8'; }): Promise; decrypt(buffer: TEth.Hex | Uint8Array, opts: IEncryptionParams & { encoding?: undefined | 'binary'; }): Promise; decrypt(buffer: TEth.Hex | Uint8Array, opts: IEncryptionParams & { encoding: 'hex'; }): Promise; decrypt(buffer: TEth.Hex | Uint8Array, opts: IEncryptionParams & { encoding: 'utf8'; }): Promise; protected abstract encryptInner(buffer: Uint8Array, secret: Uint8Array): Promise; protected abstract decryptInner(buffer: Uint8Array, secret: Uint8Array): Promise; protected abstract sha256Inner(buffer: Uint8Array): Promise; private prepareSecret; } declare namespace WebCryptoImpl { class CryptoWeb extends CryptoBase { crypto: Crypto; randomBytes(size: number): Uint8Array; randomUUID(): `${string}-${string}-${string}-${string}-${string}`; createECDH(curve: string): void; encryptInner(buffer: Uint8Array, secret: Uint8Array): Promise; decryptInner(buffer: Uint8Array, secret: Uint8Array): Promise; private _getEncryptionKey; protected sha256Inner(buffer: Uint8Array): Promise; } } declare namespace NodeCryptoImpl { class CryptoNode extends CryptoBase { crypto: typeof import('crypto'); randomBytes(size: number): Buffer; randomUUID(): `${string}-${string}-${string}-${string}-${string}`; createECDH(curve: string): import("crypto").ECDH; protected encryptInner(buffer: Uint8Array, secret: Uint8Array): Promise; protected decryptInner(buffer: Uint8Array, secret: Uint8Array): Promise; protected sha256Inner(buffer: Uint8Array): Promise; } } export declare const $crypto: ICrypto; export declare const $cryptoImpl: { Web: typeof WebCryptoImpl.CryptoWeb; Node: typeof NodeCryptoImpl.CryptoNode; }; export {};