UNPKG

@webarray/esphome-native-api

Version:

TypeScript/Node.js client for ESPHome native API with encryption and deep sleep support

51 lines 1.23 kB
/** * Noise Protocol Encryption for ESPHome Native API * Working implementation with proper state management * Implements Noise_NNpsk0_25519_ChaChaPoly_SHA256 */ export declare class NoiseEncryption { private encryptionKey; private handshakeState; sendCipher: any; receiveCipher: any; handshakeComplete: boolean; private initialized; constructor(encryptionKey: string); /** * Initialize the Noise handshake state */ initialize(): Promise<void>; /** * Create the first handshake message (e) */ createHandshakeMessage1(): Buffer; /** * Process the second handshake message (e, ee) */ processHandshakeMessage2(message: Buffer): void; /** * Encrypt a message */ encrypt(plaintext: Buffer): Buffer; /** * Decrypt a message */ decrypt(ciphertext: Buffer): Buffer; /** * Check if handshake is complete */ isHandshakeComplete(): boolean; /** * Check if initialized */ get isInitialized(): boolean; /** * Reset the encryption state */ reset(): void; /** * Clean up resources */ destroy(): void; } //# sourceMappingURL=noise-encryption.d.ts.map