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

Name

Description

r

Destination for gcd(|a|, |b|).

a

First value.

b

Second value.

ctx

BN_CTX scratch space.

Created with MrDocs