  Given a linear code $\mathcal{C}$, its square code $\mathcal{C}^{(2)}$ is the
span of all component-wise products of two elements of $\mathcal{C}$. Motivated
by applications in multi-party computation, our purpose with this work is to
answer the following question: which families of affine variety codes have
simultaneously high dimension $k(\mathcal{C})$ and high minimum distance of
$\mathcal{C}^{(2)}$, $d(\mathcal{C}^{(2)})$? More precisely, given a designed
minimum distance $d$ we compute an affine variety code $\mathcal{C}$ such that
$d(\mathcal{C}^{(2)})\geq d$ and that the dimension of $\mathcal{C}$ is high.
The best construction that we propose comes from hyperbolic codes when $d\ge q$
and from weighted Reed-Muller codes otherwise.
