pub unsafe fn is_slice_in_curve_unchecked(slice: &[u8]) -> bool {
            use secp256k1::ffi::{self, CPtr};

            let public = Self::as_ref_unchecked(slice);

            let mut public_with_flag = [0u8; UNCOMPRESSED_PUBLIC_KEY_SIZE];

            public_with_flag[1..].copy_from_slice(public.as_ref());

            // Safety: FFI call
            let curve = ffi::secp256k1_ec_pubkey_parse(
                ffi::secp256k1_context_no_precomp,
                &mut ffi::PublicKey::new(),
                public_with_flag.as_c_ptr(),
                UNCOMPRESSED_PUBLIC_KEY_SIZE,
            );

            curve == 1
        }
/// Check if the provided slice represents a public key that is in the
/// curve.
///
/// # Safety
///
/// This function extends the unsafety of
/// [`PublicKey::as_ref_unchecked`].
Check if the provided slice represents a public key that is in the
curve.
Check if the provided slice represents a public key that is in the curve .
pub unsafe fn is_slice_in_curve_unchecked(slice: &[u8]) -> bool {
            use secp256k1::ffi::{self, CPtr};
            let public = Self::as_ref_unchecked(slice);
            let mut public_with_flag = [0u8; UNCOMPRESSED_PUBLIC_KEY_SIZE];
            public_with_flag[1..].copy_from_slice(public.as_ref());
            // Safety: FFI call
            let curve = ffi::secp256k1_ec_pubkey_parse(
                ffi::secp256k1_context_no_precomp,
                &mut ffi::PublicKey::new(),
                public_with_flag.as_c_ptr(),
                UNCOMPRESSED_PUBLIC_KEY_SIZE,
            );
            curve == 1
        }
pub unsafe fn is_slice_in_curve_unchecked ( slice : & [ u8 ] ) -> bool { use secp256k1 :: ffi :: { self , CPtr } ; let public = Self :: as_ref_unchecked ( slice ) ; let mut public_with_flag = [ 0u8 ; UNCOMPRESSED_PUBLIC_KEY_SIZE ] ; public_with_flag [ 1 .. ] . copy_from_slice ( public . as_ref ( ) ) ; // Safety: FFI call let curve = ffi :: secp256k1_ec_pubkey_parse ( ffi :: secp256k1_context_no_precomp , & mut ffi :: PublicKey :: new ( ) , public_with_flag . as_c_ptr ( ) , UNCOMPRESSED_PUBLIC_KEY_SIZE , ) ; curve == 1 }
Check if the provided slice represents a public key that is in the
curve.
Check if the provided slice represents a public key that is in the curve .
slice
&[u8]
safety
This function extends the unsafety of
[`PublicKey::as_ref_unchecked`].
This function extends the unsafety of [ ` PublicKey :: as_ref_unchecked ` ] .