Pad and unpad in constant(ish) time.