pub fn trusted_secret_key_into_miracl(secret_key: &FsEncryptionSecretKey) -> crypto::SecretKey {
    crypto::SecretKey {
        bte_nodes: secret_key
            .bte_nodes
            .iter()
            .map(|node| crypto::BTENode {
                tau: node.tau.iter().copied().map(crypto::Bit::from).collect(),
                a: miracl_g1_from_bytes_unchecked(&node.a.0)
                    .expect("Malformed secret key at BTENode.a"),
                b: miracl_g2_from_bytes_unchecked(&node.b.0)
                    .expect("Malformed secret key at BTENode.b"),
                d_t: node
                    .d_t
                    .iter()
                    .map(|g2| {
                        miracl_g2_from_bytes_unchecked(&g2.0)
                            .expect("Malformed secret key at BTENode.d_t")
                    })
                    .collect(),
                d_h: node
                    .d_h
                    .iter()
                    .map(|g2| {
                        miracl_g2_from_bytes_unchecked(&g2.0)
                            .expect("Malformed secret key at BTENode.d_h")
                    })
                    .collect(),
                e: miracl_g2_from_bytes_unchecked(&node.e.0)
                    .expect("Malformed secret key at BTENode.e"),
            })
            .collect(),
    }
}
/// Parses a forward secure secret key into a miracl-compatible form.
///
/// # Security Note
///
/// The provided `secret_key` is assumed to be "trusted",
/// meaning it was obtained from a known and trusted source.
/// This is because certain safety checks are NOT performed
/// on the members of the key.
///
/// # Panics
/// Panics if the key is malformed.  Given that secret keys are created and
/// managed within the CSP such a failure is an error in this code or a
/// corruption of the secret key store.
Parses a forward secure secret key into a miracl-compatible form.
Parses a forward secure secret key into a miracl - compatible form .
pub fn trusted_secret_key_into_miracl(secret_key: &FsEncryptionSecretKey) -> crypto::SecretKey {
    crypto::SecretKey {
        bte_nodes: secret_key
            .bte_nodes
            .iter()
            .map(|node| crypto::BTENode {
                tau: node.tau.iter().copied().map(crypto::Bit::from).collect(),
                a: miracl_g1_from_bytes_unchecked(&node.a.0)
                    .expect("Malformed secret key at BTENode.a"),
                b: miracl_g2_from_bytes_unchecked(&node.b.0)
                    .expect("Malformed secret key at BTENode.b"),
                d_t: node
                    .d_t
                    .iter()
                    .map(|g2| {
                        miracl_g2_from_bytes_unchecked(&g2.0)
                            .expect("Malformed secret key at BTENode.d_t")
                    })
                    .collect(),
                d_h: node
                    .d_h
                    .iter()
                    .map(|g2| {
                        miracl_g2_from_bytes_unchecked(&g2.0)
                            .expect("Malformed secret key at BTENode.d_h")
                    })
                    .collect(),
                e: miracl_g2_from_bytes_unchecked(&node.e.0)
                    .expect("Malformed secret key at BTENode.e"),
            })
            .collect(),
    }
}
pub fn trusted_secret_key_into_miracl ( secret_key : & FsEncryptionSecretKey ) -> crypto :: SecretKey { crypto :: SecretKey { bte_nodes : secret_key . bte_nodes . iter ( ) . map ( | node | crypto :: BTENode { tau : node . tau . iter ( ) . copied ( ) . map ( crypto :: Bit :: from ) . collect ( ) , a : miracl_g1_from_bytes_unchecked ( & node . a . 0 ) . expect ( " " ) , b : miracl_g2_from_bytes_unchecked ( & node . b . 0 ) . expect ( " " ) , d_t : node . d_t . iter ( ) . map ( | g2 | { miracl_g2_from_bytes_unchecked ( & g2 . 0 ) . expect ( " " ) } ) . collect ( ) , d_h : node . d_h . iter ( ) . map ( | g2 | { miracl_g2_from_bytes_unchecked ( & g2 . 0 ) . expect ( " " ) } ) . collect ( ) , e : miracl_g2_from_bytes_unchecked ( & node . e . 0 ) . expect ( " " ) , } ) . collect ( ) , } }
Parses a forward secure secret key into a miracl-compatible form.
Parses a forward secure secret key into a miracl - compatible form .
secret_key
&FsEncryptionSecretKey
secret_key
&FsEncryptionSecretKey
security note
The provided `secret_key` is assumed to be "trusted",
meaning it was obtained from a known and trusted source.
This is because certain safety checks are NOT performed
on the members of the key.
The provided ` secret_key ` is assumed to be " trusted " meaning it was obtained from a known and trusted source . This is because certain safety checks are NOT performed on the members of the key .
panics
Panics if the key is malformed.  Given that secret keys are created and
managed within the CSP such a failure is an error in this code or a
corruption of the secret key store.
Panics if the key is malformed . Given that secret keys are created and managed within the CSP such a failure is an error in this code or a corruption of the secret key store .