One pitfall of this problem is that when you left-shift \(m\) for 2 bytes to compute \(m_2\), you have to be careful of overflow. A reference solution is here.