The "intelligence community" sponsors a lot of math and fundamental physics work in academia and the national labs. The grants are laundered through an intermediary, so you don't know who and in what agency is interested in the work. I think of that visible side as one way for them to keep their foot in the door, to check the pace of advances on the unclassified side.
But you're really asking about the classified "shadow" of that open work, which by definition is hard to measure. I think one easy yardstick is "how much a mathematician makes" versus the intelligence budget. This leads me to think that they can hire a lot of mathematicians.
And let's face it, the subject matter is really cool. There's a reason that mathematicians throughout history have been interested in coding. Now imagine someone paying them to do it.
A senior academic I knew (in the information theory area) consulted at the NSA for several summers. His work was done in a Faraday cage, and that's all he would say about it. He was top-notch in his field, and he wouldn't waste his summers with fools. I think that there are lots of similar stories.
My working belief is that, in certain areas, they are way, way ahead of the open state of the art. Like with Keyhole, or tapping fiber optic cables, etc. Not everywhere, but they don't have to be ahead everywhere, just in a few places.