summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec
diff options
context:
space:
mode:
authormiod <>2014-04-13 15:25:35 +0000
committermiod <>2014-04-13 15:25:35 +0000
commit1fb5cf10c3e597dbb1ecc4dd423bba727fd7721a (patch)
tree74f4ff344980894c7c9ceeab9b81176ac7572566 /src/lib/libcrypto/ec
parent92349eb53934e1b3e9b807e603d45417a6320d21 (diff)
downloadopenbsd-1fb5cf10c3e597dbb1ecc4dd423bba727fd7721a.tar.gz
openbsd-1fb5cf10c3e597dbb1ecc4dd423bba727fd7721a.tar.bz2
openbsd-1fb5cf10c3e597dbb1ecc4dd423bba727fd7721a.zip
Merge conflicts; remove MacOS, Netware, OS/2, VMS and Windows build machinery.
Diffstat (limited to 'src/lib/libcrypto/ec')
-rw-r--r--src/lib/libcrypto/ec/ec.h28
-rw-r--r--src/lib/libcrypto/ec/ec_lib.c10
-rw-r--r--src/lib/libcrypto/ec/ecp_mont.c1
-rw-r--r--src/lib/libcrypto/ec/ectest.c2
4 files changed, 24 insertions, 17 deletions
diff --git a/src/lib/libcrypto/ec/ec.h b/src/lib/libcrypto/ec/ec.h
index 9d01325af3..dfe8710d33 100644
--- a/src/lib/libcrypto/ec/ec.h
+++ b/src/lib/libcrypto/ec/ec.h
@@ -274,10 +274,10 @@ int EC_GROUP_get_curve_name(const EC_GROUP *group);
274void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag); 274void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag);
275int EC_GROUP_get_asn1_flag(const EC_GROUP *group); 275int EC_GROUP_get_asn1_flag(const EC_GROUP *group);
276 276
277void EC_GROUP_set_point_conversion_form(EC_GROUP *, point_conversion_form_t); 277void EC_GROUP_set_point_conversion_form(EC_GROUP *group, point_conversion_form_t form);
278point_conversion_form_t EC_GROUP_get_point_conversion_form(const EC_GROUP *); 278point_conversion_form_t EC_GROUP_get_point_conversion_form(const EC_GROUP *);
279 279
280unsigned char *EC_GROUP_get0_seed(const EC_GROUP *); 280unsigned char *EC_GROUP_get0_seed(const EC_GROUP *x);
281size_t EC_GROUP_get_seed_len(const EC_GROUP *); 281size_t EC_GROUP_get_seed_len(const EC_GROUP *);
282size_t EC_GROUP_set_seed(EC_GROUP *, const unsigned char *, size_t len); 282size_t EC_GROUP_set_seed(EC_GROUP *, const unsigned char *, size_t len);
283 283
@@ -626,8 +626,8 @@ int EC_POINT_is_on_curve(const EC_GROUP *group, const EC_POINT *point, BN_CTX *c
626 */ 626 */
627int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx); 627int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx);
628 628
629int EC_POINT_make_affine(const EC_GROUP *, EC_POINT *, BN_CTX *); 629int EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx);
630int EC_POINTs_make_affine(const EC_GROUP *, size_t num, EC_POINT *[], BN_CTX *); 630int EC_POINTs_make_affine(const EC_GROUP *group, size_t num, EC_POINT *points[], BN_CTX *ctx);
631 631
632/** Computes r = generator * n sum_{i=0}^num p[i] * m[i] 632/** Computes r = generator * n sum_{i=0}^num p[i] * m[i]
633 * \param group underlying EC_GROUP object 633 * \param group underlying EC_GROUP object
@@ -800,16 +800,24 @@ const EC_POINT *EC_KEY_get0_public_key(const EC_KEY *key);
800int EC_KEY_set_public_key(EC_KEY *key, const EC_POINT *pub); 800int EC_KEY_set_public_key(EC_KEY *key, const EC_POINT *pub);
801 801
802unsigned EC_KEY_get_enc_flags(const EC_KEY *key); 802unsigned EC_KEY_get_enc_flags(const EC_KEY *key);
803void EC_KEY_set_enc_flags(EC_KEY *, unsigned int); 803void EC_KEY_set_enc_flags(EC_KEY *eckey, unsigned int flags);
804point_conversion_form_t EC_KEY_get_conv_form(const EC_KEY *); 804point_conversion_form_t EC_KEY_get_conv_form(const EC_KEY *key);
805void EC_KEY_set_conv_form(EC_KEY *, point_conversion_form_t); 805void EC_KEY_set_conv_form(EC_KEY *eckey, point_conversion_form_t cform);
806/* functions to set/get method specific data */ 806/* functions to set/get method specific data */
807void *EC_KEY_get_key_method_data(EC_KEY *, 807void *EC_KEY_get_key_method_data(EC_KEY *key,
808 void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *)); 808 void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *));
809void EC_KEY_insert_key_method_data(EC_KEY *, void *data, 809/** Sets the key method data of an EC_KEY object, if none has yet been set.
810 * \param key EC_KEY object
811 * \param data opaque data to install.
812 * \param dup_func a function that duplicates |data|.
813 * \param free_func a function that frees |data|.
814 * \param clear_free_func a function that wipes and frees |data|.
815 * \return the previously set data pointer, or NULL if |data| was inserted.
816 */
817void *EC_KEY_insert_key_method_data(EC_KEY *key, void *data,
810 void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *)); 818 void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *));
811/* wrapper functions for the underlying EC_GROUP object */ 819/* wrapper functions for the underlying EC_GROUP object */
812void EC_KEY_set_asn1_flag(EC_KEY *, int); 820void EC_KEY_set_asn1_flag(EC_KEY *eckey, int asn1_flag);
813 821
814/** Creates a table of pre-computed multiples of the generator to 822/** Creates a table of pre-computed multiples of the generator to
815 * accelerate further EC_KEY operations. 823 * accelerate further EC_KEY operations.
diff --git a/src/lib/libcrypto/ec/ec_lib.c b/src/lib/libcrypto/ec/ec_lib.c
index 25247b5803..de9a0cc2b3 100644
--- a/src/lib/libcrypto/ec/ec_lib.c
+++ b/src/lib/libcrypto/ec/ec_lib.c
@@ -480,10 +480,10 @@ int EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ctx)
480 if (EC_METHOD_get_field_type(EC_GROUP_method_of(a)) != 480 if (EC_METHOD_get_field_type(EC_GROUP_method_of(a)) !=
481 EC_METHOD_get_field_type(EC_GROUP_method_of(b))) 481 EC_METHOD_get_field_type(EC_GROUP_method_of(b)))
482 return 1; 482 return 1;
483 /* compare the curve name (if present) */ 483 /* compare the curve name (if present in both) */
484 if (EC_GROUP_get_curve_name(a) && EC_GROUP_get_curve_name(b) && 484 if (EC_GROUP_get_curve_name(a) && EC_GROUP_get_curve_name(b) &&
485 EC_GROUP_get_curve_name(a) == EC_GROUP_get_curve_name(b)) 485 EC_GROUP_get_curve_name(a) != EC_GROUP_get_curve_name(b))
486 return 0; 486 return 1;
487 487
488 if (!ctx) 488 if (!ctx)
489 ctx_new = ctx = BN_CTX_new(); 489 ctx_new = ctx = BN_CTX_new();
@@ -993,12 +993,12 @@ int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, BN
993 if (group->meth->point_cmp == 0) 993 if (group->meth->point_cmp == 0)
994 { 994 {
995 ECerr(EC_F_EC_POINT_CMP, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); 995 ECerr(EC_F_EC_POINT_CMP, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
996 return 0; 996 return -1;
997 } 997 }
998 if ((group->meth != a->meth) || (a->meth != b->meth)) 998 if ((group->meth != a->meth) || (a->meth != b->meth))
999 { 999 {
1000 ECerr(EC_F_EC_POINT_CMP, EC_R_INCOMPATIBLE_OBJECTS); 1000 ECerr(EC_F_EC_POINT_CMP, EC_R_INCOMPATIBLE_OBJECTS);
1001 return 0; 1001 return -1;
1002 } 1002 }
1003 return group->meth->point_cmp(group, a, b, ctx); 1003 return group->meth->point_cmp(group, a, b, ctx);
1004 } 1004 }
diff --git a/src/lib/libcrypto/ec/ecp_mont.c b/src/lib/libcrypto/ec/ecp_mont.c
index 079e47431b..f04f132c7a 100644
--- a/src/lib/libcrypto/ec/ecp_mont.c
+++ b/src/lib/libcrypto/ec/ecp_mont.c
@@ -114,7 +114,6 @@ const EC_METHOD *EC_GFp_mont_method(void)
114 ec_GFp_mont_field_decode, 114 ec_GFp_mont_field_decode,
115 ec_GFp_mont_field_set_to_one }; 115 ec_GFp_mont_field_set_to_one };
116 116
117
118 return &ret; 117 return &ret;
119#endif 118#endif
120 } 119 }
diff --git a/src/lib/libcrypto/ec/ectest.c b/src/lib/libcrypto/ec/ectest.c
index f107782de0..102eaa9b23 100644
--- a/src/lib/libcrypto/ec/ectest.c
+++ b/src/lib/libcrypto/ec/ectest.c
@@ -236,7 +236,7 @@ static void group_order_tests(EC_GROUP *group)
236 } 236 }
237 237
238static void prime_field_tests(void) 238static void prime_field_tests(void)
239 { 239 {
240 BN_CTX *ctx = NULL; 240 BN_CTX *ctx = NULL;
241 BIGNUM *p, *a, *b; 241 BIGNUM *p, *a, *b;
242 EC_GROUP *group; 242 EC_GROUP *group;