/** * Society Protocol - WASM Crypto Wrapper * * High-performance cryptographic operations using Rust/WASM. * Falls back to JavaScript implementation if WASM not available. */ import { KeyPair, EncryptedMessage } from './wasm/society_crypto.js'; /** * Initialize WASM module */ export declare function initializeWasm(): Promise; /** * Check if WASM is available */ export declare function isWasmAvailable(): boolean; /** * WASM-based Crypto Engine * 10-50x faster than JavaScript implementation */ export declare class WasmCryptoEngine { /** * Generate Ed25519 keypair */ static generateKeypair(): { publicKey: Uint8Array; privateKey: Uint8Array; }; /** * Sign message with Ed25519 */ static sign(message: Uint8Array, privateKey: Uint8Array): Uint8Array; /** * Verify Ed25519 signature */ static verify(message: Uint8Array, signature: Uint8Array, publicKey: Uint8Array): boolean; /** * Encrypt with X25519 + AES-256-GCM */ static encrypt(plaintext: Uint8Array, publicKey: Uint8Array): EncryptedMessage; /** * Decrypt with X25519 + AES-256-GCM */ static decrypt(encrypted: EncryptedMessage, privateKey: Uint8Array): Uint8Array; /** * SHA-256 hash */ static sha256(data: Uint8Array): Uint8Array; /** * Generate random bytes */ static randomBytes(length: number): Uint8Array; /** * Benchmark signing performance * Returns average ms per operation */ static benchmarkSign(iterations?: number): number; } /** * Hybrid Crypto Engine * Uses WASM when available, falls back to JS */ export declare class HybridCryptoEngine { private useWasm; constructor(useWasm?: boolean); /** * Generate keypair */ generateKeypair(): Promise<{ publicKey: Uint8Array; privateKey: Uint8Array; }>; /** * Sign message */ sign(message: Uint8Array, privateKey: Uint8Array): Promise; /** * Verify signature */ verify(message: Uint8Array, signature: Uint8Array, publicKey: Uint8Array): Promise; /** * Encrypt message */ encrypt(plaintext: Uint8Array, publicKey: Uint8Array): Promise; /** * Decrypt message */ decrypt(encrypted: any, privateKey: Uint8Array): Promise; /** * SHA-256 hash */ sha256(data: Uint8Array): Promise; private generateKeypairJS; private signJS; private verifyJS; private encryptJS; private decryptJS; private sha256JS; } export { KeyPair, EncryptedMessage }; //# sourceMappingURL=crypto-wasm.d.ts.map