I'm confused. If iCloud backups are not encrypted [1], and this only scans iCloud photos, why can't they just do this server side? I'm not saying server-side is OK, but its at least not device side (which is obviously a slippery slope).
[1] https://www.reuters.com/article/us-apple-fbi-icloud-exclusiv...