BN_mod_exp_simple

Compute modular exponentiation with a simple sliding-window algorithm: r = (a ^ p) mod m.

Synopsis

Declared in <openssl/bn.h>

int
BN_mod_exp_simple(
    BIGNUM* r,
    BIGNUM const* a,
    BIGNUM const* p,
    BIGNUM const* m,
    BN_CTX* ctx);

Return Value

1 on success, or 0 on error.

Parameters

NameDescription
rDestination for the result.
aBase.
pExponent.
mModulus.
ctxBN_CTX scratch space.