fix EC_GROUP_copy for EC_GFp_nist_method()
authorBodo Möller <bodo@openssl.org>
Sat, 8 Feb 2003 19:51:37 +0000 (19:51 +0000)
committerBodo Möller <bodo@openssl.org>
Sat, 8 Feb 2003 19:51:37 +0000 (19:51 +0000)
Submitted by: Nils Larsch

crypto/ec/ec_lcl.h
crypto/ec/ecp_nist.c

index 06e666983d69ecf338b533b37281db5db92c0bfa..f4e9700bb8d1563454d1e87e0e13a8702168687c 100644 (file)
@@ -322,6 +322,7 @@ int ec_GFp_recp_field_sqr(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, BN_CTX *
 
 
 /* method functions in ecp_nist.c */
+int ec_GFp_nist_group_copy(EC_GROUP *dest, const EC_GROUP *src);
 int ec_GFp_nist_group_set_curve(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *);
 int ec_GFp_nist_field_mul(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *);
 int ec_GFp_nist_field_sqr(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, BN_CTX *);
index c28b27530e664e4ccfd9ee82bd3b0724e56de525..d2dbfe674327d97e81ab4c92432a2c1ad5d3ec05 100644 (file)
@@ -72,7 +72,7 @@ const EC_METHOD *EC_GFp_nist_method(void)
                ec_GFp_simple_group_init,
                ec_GFp_simple_group_finish,
                ec_GFp_simple_group_clear_finish,
-               ec_GFp_simple_group_copy,
+               ec_GFp_nist_group_copy,
                ec_GFp_nist_group_set_curve,
                ec_GFp_simple_group_get_curve,
                ec_GFp_simple_group_get_degree,
@@ -114,6 +114,12 @@ const EC_METHOD *EC_GFp_nist_method(void)
 #define        NO_32_BIT_TYPE
 #endif
 
+int ec_GFp_nist_group_copy(EC_GROUP *dest, const EC_GROUP *src)
+       {
+       dest->field_mod_func = src->field_mod_func;
+
+       return ec_GFp_simple_group_copy(dest, src);
+       }
 
 int ec_GFp_nist_group_set_curve(EC_GROUP *group, const BIGNUM *p,
        const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)