The e=3 and e=65537 implementations are nearly identical, refactor them down into one. Change-Id: I537a368a6cc195f373b9354d7472957fd683beea