BN_gcd

Compute the greatest common divisor of a and b.

Synopsis

Declared in <openssl/bn.h>

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

Return Value

1 on success, or 0 on error.

Parameters

NameDescription
rDestination for gcd(|a|, |b|).
aFirst value.
bSecond value.
ctxBN_CTX scratch space.