Twitter is suing the US government over restrictions on what it can say publicly about the surveillance of its users.