Changed the SBox functions so they mask out any junk added from a widening typecast