diff --git a/ct.c b/ct.c index 3dd6e43..047a448 100644 --- a/ct.c +++ b/ct.c @@ -18,10 +18,13 @@ uint32_t -lc_ct_cmp(const uint8_t *x, const uint8_t *y, size_t l) +lc_ct_cmp(const void *px, const void *py, size_t l) { - uint32_t r = 0; + const unsigned char *x, *y; + unsigned char r = 0; + x = px; + y = py; for (; l > 0; l--) r |= *x++ ^ *y++; diff --git a/lilcrypto.h b/lilcrypto.h index b68d8fe..f811e2d 100644 --- a/lilcrypto.h +++ b/lilcrypto.h @@ -146,7 +146,7 @@ struct lc_hkdf_params { /* Constant-time operations */ -uint32_t lc_ct_cmp(const uint8_t *, const uint8_t *, size_t); +uint32_t lc_ct_cmp(const void *, const void *, size_t); uint32_t lc_ct_mask32(uint32_t);