pub fn from_curve<P: Field>() -> Result<(Parameters, u16), ParametersError> {
        let field_size_bits = P::size_in_bits() as u16;
        let security_level = field_size_bits / 2;
        let parameters = Parameters {
            security_level,
            security_zk: security_level - 3,
            security_soundness: security_level - 2,
            field_size_bits,
            hash_to_prime_bits: 2 * security_level - 2,
        };

        parameters.is_valid()?;
        Ok((parameters, security_level))
    }
/// Derive parameters based on a curve.
Derive parameters based on a curve.
Derive parameters based on a curve .
pub fn from_curve<P: Field>() -> Result<(Parameters, u16), ParametersError> {
        let field_size_bits = P::size_in_bits() as u16;
        let security_level = field_size_bits / 2;
        let parameters = Parameters {
            security_level,
            security_zk: security_level - 3,
            security_soundness: security_level - 2,
            field_size_bits,
            hash_to_prime_bits: 2 * security_level - 2,
        };
        parameters.is_valid()?;
        Ok((parameters, security_level))
    }
pub fn from_curve < P : Field > ( ) -> Result < ( Parameters , u16 ) , ParametersError > { let field_size_bits = P :: size_in_bits ( ) as u16 ; let security_level = field_size_bits / 2 ; let parameters = Parameters { security_level , security_zk : security_level - 3 , security_soundness : security_level - 2 , field_size_bits , hash_to_prime_bits : 2 * security_level - 2 , } ; parameters . is_valid ( ) ? ; Ok ( ( parameters , security_level ) ) }
Derive parameters based on a curve.
Derive parameters based on a curve .