BN_mod_add

Modular addition: r = (a + b) mod m with non-negative result.

Synopsis

Declared in <openssl/bn.h>

int
BN_mod_add(
    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.
aFirst addend.
bSecond addend.
mModulus.
ctxBN_CTX scratch space.