Unsigned math is required to calculate the current alignment.
Signed-off-by: Doug Nazar <nazard@nazar.ca>
int enc)
{
struct nettle_cipher_ctx *ctx;
- ptrdiff_t cur_alignment;
+ uintptr_t cur_alignment;
int idx = -1;
unsigned i;
uint8_t *ctx_ptr;
ctx->enc = enc;
ctx_ptr = ((uint8_t*)ctx) + sizeof(*ctx);
- cur_alignment = ((ptrdiff_t)ctx_ptr) % 16;
+ cur_alignment = ((uintptr_t)ctx_ptr) % 16;
if (cur_alignment > 0)
ctx_ptr += 16 - cur_alignment;