That's a hair away from undefined behavior: accessing the same object as two different types only works if one of them is array of char/unsigned char (and for a few other exceptions).
I would explicitly write reinterpret_cast<unsignedchar*> to make it clear to the reader that the code is well-defined.