A Unified Framework for Adversarial Attack and Defense in Constrained Feature Space