Chernoff's theorem in the branching random walk