padding and bitfipping