-/* $OpenBSD: dh.c,v 1.25 2021/02/04 19:59:15 tobhe Exp $ */
+/* $OpenBSD: dh.c,v 1.26 2021/02/04 20:15:02 tobhe Exp $ */
/*
* Copyright (c) 2010-2014 Reyk Floeter <reyk@openbsd.org>
if ((ecgroup = EC_KEY_get0_group(group->ec)) == NULL)
goto done;
- if (EC_METHOD_get_field_type(EC_GROUP_method_of(ecgroup)) ==
- NID_X9_62_prime_field) {
- if (!EC_POINT_get_affine_coordinates_GFp(ecgroup,
- point, x, y, bnctx))
- goto done;
- } else {
- if (!EC_POINT_get_affine_coordinates_GF2m(ecgroup,
- point, x, y, bnctx))
- goto done;
- }
+ if (!EC_POINT_get_affine_coordinates_GFp(ecgroup,
+ point, x, y, bnctx))
+ goto done;
xoff = xlen - BN_num_bytes(x);
bzero(buf, xoff);
if ((point = EC_POINT_new(ecgroup)) == NULL)
goto done;
- if (EC_METHOD_get_field_type(EC_GROUP_method_of(ecgroup)) ==
- NID_X9_62_prime_field) {
- if (!EC_POINT_set_affine_coordinates_GFp(ecgroup,
- point, x, y, bnctx))
- goto done;
- } else {
- if (!EC_POINT_set_affine_coordinates_GF2m(ecgroup,
- point, x, y, bnctx))
- goto done;
- }
+ if (!EC_POINT_set_affine_coordinates_GFp(ecgroup,
+ point, x, y, bnctx))
+ goto done;
ret = 0;
done: