Did a slave have a last name if so was it their owners last name?

When the slaves were freed, some chose their former owner's last name, and some chose different last names, but they had no last names before then.