FreeRTOS-Plus/ThirdParty/WolfSSL-FIPS-Ready/wolfcrypt/src/fe_448.c
/* Constant time, conditional move of b into a.
 * a is not changed if the condition is 0.
 *
 * a  A field element.
 * b  A field element.
 * c  If 1 then copy and if 0 then don't copy.
 */
Constant time, conditional move of b into a.
a is not changed if the condition is 0.

a  A field element.
b  A field element.
c  If 1 then copy and if 0 then don't copy.
Constant time conditional move of b into a . a is not changed if the condition is 0 . a A field element . b A field element . c If 1 then copy and if 0 then don ' t copy .
void fe448_cmov(uint8_t* a, const uint8_t* b, int c)
{
    int i;
    uint8_t m = -(uint8_t)c;
    uint8_t t[56];
    for (i = 0; i < 56; i++)
        t[i] = m & (a[i] ^ b[i]);
    for (i = 0; i < 56; i++)
        a[i] ^= t[i];
}
void fe448_cmov ( uint8_t * a , const uint8_t * b , int c ) { int i ; uint8_t m = - ( uint8_t ) c ; uint8_t t [ 56 ] ; for ( i = 0 ; i < 56 ; i ++ ) t [ i ] = m & ( a [ i ] ^ b [ i ] ) ; for ( i = 0 ; i < 56 ; i ++ ) a [ i ] ^= t [ i ] ; }
Constant time, conditional move of b into a.
 a is not changed if the condition is 0.
Constant time conditional move of b into a . a is not changed if the condition is 0 .