Linear and Circular Convolution in Fourier Domain (DFT) Suppose we have two vectors A and B of length 100 and 80 obtained as a function of time. If we wish to perform convolution of the two vectors in the Fourier domain, we need to multiply the Fourier transforms of A and B. For that purpose, the length of B must be the same as A. The output would be of the same length as A or B after zero padding.


Where should we do zero padding in B, should this be at the beginning of B or at the end of B? 
I was reading that convolution achieved via FFT is essentially a circular one. If our desire is to get a linear convolution, how do we ensure that the output is a linear convolution, i.e., how many end points should be rejected from both ends after inverse FFT?
the following matlab/octave code gives the linear convolution result using frequency domain :

A = ((-1).^[0:79]').*hamming(80);    % input one
B = blackman(100);   % input two

C1 = conv(A,B);     % A * B (convolution) in time domain
C2 = real( ifft( fft(A,179).*fft(B,179) ) ); % convolution using freq domain


The output will be identical of length 179 samples: