ct/cmp: make it generic by taking void pointers
This commit is contained in:
parent
546649da1d
commit
91f9176279
7
ct.c
7
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++;
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user