Lines Matching refs:mont
81 group->mont = NULL; in ec_GFp_mont_group_init()
87 BN_MONT_CTX_free(group->mont); in ec_GFp_mont_group_finish()
88 group->mont = NULL; in ec_GFp_mont_group_finish()
95 BN_MONT_CTX_free(group->mont); in ec_GFp_mont_group_clear_finish()
96 group->mont = NULL; in ec_GFp_mont_group_clear_finish()
103 BN_MONT_CTX_free(dest->mont); in ec_GFp_mont_group_copy()
104 dest->mont = NULL; in ec_GFp_mont_group_copy()
112 if (src->mont != NULL) { in ec_GFp_mont_group_copy()
113 dest->mont = BN_MONT_CTX_new(); in ec_GFp_mont_group_copy()
114 if (dest->mont == NULL) { in ec_GFp_mont_group_copy()
117 if (!BN_MONT_CTX_copy(dest->mont, src->mont)) { in ec_GFp_mont_group_copy()
131 BN_MONT_CTX_free(dest->mont); in ec_GFp_mont_group_copy()
132 dest->mont = NULL; in ec_GFp_mont_group_copy()
139 BN_MONT_CTX *mont = NULL; in ec_GFp_mont_group_set_curve() local
143 BN_MONT_CTX_free(group->mont); in ec_GFp_mont_group_set_curve()
144 group->mont = NULL; in ec_GFp_mont_group_set_curve()
155 mont = BN_MONT_CTX_new(); in ec_GFp_mont_group_set_curve()
156 if (mont == NULL) { in ec_GFp_mont_group_set_curve()
159 if (!BN_MONT_CTX_set(mont, p, ctx)) { in ec_GFp_mont_group_set_curve()
164 if (one == NULL || !BN_to_montgomery(one, BN_value_one(), mont, ctx)) { in ec_GFp_mont_group_set_curve()
168 group->mont = mont; in ec_GFp_mont_group_set_curve()
169 mont = NULL; in ec_GFp_mont_group_set_curve()
176 BN_MONT_CTX_free(group->mont); in ec_GFp_mont_group_set_curve()
177 group->mont = NULL; in ec_GFp_mont_group_set_curve()
184 BN_MONT_CTX_free(mont); in ec_GFp_mont_group_set_curve()
191 if (group->mont == NULL) { in ec_GFp_mont_field_mul()
196 return BN_mod_mul_montgomery(r, a, b, group->mont, ctx); in ec_GFp_mont_field_mul()
201 if (group->mont == NULL) { in ec_GFp_mont_field_sqr()
206 return BN_mod_mul_montgomery(r, a, a, group->mont, ctx); in ec_GFp_mont_field_sqr()
211 if (group->mont == NULL) { in ec_GFp_mont_field_encode()
216 return BN_to_montgomery(r, a, group->mont, ctx); in ec_GFp_mont_field_encode()
221 if (group->mont == NULL) { in ec_GFp_mont_field_decode()
226 return BN_from_montgomery(r, a, group->mont, ctx); in ec_GFp_mont_field_decode()