pub fn print_threshold_key_file(filenames: Vec<&str>) -> Result<(), NodeError> {
        let size = filenames.len();
        let threshold = (size - 1) / 3; // The threshold for TSS is f
        let mut rng = rand::thread_rng();
        let sk_set = SecretKeySet::random(threshold, &mut rng);
        let pk_set = sk_set.public_keys();
        
        for id in 0..size {
            let sk_share = sk_set.secret_key_share(id);
            let pk_share = pk_set.public_key_share(id);
            SecretShare::new(id, pk_share, SerdeSecret(sk_share.clone()), pk_set.clone()).write(filenames[id])?;
        }
        return Ok(());
    }
// Print the threshold signature keys to the corresponding files
Print the threshold signature keys to the corresponding files
Print the threshold signature keys to the corresponding files
pub fn print_threshold_key_file(filenames: Vec<&str>) -> Result<(), NodeError> {
        let size = filenames.len();
        let threshold = (size - 1) / 3; // The threshold for TSS is f
        let mut rng = rand::thread_rng();
        let sk_set = SecretKeySet::random(threshold, &mut rng);
        let pk_set = sk_set.public_keys();
        for id in 0..size {
            let sk_share = sk_set.secret_key_share(id);
            let pk_share = pk_set.public_key_share(id);
            SecretShare::new(id, pk_share, SerdeSecret(sk_share.clone()), pk_set.clone()).write(filenames[id])?;
        }
        return Ok(());
    }
pub fn print_threshold_key_file ( filenames : Vec < & str > ) -> Result < ( ) , NodeError > { let size = filenames . len ( ) ; let threshold = ( size - 1 ) / 3 ; // The threshold for TSS is f let mut rng = rand :: thread_rng ( ) ; let sk_set = SecretKeySet :: random ( threshold , & mut rng ) ; let pk_set = sk_set . public_keys ( ) ; for id in 0 .. size { let sk_share = sk_set . secret_key_share ( id ) ; let pk_share = pk_set . public_key_share ( id ) ; SecretShare :: new ( id , pk_share , SerdeSecret ( sk_share . clone ( ) ) , pk_set . clone ( ) ) . write ( filenames [ id ] ) ? ; } return Ok ( ( ) ) ; }
Print the threshold signature keys to the corresponding files
Print the threshold signature keys to the corresponding files
filenames
Vec<&str>
filenames
Vec<&str>