import { Bytes } from "@zwave-js/shared";
class NoiseDecryptTransformer {
    receiveCipher;
    constructor(receiveCipher) {
        this.receiveCipher = receiveCipher;
    }
    // transform() is called sequentially by the stream API,
    // which ensures nonce synchronization without needing a processingQueue
    async transform(chunk, controller) {
        // Decrypt the payload
        const decrypted = await this.receiveCipher.decryptWithAd(new Bytes(0), chunk);
        controller.enqueue(decrypted);
    }
}
/**
 * Transform stream that decrypts Noise frame payloads.
 * Input: Encrypted Noise frame payloads
 * Output: Decrypted data
 *
 * Requires cipher state from completed handshake.
 * The transform() method is called sequentially by the stream API,
 * which ensures nonce synchronization without needing a processingQueue.
 */
export class NoiseDecryptTransform extends TransformStream {
    constructor(receiveCipher) {
        super(new NoiseDecryptTransformer(receiveCipher));
    }
}
//# sourceMappingURL=NoiseDecryptTransform.js.map