Skip to content

Commit 441c051

Browse files
committed
Added comment description of cmov_int16
1 parent 9b8d306 commit 441c051

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

ref/verify.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,17 @@ void cmov(uint8_t *r, const uint8_t *x, size_t len, uint8_t b)
5656
r[i] ^= b & (r[i] ^ x[i]);
5757
}
5858

59-
59+
/*************************************************
60+
* Name: cmov_int16
61+
*
62+
* Description: Copy input v to *r if b is 1, don't modify *r if b is 0.
63+
* Requires b to be in {0,1};
64+
* Runs in constant time.
65+
*
66+
* Arguments: int16_t *r: pointer to output int16_t
67+
* int16_t v: input int16_t
68+
* uint8_t b: Condition bit; has to be in {0,1}
69+
**************************************************/
6070
void cmov_int16(int16_t *r, int16_t v, uint16_t b)
6171
{
6272
b = -b;

0 commit comments

Comments
 (0)