The European Court of Justice found that national legislation on mass surveillance of electronic communications for the purpose of fighting crime violated the right to privacy and the right to data protection.