pub fn split<R: RngCore + CryptoRng, const T: usize, const N: usize>(
        &self,
        rng: &mut R,
    ) -> Result<[SecretKeyShare; N], Error> {
        let shares =
            Shamir::<T, N>::split_secret::<Scalar, R, SECRET_KEY_SHARE_BYTES>(self.0, rng)?;
        let mut secrets: MaybeUninit<[SecretKeyShare; N]> = MaybeUninit::uninit();
        for (i, s) in shares.iter().enumerate() {
            let p = (secrets.as_mut_ptr() as *mut SecretKeyShare).wrapping_add(i);
            unsafe { core::ptr::write(p, SecretKeyShare(*s)) };
        }
        Ok(unsafe { secrets.assume_init() })
    }
/// Secret share this key by creating `N` shares where `T` are required
/// to combine back into this secret
Secret share this key by creating `N` shares where `T` are required
to combine back into this secret
Secret share this key by creating ` N ` shares where ` T ` are required to combine back into this secret
pub fn split<R: RngCore + CryptoRng, const T: usize, const N: usize>(
        &self,
        rng: &mut R,
    ) -> Result<[SecretKeyShare; N], Error> {
        let shares =
            Shamir::<T, N>::split_secret::<Scalar, R, SECRET_KEY_SHARE_BYTES>(self.0, rng)?;
        let mut secrets: MaybeUninit<[SecretKeyShare; N]> = MaybeUninit::uninit();
        for (i, s) in shares.iter().enumerate() {
            let p = (secrets.as_mut_ptr() as *mut SecretKeyShare).wrapping_add(i);
            unsafe { core::ptr::write(p, SecretKeyShare(*s)) };
        }
        Ok(unsafe { secrets.assume_init() })
    }
pub fn split < R : RngCore + CryptoRng , const T : usize , const N : usize > ( & self , rng : & mut R , ) -> Result < [ SecretKeyShare ; N ] , Error > { let shares = Shamir :: < T , N > :: split_secret :: < Scalar , R , SECRET_KEY_SHARE_BYTES > ( self . 0 , rng ) ? ; let mut secrets : MaybeUninit < [ SecretKeyShare ; N ] > = MaybeUninit :: uninit ( ) ; for ( i , s ) in shares . iter ( ) . enumerate ( ) { let p = ( secrets . as_mut_ptr ( ) as * mut SecretKeyShare ) . wrapping_add ( i ) ; unsafe { core :: ptr :: write ( p , SecretKeyShare ( * s ) ) } ; } Ok ( unsafe { secrets . assume_init ( ) } ) }
Secret share this key by creating `N` shares where `T` are required
to combine back into this secret
Secret share this key by creating ` N ` shares where ` T ` are required to combine back into this secret
&self
rng
&mut R