static int rsa_blinding_convert(BN_BLINDING *b, BIGNUM *f, BIGNUM *unblind,
	BN_CTX *ctx)
	{
	if (unblind == NULL)
		/* Local blinding: store the unblinding factor
		 * in BN_BLINDING. */
		return BN_BLINDING_convert_ex(f, NULL, b, ctx);
	else
		{
		/* Shared blinding: store the unblinding factor
		 * outside BN_BLINDING. */
		int ret;
		CRYPTO_w_lock(CRYPTO_LOCK_RSA_BLINDING);
		ret = BN_BLINDING_convert_ex(f, unblind, b, ctx);
		CRYPTO_w_unlock(CRYPTO_LOCK_RSA_BLINDING);
		return ret;
		}
	}