breaking out some redundant implementations (rotl, rotr) into a common
set of functions