Divide m by d, writing quotient and/or remainder.

Synopsis

Declared in <openssl/bn.h>

int
BN_div(
    BIGNUM* dv,
    BIGNUM* rem,
    BIGNUM const* m,
    BIGNUM const* d,
    BN_CTX* ctx);

Return Value

1 on success, or 0 on error.

Parameters

Name

Description

dv

Receives the quotient, or NULL if not required.

rem

Receives the remainder, or NULL if not required.

m

Dividend.

d

Divisor (must be non‐zero).

ctx

BN_CTX scratch space.

Created with MrDocs