diff --git a/ref/verify.c b/ref/verify.c index 0fc007c4..4bcb1e5f 100644 --- a/ref/verify.c +++ b/ref/verify.c @@ -56,7 +56,17 @@ void cmov(uint8_t *r, const uint8_t *x, size_t len, uint8_t b) r[i] ^= b & (r[i] ^ x[i]); } - +/************************************************* +* Name: cmov_int16 +* +* Description: Copy input v to *r if b is 1, don't modify *r if b is 0. +* Requires b to be in {0,1}; +* Runs in constant time. +* +* Arguments: int16_t *r: pointer to output int16_t +* int16_t v: input int16_t +* uint8_t b: Condition bit; has to be in {0,1} +**************************************************/ void cmov_int16(int16_t *r, int16_t v, uint16_t b) { b = -b;