(a) In a prosecution under AS 11.41.434 - 11.41.440 it is an affirmative defense that, at the time of the alleged offense, the victim was the legal spouse of the defendant unless the offense was committed without the consent of the victim.
(b) In a prosecution under AS 11.41.410 - 11.41.440, whenever a provision of law defining an offense depends upon a victim's being under a certain age, it is an affirmative defense that, at the time of the alleged offense, the defendant
(1) reasonably believed the victim to be that age or older; and
(2) undertook reasonable measures to verify that the victim was that age or older.