Ex-SAS author Andy McNab dismissed army leaks about the Duke of Cambridge and Prince Harry as "nonsense" and "waffle" in the trial of The Sun's royal editor.
Duncan Larcombe (pictured, Reuters), 39, is accused over his dealings with Sandhurst instructor John Hardy who was allegedly paid more than £23,700 for providing information on the princes and others on 34 occasions.
Giving evidence for Larcombe's defence, McNab said the only thing that would have mattered to the Ministry of Defence was national security.
The rest was "trivial" compared with the task of training young men and women to fight in two war zones, he said.
He told the Old Bailey trial: "You are training young men and women to go and fight – you are putting a bayonet in their hand and sending them to basically stab them to death.
"These sorts of things are just seen as trivial. They are dealt with at unit level. If there's money changed hands, then his pay would be stopped and that money would be going to some charity.
"He would be gripped and given extra duties. It's all part of what's called the tribal system."
He added: "It's nothing, it's nonsense, it's just waffle and it makes the military look good in the context of these stories because it shows the princes are not getting special treatment."
Under cross-examination by prosecutor Mark Bryant-Heron QC, McNab was asked if leaks were unhelpful to morale.
He replied: "I don't think they care. I think with the 24-hour news, the incestuous nature of the media and MoD, I don't think they care.
"The one thing they would care about is national security which would not be a problem because of the system of everything going back to the MoD.
"If the leak involved national security it would be very severe. We are talking about young men and women in the field being put at risk but in my experience that would never happen. The safety net is the journalist will go back to the MoD."
He added that he would not have come to court to be a witness for the ex-defence editor Larcombe if it had involved a risk to national security.
Larcombe is charged with aiding, abetting, counselling and procuring former colour sergeant Hardy in the offence of misconduct in a public office between 9 February 2006 and 16 October 2008.
The pair are in the dock alongside Claire Hardy who is charged with aiding and abetting Hardy.
The Sun chief reporter John Kay, executive editor Fergus Shanahan and deputy editor Geoffrey Webster, are charged with conspiring with each other and MoD official Bettina Jordan-Barber to commit misconduct in a public office between 1 January 2004 and 31 January 2012.
Webster also faces a second count of conspiracy to commit misconduct with a serving officer in the armed forces between 3 November and 6 November 2010.
Kay, 71, of Golders Green, north London, Larcombe, 39, of Aylesford, Kent, Webster, 55, of Goudhurst, Kent, Shanahan, 59, of Felsted, Essex, and John Hardy, 44, and Claire Hardy, 41, of Accrington, Lancashire, deny the charges against them.
The trial was adjourned until Monday.