BN_consttime_swap

Conditionally swap the top nwords limbs (and top/neg) of two BIGNUMs in constant time.

Synopsis

Declared in <openssl/bn.h>

void
BN_consttime_swap(
    unsigned long swap,
    BIGNUM* a,
    BIGNUM* b,
    int nwords);

Parameters

NameDescription
swapNon-zero to swap, or zero to leave a and b unchanged (must be 0 or 1).
aFirst BIGNUM (must have at least nwords usable limbs).
bSecond BIGNUM (same size requirement as a).
nwordsNumber of limbs to exchange.