Index: EC.xs
--- EC.xs.orig
+++ EC.xs
@@ -19,6 +19,8 @@ BOOT:
     ERR_load_crypto_strings();
     ERR_load_EC_strings();
 
+#if !defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER < 0x3080000fL
+
 const EC_METHOD *
 EC_GFp_simple_method()
 
@@ -28,6 +30,8 @@ EC_GFp_mont_method()
 const EC_METHOD *
 EC_GFp_nist_method()
 
+#endif
+
 #ifndef OPENSSL_NO_EC2M
 
 const EC_METHOD *
@@ -69,6 +73,8 @@ ERR_error_string(error,buf=NULL)
 
 MODULE = Crypt::OpenSSL::EC		PACKAGE = Crypt::OpenSSL::EC::EC_GROUP	PREFIX=EC_GROUP_
 
+#if !defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER < 0x4000000fL
+
 EC_GROUP *
 EC_GROUP_new(const EC_METHOD *meth)
     CODE:
@@ -76,6 +82,8 @@ EC_GROUP_new(const EC_METHOD *meth)
     OUTPUT:
 	RETVAL
 
+#endif
+
 void 
 EC_GROUP_DESTROY(EC_GROUP * group)
     CODE:
@@ -84,18 +92,22 @@ EC_GROUP_DESTROY(EC_GROUP * group)
 void 
 EC_GROUP_free(EC_GROUP * group)
 
-int 
-EC_GROUP_copy(EC_GROUP *dst, const EC_GROUP *src)
-
 EC_GROUP *
 EC_GROUP_dup(const EC_GROUP *src)
 
+#if !defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER < 0x4000000fL
+
+int 
+EC_GROUP_copy(EC_GROUP *dst, const EC_GROUP *src)
+
 const EC_METHOD *
 EC_GROUP_method_of(const EC_GROUP *group)
 
 int 
 EC_METHOD_get_field_type(const EC_METHOD *meth)
 
+#endif
+
 int 
 EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, const BIGNUM *order, const BIGNUM *cofactor)
 
@@ -162,12 +174,16 @@ EC_GROUP_get_curve_GF2m(const EC_GROUP *group, BIGNUM 
 int 
 EC_GROUP_get_degree(const EC_GROUP *group)
 
+#if !defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER < 0x4000000fL
+
 int 
 EC_GROUP_check(const EC_GROUP *group, BN_CTX *ctx)
 
 int 
 EC_GROUP_check_discriminant(const EC_GROUP *group, BN_CTX *ctx)
 
+#endif
+
 int 
 EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ctx)
 
@@ -184,12 +200,15 @@ EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM 
 EC_GROUP *
 EC_GROUP_new_by_curve_name(int nid)
 
+#if !defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER < 0x3080000fL
+
 int 
 EC_GROUP_precompute_mult(EC_GROUP *group, BN_CTX *ctx)
 
 int 
 EC_GROUP_have_precompute_mult(const EC_GROUP *group)
 
+#endif
 
 int 
 EC_GROUP_get_basis_type(const EC_GROUP *group)
@@ -247,18 +266,22 @@ EC_POINT_copy(EC_POINT *dst, const EC_POINT *src)
 
 EC_POINT *
 EC_POINT_dup(const EC_POINT *src, const EC_GROUP *group)
+
+int 
+EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point)
+
+#if !defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER < 0x4000000fL
  
 const EC_METHOD *
 EC_POINT_method_of(const EC_POINT *point)
 
 int 
-EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point)
-
-int 
 EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group, EC_POINT *p, const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, BN_CTX *ctx)
 
 int 
 EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group,	const EC_POINT *p, BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx)
+
+#endif
 
 int 
 EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *p,	const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx)
