Those were the factory horsepower ratings. The stock 340 was factory-rated at 275, but in fact put out more. And then the stock-class racers started reworking them with their magic so they were putting out much more than the factory rating.
And back then there was a lot of "creativity" - cheating, only if you got caught - going on with the entire car, not just the engines.