Islamic State said on Tuesday that it was behind Sunday’s attack on an Algerian military barracks near the country’s border with Mali that killed one soldier.