*R^-1.</p>

<p>BN_to_montgomery() computes Mont(<i>a</i>,R^2), i.e. <i>a</i>*R. Note that <i>a</i> must be nonnegative and smaller than the modulus.</p>

<p>For all functions, <i>ctx</i> is a previously allocated <b>BN_CTX</b> used for temporary variables.</p>

<h1 id="RETURN-VALUES">RETURN VALUES</h1>

<p>BN_MONT_CTX_new() returns the newly allocated <b>BN_MONT_CTX</b>, and NULL on error.</p>

<p>BN_MONT_CTX_free() has no return value.</p>

<p>For the other functions, 1 is returned for success, 0 on error.