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

Name

Description

a

First value; may be overwritten as a scratch during the gcd.

b

Second value (not modified).

ctx

BN_CTX scratch space.

Created with MrDocs