Harnessing On-Chip Error Correction For Energy Efficiency And Security