# Magnetic vector potential within an infinite wire

I was trying to calculate the magnetic vector potential created by a wire (radius $R$) with uniform $\mathbf J$. By taking $\mathbf A=A(s) \mathbf{\hat z}$, I found out that $$\mathbf A=-\frac{\mu_0I}{2\pi}\ln{s\over a}\mathbf{\hat z}$$ ($s$ is the distance from the wire and $a$ is an arbitrary constant) works for $s\ge R$. I know I can do the same thing for $s\le R$ but I tried a different method. I thought in this case the potential will be the same as that produced by the middle part of the wire with radius $s$ since the part beyond $s$ produces no magnetic field at that point. The total current will then be $\frac{Is^2}{R^2}$. Putting this in the formula above gives $$\mathbf A=-\frac{\mu_0Is^2}{2\pi R^2}\ln{s\over a}\mathbf{\hat z},$$ which doesn't give the right magnetic field. Why would this not work?

$$\oint \vec{A}\cdot d\vec{l} = \int \vec{B}\cdot d\vec{S} = \Phi_{\rm enclosed}$$
Inside the wire, the B-field grows linearly with radius $s$ so the enclosed magnetic flux on the RHS grows as $s^3$. Meanwhile, the line integral of $\vec{A}$ on the LHS is just $2\pi s A$.
Thus you expect $A \propto s^2$.