BN_to_montgomery

Convert a into the Montgomery domain for modulus mont.

Synopsis

Declared in <openssl/bn.h>

int
BN_to_montgomery(
    BIGNUM* r,
    BIGNUM const* a,
    BN_MONT_CTX* mont,
    BN_CTX* ctx);

Return Value

1 on success, or 0 on error.

Parameters

NameDescription
rDestination for aR mod m.
aValue to convert (typically reduced modulo m).
montMontgomery context initialized for modulus m.
ctxBN_CTX for temporary storage.