int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
{
    int i, nw, lb, rb;
    BN_ULONG *t, *f;
    BN_ULONG l;
    bn_check_top(r);
    bn_check_top(a);
    if (n < 0) {
        BNerr(BN_F_BN_LSHIFT, BN_R_INVALID_SHIFT);
        return 0;
    }
    r->neg = a->neg;
    nw = n / BN_BITS2;
    if (bn_wexpand(r, a->top + nw + 1) == NULL)
        return (0);
    lb = n % BN_BITS2;
    rb = BN_BITS2 - lb;
    f = a->d;
    t = r->d;
    t[a->top + nw] = 0;
    if (lb == 0)
        for (i = a->top - 1; i >= 0; i--)
            t[nw + i] = f[i];
    else
        for (i = a->top - 1; i >= 0; i--) {
            l = f[i];
            t[nw + i + 1] |= (l >> rb) & BN_MASK2;
            t[nw + i] = (l << lb) & BN_MASK2;
        }
    memset(t, 0, sizeof(*t) * nw);
    r->top = a->top + nw + 1;
    bn_correct_top(r);
    bn_check_top(r);
    return (1);
}
['static int old_ec_priv_decode(EVP_PKEY *pkey,\n                              const unsigned char **pder, int derlen)\n{\n    EC_KEY *ec;\n    if ((ec = d2i_ECPrivateKey(NULL, pder, derlen)) == NULL) {\n        ECerr(EC_F_OLD_EC_PRIV_DECODE, EC_R_DECODE_ERROR);\n        return 0;\n    }\n    EVP_PKEY_assign_EC_KEY(pkey, ec);\n    return 1;\n}', 'EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, long len)\n{\n    EC_KEY *ret = NULL;\n    EC_PRIVATEKEY *priv_key = NULL;\n    const unsigned char *p = *in;\n    if ((priv_key = d2i_EC_PRIVATEKEY(NULL, &p, len)) == NULL) {\n        ECerr(EC_F_D2I_ECPRIVATEKEY, ERR_R_EC_LIB);\n        return NULL;\n    }\n    if (a == NULL || *a == NULL) {\n        if ((ret = EC_KEY_new()) == NULL) {\n            ECerr(EC_F_D2I_ECPRIVATEKEY, ERR_R_MALLOC_FAILURE);\n            goto err;\n        }\n    } else\n        ret = *a;\n    if (priv_key->parameters) {\n        EC_GROUP_clear_free(ret->group);\n        ret->group = EC_GROUP_new_from_ecpkparameters(priv_key->parameters);\n    }\n    if (ret->group == NULL) {\n        ECerr(EC_F_D2I_ECPRIVATEKEY, ERR_R_EC_LIB);\n        goto err;\n    }\n    ret->version = priv_key->version;\n    if (priv_key->privateKey) {\n        ASN1_OCTET_STRING *pkey = priv_key->privateKey;\n        if (EC_KEY_oct2priv(ret, ASN1_STRING_get0_data(pkey),\n                            ASN1_STRING_length(pkey)) == 0)\n            goto err;\n    } else {\n        ECerr(EC_F_D2I_ECPRIVATEKEY, EC_R_MISSING_PRIVATE_KEY);\n        goto err;\n    }\n    EC_POINT_clear_free(ret->pub_key);\n    ret->pub_key = EC_POINT_new(ret->group);\n    if (ret->pub_key == NULL) {\n        ECerr(EC_F_D2I_ECPRIVATEKEY, ERR_R_EC_LIB);\n        goto err;\n    }\n    if (priv_key->publicKey) {\n        const unsigned char *pub_oct;\n        int pub_oct_len;\n        pub_oct = ASN1_STRING_get0_data(priv_key->publicKey);\n        pub_oct_len = ASN1_STRING_length(priv_key->publicKey);\n        if (!EC_KEY_oct2key(ret, pub_oct, pub_oct_len, NULL)) {\n            ECerr(EC_F_D2I_ECPRIVATEKEY, ERR_R_EC_LIB);\n            goto err;\n        }\n    } else {\n        if (ret->group->meth->keygenpub == NULL\n            || ret->group->meth->keygenpub(ret) == 0)\n                goto err;\n        ret->enc_flag |= EC_PKEY_NO_PUBKEY;\n    }\n    if (a)\n        *a = ret;\n    EC_PRIVATEKEY_free(priv_key);\n    *in = p;\n    return (ret);\n err:\n    if (a == NULL || *a != ret)\n        EC_KEY_free(ret);\n    EC_PRIVATEKEY_free(priv_key);\n    return NULL;\n}', 'int EC_KEY_oct2key(EC_KEY *key, const unsigned char *buf, size_t len,\n                   BN_CTX *ctx)\n{\n    if (key == NULL || key->group == NULL)\n        return 0;\n    if (key->pub_key == NULL)\n        key->pub_key = EC_POINT_new(key->group);\n    if (key->pub_key == NULL)\n        return 0;\n    if (EC_POINT_oct2point(key->group, key->pub_key, buf, len, ctx) == 0)\n        return 0;\n    if ((key->group->meth->flags & EC_FLAGS_CUSTOM_CURVE) == 0)\n        key->conv_form = (point_conversion_form_t)(buf[0] & ~0x01);\n    return 1;\n}', 'int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *point,\n                       const unsigned char *buf, size_t len, BN_CTX *ctx)\n{\n    if (group->meth->oct2point == 0\n        && !(group->meth->flags & EC_FLAGS_DEFAULT_OCT)) {\n        ECerr(EC_F_EC_POINT_OCT2POINT, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);\n        return 0;\n    }\n    if (group->meth != point->meth) {\n        ECerr(EC_F_EC_POINT_OCT2POINT, EC_R_INCOMPATIBLE_OBJECTS);\n        return 0;\n    }\n    if (group->meth->flags & EC_FLAGS_DEFAULT_OCT) {\n        if (group->meth->field_type == NID_X9_62_prime_field)\n            return ec_GFp_simple_oct2point(group, point, buf, len, ctx);\n        else\n#ifdef OPENSSL_NO_EC2M\n        {\n            ECerr(EC_F_EC_POINT_OCT2POINT, EC_R_GF2M_NOT_SUPPORTED);\n            return 0;\n        }\n#else\n            return ec_GF2m_simple_oct2point(group, point, buf, len, ctx);\n#endif\n    }\n    return group->meth->oct2point(group, point, buf, len, ctx);\n}', 'int ec_GF2m_simple_oct2point(const EC_GROUP *group, EC_POINT *point,\n                             const unsigned char *buf, size_t len,\n                             BN_CTX *ctx)\n{\n    point_conversion_form_t form;\n    int y_bit;\n    BN_CTX *new_ctx = NULL;\n    BIGNUM *x, *y, *yxi;\n    size_t field_len, enc_len;\n    int ret = 0;\n    if (len == 0) {\n        ECerr(EC_F_EC_GF2M_SIMPLE_OCT2POINT, EC_R_BUFFER_TOO_SMALL);\n        return 0;\n    }\n    form = buf[0];\n    y_bit = form & 1;\n    form = form & ~1U;\n    if ((form != 0) && (form != POINT_CONVERSION_COMPRESSED)\n        && (form != POINT_CONVERSION_UNCOMPRESSED)\n        && (form != POINT_CONVERSION_HYBRID)) {\n        ECerr(EC_F_EC_GF2M_SIMPLE_OCT2POINT, EC_R_INVALID_ENCODING);\n        return 0;\n    }\n    if ((form == 0 || form == POINT_CONVERSION_UNCOMPRESSED) && y_bit) {\n        ECerr(EC_F_EC_GF2M_SIMPLE_OCT2POINT, EC_R_INVALID_ENCODING);\n        return 0;\n    }\n    if (form == 0) {\n        if (len != 1) {\n            ECerr(EC_F_EC_GF2M_SIMPLE_OCT2POINT, EC_R_INVALID_ENCODING);\n            return 0;\n        }\n        return EC_POINT_set_to_infinity(group, point);\n    }\n    field_len = (EC_GROUP_get_degree(group) + 7) / 8;\n    enc_len =\n        (form ==\n         POINT_CONVERSION_COMPRESSED) ? 1 + field_len : 1 + 2 * field_len;\n    if (len != enc_len) {\n        ECerr(EC_F_EC_GF2M_SIMPLE_OCT2POINT, EC_R_INVALID_ENCODING);\n        return 0;\n    }\n    if (ctx == NULL) {\n        ctx = new_ctx = BN_CTX_new();\n        if (ctx == NULL)\n            return 0;\n    }\n    BN_CTX_start(ctx);\n    x = BN_CTX_get(ctx);\n    y = BN_CTX_get(ctx);\n    yxi = BN_CTX_get(ctx);\n    if (yxi == NULL)\n        goto err;\n    if (!BN_bin2bn(buf + 1, field_len, x))\n        goto err;\n    if (BN_ucmp(x, group->field) >= 0) {\n        ECerr(EC_F_EC_GF2M_SIMPLE_OCT2POINT, EC_R_INVALID_ENCODING);\n        goto err;\n    }\n    if (form == POINT_CONVERSION_COMPRESSED) {\n        if (!EC_POINT_set_compressed_coordinates_GF2m\n            (group, point, x, y_bit, ctx))\n            goto err;\n    } else {\n        if (!BN_bin2bn(buf + 1 + field_len, field_len, y))\n            goto err;\n        if (BN_ucmp(y, group->field) >= 0) {\n            ECerr(EC_F_EC_GF2M_SIMPLE_OCT2POINT, EC_R_INVALID_ENCODING);\n            goto err;\n        }\n        if (form == POINT_CONVERSION_HYBRID) {\n            if (!group->meth->field_div(group, yxi, y, x, ctx))\n                goto err;\n            if (y_bit != BN_is_odd(yxi)) {\n                ECerr(EC_F_EC_GF2M_SIMPLE_OCT2POINT, EC_R_INVALID_ENCODING);\n                goto err;\n            }\n        }\n        if (!EC_POINT_set_affine_coordinates_GF2m(group, point, x, y, ctx))\n            goto err;\n    }\n    ret = 1;\n err:\n    BN_CTX_end(ctx);\n    BN_CTX_free(new_ctx);\n    return ret;\n}', 'int EC_POINT_set_compressed_coordinates_GF2m(const EC_GROUP *group,\n                                             EC_POINT *point, const BIGNUM *x,\n                                             int y_bit, BN_CTX *ctx)\n{\n    if (group->meth->point_set_compressed_coordinates == 0\n        && !(group->meth->flags & EC_FLAGS_DEFAULT_OCT)) {\n        ECerr(EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GF2M,\n              ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);\n        return 0;\n    }\n    if (group->meth != point->meth) {\n        ECerr(EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GF2M,\n              EC_R_INCOMPATIBLE_OBJECTS);\n        return 0;\n    }\n    if (group->meth->flags & EC_FLAGS_DEFAULT_OCT) {\n        if (group->meth->field_type == NID_X9_62_prime_field)\n            return ec_GFp_simple_set_compressed_coordinates(group, point, x,\n                                                            y_bit, ctx);\n        else\n            return ec_GF2m_simple_set_compressed_coordinates(group, point, x,\n                                                             y_bit, ctx);\n    }\n    return group->meth->point_set_compressed_coordinates(group, point, x,\n                                                         y_bit, ctx);\n}', 'int ec_GFp_simple_set_compressed_coordinates(const EC_GROUP *group,\n                                             EC_POINT *point,\n                                             const BIGNUM *x_, int y_bit,\n                                             BN_CTX *ctx)\n{\n    BN_CTX *new_ctx = NULL;\n    BIGNUM *tmp1, *tmp2, *x, *y;\n    int ret = 0;\n    ERR_clear_error();\n    if (ctx == NULL) {\n        ctx = new_ctx = BN_CTX_new();\n        if (ctx == NULL)\n            return 0;\n    }\n    y_bit = (y_bit != 0);\n    BN_CTX_start(ctx);\n    tmp1 = BN_CTX_get(ctx);\n    tmp2 = BN_CTX_get(ctx);\n    x = BN_CTX_get(ctx);\n    y = BN_CTX_get(ctx);\n    if (y == NULL)\n        goto err;\n    if (!BN_nnmod(x, x_, group->field, ctx))\n        goto err;\n    if (group->meth->field_decode == 0) {\n        if (!group->meth->field_sqr(group, tmp2, x_, ctx))\n            goto err;\n        if (!group->meth->field_mul(group, tmp1, tmp2, x_, ctx))\n            goto err;\n    } else {\n        if (!BN_mod_sqr(tmp2, x_, group->field, ctx))\n            goto err;\n        if (!BN_mod_mul(tmp1, tmp2, x_, group->field, ctx))\n            goto err;\n    }\n    if (group->a_is_minus3) {\n        if (!BN_mod_lshift1_quick(tmp2, x, group->field))\n            goto err;\n        if (!BN_mod_add_quick(tmp2, tmp2, x, group->field))\n            goto err;\n        if (!BN_mod_sub_quick(tmp1, tmp1, tmp2, group->field))\n            goto err;\n    } else {\n        if (group->meth->field_decode) {\n            if (!group->meth->field_decode(group, tmp2, group->a, ctx))\n                goto err;\n            if (!BN_mod_mul(tmp2, tmp2, x, group->field, ctx))\n                goto err;\n        } else {\n            if (!group->meth->field_mul(group, tmp2, group->a, x, ctx))\n                goto err;\n        }\n        if (!BN_mod_add_quick(tmp1, tmp1, tmp2, group->field))\n            goto err;\n    }\n    if (group->meth->field_decode) {\n        if (!group->meth->field_decode(group, tmp2, group->b, ctx))\n            goto err;\n        if (!BN_mod_add_quick(tmp1, tmp1, tmp2, group->field))\n            goto err;\n    } else {\n        if (!BN_mod_add_quick(tmp1, tmp1, group->b, group->field))\n            goto err;\n    }\n    if (!BN_mod_sqrt(y, tmp1, group->field, ctx)) {\n        unsigned long err = ERR_peek_last_error();\n        if (ERR_GET_LIB(err) == ERR_LIB_BN\n            && ERR_GET_REASON(err) == BN_R_NOT_A_SQUARE) {\n            ERR_clear_error();\n            ECerr(EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES,\n                  EC_R_INVALID_COMPRESSED_POINT);\n        } else\n            ECerr(EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES,\n                  ERR_R_BN_LIB);\n        goto err;\n    }\n    if (y_bit != BN_is_odd(y)) {\n        if (BN_is_zero(y)) {\n            int kron;\n            kron = BN_kronecker(x, group->field, ctx);\n            if (kron == -2)\n                goto err;\n            if (kron == 1)\n                ECerr(EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES,\n                      EC_R_INVALID_COMPRESSION_BIT);\n            else\n                ECerr(EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES,\n                      EC_R_INVALID_COMPRESSED_POINT);\n            goto err;\n        }\n        if (!BN_usub(y, group->field, y))\n            goto err;\n    }\n    if (y_bit != BN_is_odd(y)) {\n        ECerr(EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES,\n              ERR_R_INTERNAL_ERROR);\n        goto err;\n    }\n    if (!EC_POINT_set_affine_coordinates_GFp(group, point, x, y, ctx))\n        goto err;\n    ret = 1;\n err:\n    BN_CTX_end(ctx);\n    BN_CTX_free(new_ctx);\n    return ret;\n}', 'int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx)\n{\n    if (!(BN_mod(r, m, d, ctx)))\n        return 0;\n    if (!r->neg)\n        return 1;\n    return (d->neg ? BN_sub : BN_add) (r, r, d);\n}', 'int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,\n           BN_CTX *ctx)\n{\n    int norm_shift, i, loop;\n    BIGNUM *tmp, wnum, *snum, *sdiv, *res;\n    BN_ULONG *resp, *wnump;\n    BN_ULONG d0, d1;\n    int num_n, div_n;\n    int no_branch = 0;\n    if ((num->top > 0 && num->d[num->top - 1] == 0) ||\n        (divisor->top > 0 && divisor->d[divisor->top - 1] == 0)) {\n        BNerr(BN_F_BN_DIV, BN_R_NOT_INITIALIZED);\n        return 0;\n    }\n    bn_check_top(num);\n    bn_check_top(divisor);\n    if ((BN_get_flags(num, BN_FLG_CONSTTIME) != 0)\n        || (BN_get_flags(divisor, BN_FLG_CONSTTIME) != 0)) {\n        no_branch = 1;\n    }\n    bn_check_top(dv);\n    bn_check_top(rm);\n    if (BN_is_zero(divisor)) {\n        BNerr(BN_F_BN_DIV, BN_R_DIV_BY_ZERO);\n        return (0);\n    }\n    if (!no_branch && BN_ucmp(num, divisor) < 0) {\n        if (rm != NULL) {\n            if (BN_copy(rm, num) == NULL)\n                return (0);\n        }\n        if (dv != NULL)\n            BN_zero(dv);\n        return (1);\n    }\n    BN_CTX_start(ctx);\n    tmp = BN_CTX_get(ctx);\n    snum = BN_CTX_get(ctx);\n    sdiv = BN_CTX_get(ctx);\n    if (dv == NULL)\n        res = BN_CTX_get(ctx);\n    else\n        res = dv;\n    if (sdiv == NULL || res == NULL || tmp == NULL || snum == NULL)\n        goto err;\n    norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2);\n    if (!(BN_lshift(sdiv, divisor, norm_shift)))\n        goto err;\n    sdiv->neg = 0;\n    norm_shift += BN_BITS2;\n    if (!(BN_lshift(snum, num, norm_shift)))\n        goto err;\n    snum->neg = 0;\n    if (no_branch) {\n        if (snum->top <= sdiv->top + 1) {\n            if (bn_wexpand(snum, sdiv->top + 2) == NULL)\n                goto err;\n            for (i = snum->top; i < sdiv->top + 2; i++)\n                snum->d[i] = 0;\n            snum->top = sdiv->top + 2;\n        } else {\n            if (bn_wexpand(snum, snum->top + 1) == NULL)\n                goto err;\n            snum->d[snum->top] = 0;\n            snum->top++;\n        }\n    }\n    div_n = sdiv->top;\n    num_n = snum->top;\n    loop = num_n - div_n;\n    wnum.neg = 0;\n    wnum.d = &(snum->d[loop]);\n    wnum.top = div_n;\n    wnum.dmax = snum->dmax - loop;\n    d0 = sdiv->d[div_n - 1];\n    d1 = (div_n == 1) ? 0 : sdiv->d[div_n - 2];\n    wnump = &(snum->d[num_n - 1]);\n    res->neg = (num->neg ^ divisor->neg);\n    if (!bn_wexpand(res, (loop + 1)))\n        goto err;\n    res->top = loop - no_branch;\n    resp = &(res->d[loop - 1]);\n    if (!bn_wexpand(tmp, (div_n + 1)))\n        goto err;\n    if (!no_branch) {\n        if (BN_ucmp(&wnum, sdiv) >= 0) {\n            bn_clear_top2max(&wnum);\n            bn_sub_words(wnum.d, wnum.d, sdiv->d, div_n);\n            *resp = 1;\n        } else\n            res->top--;\n    }\n    resp++;\n    if (res->top == 0)\n        res->neg = 0;\n    else\n        resp--;\n    for (i = 0; i < loop - 1; i++, wnump--) {\n        BN_ULONG q, l0;\n# if defined(BN_DIV3W) && !defined(OPENSSL_NO_ASM)\n        BN_ULONG bn_div_3_words(BN_ULONG *, BN_ULONG, BN_ULONG);\n        q = bn_div_3_words(wnump, d1, d0);\n# else\n        BN_ULONG n0, n1, rem = 0;\n        n0 = wnump[0];\n        n1 = wnump[-1];\n        if (n0 == d0)\n            q = BN_MASK2;\n        else {\n#  ifdef BN_LLONG\n            BN_ULLONG t2;\n#   if defined(BN_LLONG) && defined(BN_DIV2W) && !defined(bn_div_words)\n            q = (BN_ULONG)(((((BN_ULLONG) n0) << BN_BITS2) | n1) / d0);\n#   else\n            q = bn_div_words(n0, n1, d0);\n#   endif\n#   ifndef REMAINDER_IS_ALREADY_CALCULATED\n            rem = (n1 - q * d0) & BN_MASK2;\n#   endif\n            t2 = (BN_ULLONG) d1 *q;\n            for (;;) {\n                if (t2 <= ((((BN_ULLONG) rem) << BN_BITS2) | wnump[-2]))\n                    break;\n                q--;\n                rem += d0;\n                if (rem < d0)\n                    break;\n                t2 -= d1;\n            }\n#  else\n            BN_ULONG t2l, t2h;\n            q = bn_div_words(n0, n1, d0);\n#   ifndef REMAINDER_IS_ALREADY_CALCULATED\n            rem = (n1 - q * d0) & BN_MASK2;\n#   endif\n#   if defined(BN_UMULT_LOHI)\n            BN_UMULT_LOHI(t2l, t2h, d1, q);\n#   elif defined(BN_UMULT_HIGH)\n            t2l = d1 * q;\n            t2h = BN_UMULT_HIGH(d1, q);\n#   else\n            {\n                BN_ULONG ql, qh;\n                t2l = LBITS(d1);\n                t2h = HBITS(d1);\n                ql = LBITS(q);\n                qh = HBITS(q);\n                mul64(t2l, t2h, ql, qh);\n            }\n#   endif\n            for (;;) {\n                if ((t2h < rem) || ((t2h == rem) && (t2l <= wnump[-2])))\n                    break;\n                q--;\n                rem += d0;\n                if (rem < d0)\n                    break;\n                if (t2l < d1)\n                    t2h--;\n                t2l -= d1;\n            }\n#  endif\n        }\n# endif\n        l0 = bn_mul_words(tmp->d, sdiv->d, div_n, q);\n        tmp->d[div_n] = l0;\n        wnum.d--;\n        if (bn_sub_words(wnum.d, wnum.d, tmp->d, div_n + 1)) {\n            q--;\n            if (bn_add_words(wnum.d, wnum.d, sdiv->d, div_n))\n                (*wnump)++;\n        }\n        resp--;\n        *resp = q;\n    }\n    bn_correct_top(snum);\n    if (rm != NULL) {\n        int neg = num->neg;\n        BN_rshift(rm, snum, norm_shift);\n        if (!BN_is_zero(rm))\n            rm->neg = neg;\n        bn_check_top(rm);\n    }\n    if (no_branch)\n        bn_correct_top(res);\n    BN_CTX_end(ctx);\n    return (1);\n err:\n    bn_check_top(rm);\n    BN_CTX_end(ctx);\n    return (0);\n}', 'int BN_num_bits(const BIGNUM *a)\n{\n    int i = a->top - 1;\n    bn_check_top(a);\n    if (BN_is_zero(a))\n        return 0;\n    return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));\n}', 'int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)\n{\n    int i, nw, lb, rb;\n    BN_ULONG *t, *f;\n    BN_ULONG l;\n    bn_check_top(r);\n    bn_check_top(a);\n    if (n < 0) {\n        BNerr(BN_F_BN_LSHIFT, BN_R_INVALID_SHIFT);\n        return 0;\n    }\n    r->neg = a->neg;\n    nw = n / BN_BITS2;\n    if (bn_wexpand(r, a->top + nw + 1) == NULL)\n        return (0);\n    lb = n % BN_BITS2;\n    rb = BN_BITS2 - lb;\n    f = a->d;\n    t = r->d;\n    t[a->top + nw] = 0;\n    if (lb == 0)\n        for (i = a->top - 1; i >= 0; i--)\n            t[nw + i] = f[i];\n    else\n        for (i = a->top - 1; i >= 0; i--) {\n            l = f[i];\n            t[nw + i + 1] |= (l >> rb) & BN_MASK2;\n            t[nw + i] = (l << lb) & BN_MASK2;\n        }\n    memset(t, 0, sizeof(*t) * nw);\n    r->top = a->top + nw + 1;\n    bn_correct_top(r);\n    bn_check_top(r);\n    return (1);\n}', 'BIGNUM *bn_wexpand(BIGNUM *a, int words)\n{\n    return (words <= a->dmax) ? a : bn_expand2(a, words);\n}']