diff options
Diffstat (limited to 'src/lib/libcrypto/ec/ecp_mont.c')
-rw-r--r-- | src/lib/libcrypto/ec/ecp_mont.c | 82 |
1 files changed, 42 insertions, 40 deletions
diff --git a/src/lib/libcrypto/ec/ecp_mont.c b/src/lib/libcrypto/ec/ecp_mont.c index cee0fee12a..6b5b856344 100644 --- a/src/lib/libcrypto/ec/ecp_mont.c +++ b/src/lib/libcrypto/ec/ecp_mont.c | |||
@@ -66,49 +66,51 @@ | |||
66 | #include "ec_lcl.h" | 66 | #include "ec_lcl.h" |
67 | 67 | ||
68 | 68 | ||
69 | const EC_METHOD *EC_GFp_mont_method(void) | 69 | const EC_METHOD * |
70 | { | 70 | EC_GFp_mont_method(void) |
71 | { | ||
71 | static const EC_METHOD ret = { | 72 | static const EC_METHOD ret = { |
72 | EC_FLAGS_DEFAULT_OCT, | 73 | .flags = EC_FLAGS_DEFAULT_OCT, |
73 | NID_X9_62_prime_field, | 74 | .field_type = NID_X9_62_prime_field, |
74 | ec_GFp_mont_group_init, | 75 | .group_init = ec_GFp_mont_group_init, |
75 | ec_GFp_mont_group_finish, | 76 | .group_finish = ec_GFp_mont_group_finish, |
76 | ec_GFp_mont_group_clear_finish, | 77 | .group_clear_finish = ec_GFp_mont_group_clear_finish, |
77 | ec_GFp_mont_group_copy, | 78 | .group_copy = ec_GFp_mont_group_copy, |
78 | ec_GFp_mont_group_set_curve, | 79 | .group_set_curve = ec_GFp_mont_group_set_curve, |
79 | ec_GFp_simple_group_get_curve, | 80 | .group_get_curve = ec_GFp_simple_group_get_curve, |
80 | ec_GFp_simple_group_get_degree, | 81 | .group_get_degree = ec_GFp_simple_group_get_degree, |
81 | ec_GFp_simple_group_check_discriminant, | 82 | .group_check_discriminant = |
82 | ec_GFp_simple_point_init, | 83 | ec_GFp_simple_group_check_discriminant, |
83 | ec_GFp_simple_point_finish, | 84 | .point_init = ec_GFp_simple_point_init, |
84 | ec_GFp_simple_point_clear_finish, | 85 | .point_finish = ec_GFp_simple_point_finish, |
85 | ec_GFp_simple_point_copy, | 86 | .point_clear_finish = ec_GFp_simple_point_clear_finish, |
86 | ec_GFp_simple_point_set_to_infinity, | 87 | .point_copy = ec_GFp_simple_point_copy, |
87 | ec_GFp_simple_set_Jprojective_coordinates_GFp, | 88 | .point_set_to_infinity = ec_GFp_simple_point_set_to_infinity, |
88 | ec_GFp_simple_get_Jprojective_coordinates_GFp, | 89 | .point_set_Jprojective_coordinates_GFp = |
89 | ec_GFp_simple_point_set_affine_coordinates, | 90 | ec_GFp_simple_set_Jprojective_coordinates_GFp, |
90 | ec_GFp_simple_point_get_affine_coordinates, | 91 | .point_get_Jprojective_coordinates_GFp = |
91 | 0,0,0, | 92 | ec_GFp_simple_get_Jprojective_coordinates_GFp, |
92 | ec_GFp_simple_add, | 93 | .point_set_affine_coordinates = |
93 | ec_GFp_simple_dbl, | 94 | ec_GFp_simple_point_set_affine_coordinates, |
94 | ec_GFp_simple_invert, | 95 | .point_get_affine_coordinates = |
95 | ec_GFp_simple_is_at_infinity, | 96 | ec_GFp_simple_point_get_affine_coordinates, |
96 | ec_GFp_simple_is_on_curve, | 97 | .add = ec_GFp_simple_add, |
97 | ec_GFp_simple_cmp, | 98 | .dbl = ec_GFp_simple_dbl, |
98 | ec_GFp_simple_make_affine, | 99 | .invert = ec_GFp_simple_invert, |
99 | ec_GFp_simple_points_make_affine, | 100 | .is_at_infinity = ec_GFp_simple_is_at_infinity, |
100 | 0 /* mul */, | 101 | .is_on_curve = ec_GFp_simple_is_on_curve, |
101 | 0 /* precompute_mult */, | 102 | .point_cmp = ec_GFp_simple_cmp, |
102 | 0 /* have_precompute_mult */, | 103 | .make_affine = ec_GFp_simple_make_affine, |
103 | ec_GFp_mont_field_mul, | 104 | .points_make_affine = ec_GFp_simple_points_make_affine, |
104 | ec_GFp_mont_field_sqr, | 105 | .field_mul = ec_GFp_mont_field_mul, |
105 | 0 /* field_div */, | 106 | .field_sqr = ec_GFp_mont_field_sqr, |
106 | ec_GFp_mont_field_encode, | 107 | .field_encode = ec_GFp_mont_field_encode, |
107 | ec_GFp_mont_field_decode, | 108 | .field_decode = ec_GFp_mont_field_decode, |
108 | ec_GFp_mont_field_set_to_one }; | 109 | .field_set_to_one = ec_GFp_mont_field_set_to_one |
110 | }; | ||
109 | 111 | ||
110 | return &ret; | 112 | return &ret; |
111 | } | 113 | } |
112 | 114 | ||
113 | 115 | ||
114 | int ec_GFp_mont_group_init(EC_GROUP *group) | 116 | int ec_GFp_mont_group_init(EC_GROUP *group) |