pub fn threshold_secret_key(
            secret_key: CspSecretKey,
        ) -> Result<threshold_types::SecretKeyBytes, ni_dkg_errors::MalformedSecretKeyError>
        {
            if let CspSecretKey::ThresBls12_381(secret_key) = secret_key {
                Ok(secret_key)
            } else {
                let unexpected_type_name: &'static str = secret_key.into();
                Err(ni_dkg_errors::MalformedSecretKeyError {
                    algorithm: ALGORITHM_ID,
                    internal_error: format!("Unexpected key type: {}", unexpected_type_name),
                })
            }
        }
/// Converts a threshold secret key to the variant used by
/// NiDkg_Groth20.
///
/// # Errors
/// This returns an error if the type variant is not that used
/// in NiDkg_Groth20.
Converts a threshold secret key to the variant used by
NiDkg_Groth20.
Converts a threshold secret key to the variant used by NiDkg_Groth20 .
pub fn threshold_secret_key(
            secret_key: CspSecretKey,
        ) -> Result<threshold_types::SecretKeyBytes, ni_dkg_errors::MalformedSecretKeyError>
        {
            if let CspSecretKey::ThresBls12_381(secret_key) = secret_key {
                Ok(secret_key)
            } else {
                let unexpected_type_name: &'static str = secret_key.into();
                Err(ni_dkg_errors::MalformedSecretKeyError {
                    algorithm: ALGORITHM_ID,
                    internal_error: format!("Unexpected key type: {}", unexpected_type_name),
                })
            }
        }
pub fn threshold_secret_key ( secret_key : CspSecretKey , ) -> Result < threshold_types :: SecretKeyBytes , ni_dkg_errors :: MalformedSecretKeyError > { if let CspSecretKey :: ThresBls12_381 ( secret_key ) = secret_key { Ok ( secret_key ) } else { let unexpected_type_name : & ' static str = secret_key . into ( ) ; Err ( ni_dkg_errors :: MalformedSecretKeyError { algorithm : ALGORITHM_ID , internal_error : format ! ( " " unexpected_type_name ) , } ) } }
Converts a threshold secret key to the variant used by
NiDkg_Groth20.
Converts a threshold secret key to the variant used by NiDkg_Groth20 .
secret_key
CspSecretKey
secret_key
CspSecretKey
errors
This returns an error if the type variant is not that used
in NiDkg_Groth20.
This returns an error if the type variant is not that used in NiDkg_Groth20 .