Lines Matching refs:group
25 int ec_bignum_to_felem(const EC_GROUP *group, EC_FELEM *out, const BIGNUM *in) { in ec_bignum_to_felem() argument
26 if (BN_is_negative(in) || BN_cmp(in, &group->field) >= 0) { in ec_bignum_to_felem()
30 return group->meth->bignum_to_felem(group, out, in); in ec_bignum_to_felem()
33 int ec_felem_to_bignum(const EC_GROUP *group, BIGNUM *out, const EC_FELEM *in) { in ec_felem_to_bignum() argument
34 return group->meth->felem_to_bignum(group, out, in); in ec_felem_to_bignum()
37 void ec_felem_neg(const EC_GROUP *group, EC_FELEM *out, const EC_FELEM *a) { in ec_felem_neg() argument
39 BN_ULONG mask = ec_felem_non_zero_mask(group, a); in ec_felem_neg()
41 bn_sub_words(out->words, group->field.d, a->words, group->field.width); in ec_felem_neg()
44 for (int i = 0; i < group->field.width; i++) { in ec_felem_neg()
49 void ec_felem_add(const EC_GROUP *group, EC_FELEM *out, const EC_FELEM *a, in ec_felem_add() argument
52 bn_mod_add_words(out->words, a->words, b->words, group->field.d, tmp.words, in ec_felem_add()
53 group->field.width); in ec_felem_add()
56 void ec_felem_sub(const EC_GROUP *group, EC_FELEM *out, const EC_FELEM *a, in ec_felem_sub() argument
59 bn_mod_sub_words(out->words, a->words, b->words, group->field.d, tmp.words, in ec_felem_sub()
60 group->field.width); in ec_felem_sub()
63 BN_ULONG ec_felem_non_zero_mask(const EC_GROUP *group, const EC_FELEM *a) { in ec_felem_non_zero_mask() argument
65 for (int i = 0; i < group->field.width; i++) { in ec_felem_non_zero_mask()
71 void ec_felem_select(const EC_GROUP *group, EC_FELEM *out, BN_ULONG mask, in ec_felem_select() argument
73 bn_select_words(out->words, mask, a->words, b->words, group->field.width); in ec_felem_select()
76 int ec_felem_equal(const EC_GROUP *group, const EC_FELEM *a, in ec_felem_equal() argument
81 group->field.width * sizeof(BN_ULONG)) == 0; in ec_felem_equal()