BN_reciprocal

Compute a reciprocal r = 2^len / m for BN_div-style quotient estimation.

Synopsis

Declared in <openssl/bn.h>

int
BN_reciprocal(
    BIGNUM* r,
    BIGNUM const* m,
    int len,
    BN_CTX* ctx);

Return Value

len on success, or -1 on error.

Parameters

NameDescription
rDestination reciprocal.
mDivisor.
lenBit precision of the reciprocal.
ctxBN_CTX scratch space.