Skip to content

Commit

Permalink
Added comment description of cmov_int16
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptojedi committed Jun 3, 2024
1 parent 9b8d306 commit 441c051
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion ref/verify.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)

This comment has been minimized.

Copy link
@cole-h

cole-h Jun 4, 2024

Please forgive me if I'm totally misunderstanding (I am way out of my depth here), but it seems like b is actually a uint16_t, not a uint8_t as the comment suggests? (If it's intended to be uint16_t, then I'd suggest updating the comment; otherwise, I'd suggest updating the argument type.)

{
b = -b;
Expand Down

0 comments on commit 441c051

Please sign in to comment.