Fixed FPTAS and mask generation