Avoid negations on unsigned values
This commit is contained in:
parent
7e06a6a991
commit
4ce2856a5d
@ -682,7 +682,7 @@ sodium_unpad(size_t *unpadded_buflen_p, const unsigned char *buf,
|
||||
is_barrier =
|
||||
(( (acc - 1U) & (pad_len - 1U) & ((c ^ 0x80) - 1U) ) >> 8) & 1U;
|
||||
acc |= c;
|
||||
pad_len |= (i & - is_barrier);
|
||||
pad_len |= i & (1U + ~is_barrier);
|
||||
valid |= (unsigned char) is_barrier;
|
||||
}
|
||||
*unpadded_buflen_p = padded_buflen - 1U - pad_len;
|
||||
|
Loading…
Reference in New Issue
Block a user