Synchronous sampling and clock recovery of internal oscillators for side channel analysis and fault injection