*/
/* tmp1 := x^3 */
- if (!BN_nnmod(x, x_, &group->field,ctx)) goto err;
+ if (!BN_nnmod(x, x_, group->field,ctx)) goto err;
if (group->meth->field_decode == 0)
{
/* field_{sqr,mul} work on standard representation */
}
else
{
- if (!BN_mod_sqr(tmp2, x_, &group->field, ctx)) goto err;
- if (!BN_mod_mul(tmp1, tmp2, x_, &group->field, ctx)) goto err;
+ if (!BN_mod_sqr(tmp2, x_, group->field, ctx)) goto err;
+ if (!BN_mod_mul(tmp1, tmp2, x_, group->field, ctx)) goto err;
}
/* tmp1 := tmp1 + a*x */
if (group->a_is_minus3)
{
- if (!BN_mod_lshift1_quick(tmp2, x, &group->field)) goto err;
- if (!BN_mod_add_quick(tmp2, tmp2, x, &group->field)) goto err;
- if (!BN_mod_sub_quick(tmp1, tmp1, tmp2, &group->field)) goto err;
+ if (!BN_mod_lshift1_quick(tmp2, x, group->field)) goto err;
+ if (!BN_mod_add_quick(tmp2, tmp2, x, group->field)) goto err;
+ if (!BN_mod_sub_quick(tmp1, tmp1, tmp2, group->field)) goto err;
}
else
{
if (group->meth->field_decode)
{
- if (!group->meth->field_decode(group, tmp2, &group->a, ctx)) goto err;
- if (!BN_mod_mul(tmp2, tmp2, x, &group->field, ctx)) goto err;
+ if (!group->meth->field_decode(group, tmp2, group->a, ctx)) goto err;
+ if (!BN_mod_mul(tmp2, tmp2, x, group->field, ctx)) goto err;
}
else
{
/* field_mul works on standard representation */
- if (!group->meth->field_mul(group, tmp2, &group->a, x, ctx)) goto err;
+ if (!group->meth->field_mul(group, tmp2, group->a, x, ctx)) goto err;
}
- if (!BN_mod_add_quick(tmp1, tmp1, tmp2, &group->field)) goto err;
+ if (!BN_mod_add_quick(tmp1, tmp1, tmp2, group->field)) goto err;
}
/* tmp1 := tmp1 + b */
if (group->meth->field_decode)
{
- if (!group->meth->field_decode(group, tmp2, &group->b, ctx)) goto err;
- if (!BN_mod_add_quick(tmp1, tmp1, tmp2, &group->field)) goto err;
+ if (!group->meth->field_decode(group, tmp2, group->b, ctx)) goto err;
+ if (!BN_mod_add_quick(tmp1, tmp1, tmp2, group->field)) goto err;
}
else
{
- if (!BN_mod_add_quick(tmp1, tmp1, &group->b, &group->field)) goto err;
+ if (!BN_mod_add_quick(tmp1, tmp1, group->b, group->field)) goto err;
}
- if (!BN_mod_sqrt(y, tmp1, &group->field, ctx))
+ if (!BN_mod_sqrt(y, tmp1, group->field, ctx))
{
unsigned long err = ERR_peek_last_error();
{
int kron;
- kron = BN_kronecker(x, &group->field, ctx);
+ kron = BN_kronecker(x, group->field, ctx);
if (kron == -2) goto err;
if (kron == 1)
ECerr(EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES, EC_R_INVALID_COMPRESSED_POINT);
goto err;
}
- if (!BN_usub(y, &group->field, y)) goto err;
+ if (!BN_usub(y, group->field, y)) goto err;
}
if (y_bit != BN_is_odd(y))
{
/* ret := required output buffer length */
- field_len = BN_num_bytes(&group->field);
+ field_len = BN_num_bytes(group->field);
ret = (form == POINT_CONVERSION_COMPRESSED) ? 1 + field_len : 1 + 2*field_len;
/* if 'buf' is NULL, just return required length */
return EC_POINT_set_to_infinity(group, point);
}
- field_len = BN_num_bytes(&group->field);
+ field_len = BN_num_bytes(group->field);
enc_len = (form == POINT_CONVERSION_COMPRESSED) ? 1 + field_len : 1 + 2*field_len;
if (len != enc_len)
if (y == NULL) goto err;
if (!BN_bin2bn(buf + 1, field_len, x)) goto err;
- if (BN_ucmp(x, &group->field) >= 0)
+ if (BN_ucmp(x, group->field) >= 0)
{
ECerr(EC_F_EC_GFP_SIMPLE_OCT2POINT, EC_R_INVALID_ENCODING);
goto err;
else
{
if (!BN_bin2bn(buf + 1 + field_len, field_len, y)) goto err;
- if (BN_ucmp(y, &group->field) >= 0)
+ if (BN_ucmp(y, group->field) >= 0)
{
ECerr(EC_F_EC_GFP_SIMPLE_OCT2POINT, EC_R_INVALID_ENCODING);
goto err;