The FLASH fast machine protection includes a beam loss interlock using toroids to measure the beam charge. This system monitors the beam losses across the whole linac while other protection systems are specifically dedicated to critical components. Four protection modes are used to handle different scenarios of losses: charge validation, single bunch, slice and integration modes. This system is based on 4 ADC’s to sample the top and bottom of upstream and downstream toroid signals. A microcontroller drives 2 programmable delay generators to adjust the top and bottom ADC trigger during the calibration phase. Then, the samples are collected by a 200Kgates FPGA to process the various protection modes. At first, a VHDL testbench was developed to generate test vectors at the FPGA design inputs. Then, an electronic testbench simulates the linac signals to validate the global hardware functions. Finally, the toroid protection was tested on FLASH with macropulses of up to 800 bunches and bunch repetition rates of up to 1 MHz.