BN_are_coprime

Test whether a and b are coprime (gcd == 1), possibly mutating a.

Synopsis

Declared in <openssl/bn.h>

int
BN_are_coprime(
    BIGNUM* a,
    BIGNUM const* b,
    BN_CTX* ctx);

Return Value

1 if gcd(|a|,|b|) == 1, 0 if not coprime, or a negative value on error.

Parameters

NameDescription
aFirst value; may be overwritten as a scratch during the gcd.
bSecond value (not modified).
ctxBN_CTX scratch space.