Definability on finite structures and the existence of one-way functions