BN_mod_sub

Compute r = (a - b) mod m.

Synopsis

Declared in <openssl/bn.h>

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

Return Value

1 on success, or 0 on error.

Parameters

NameDescription
rDestination BIGNUM.
aMinuend.
bSubtrahend.
mModulus (must be positive).
ctxOptional BN_CTX for temporaries, or NULL.