Yeah. If you consider "Congress" (who can declare war) and "Executive Branch" (the organization that does the spying) are the same "organization"... sure.
For the most part, the US Government is composed of very many different organizations who are specifically designed to not work together very well.
It's rather convenient that the same organization that spies on "enemies" also gets to define what an "enemy" is.