Commit 2f9c99e8 by Juliusz Chroboczek

Make masking more clear in mask_prefix.

1 parent 8ee8d193
Showing 1 changed file with 2 additions and 1 deletions
......@@ -210,7 +210,8 @@ mask_prefix(unsigned char *restrict ret,
memset(ret, 0, 16);
memcpy(ret, prefix, plen / 8);
if(plen % 8 != 0)
ret[plen / 8] = (prefix[plen / 8] & (0xFF << (8 - (plen % 8))));
ret[plen / 8] =
(prefix[plen / 8] & ((0xFF << (8 - (plen % 8))) & 0xFF));
return ret;
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!