Aftab: a risc-v implementation with configurable gateways for security