When you perform FFT of 512 points, the signal must have exactly 512 values, If it has less, it must be zero-padded. Apparently the FFT function you are using does this automatically (Matlab does).
Then, if you perform IFFF of that, you get the data on which FFT was applied (i.e. zero-padded signal), whose 160 first samples are the original signal.
Regards