pub fn create_resharing_transcript(
        algorithm_id: AlgorithmId,
        threshold: NumberOfNodes,
        number_of_receivers: NumberOfNodes,
        csp_dealings: BTreeMap<NodeIndex, CspNiDkgDealing>,
        resharing_public_coefficients: CspPublicCoefficients,
    ) -> Result<CspNiDkgTranscript, ni_dkg_errors::CspDkgCreateReshareTranscriptError> {
        match algorithm_id {
            AlgorithmId::NiDkg_Groth20_Bls12_381 => {
                // Specialise:
                let csp_dealings = specialise::groth20::dealings(csp_dealings).map_err(
                    |(dealer_index, error)| {
                        ni_dkg_errors::CspDkgCreateReshareTranscriptError::InvalidDealingError {
                            dealer_index,
                            error,
                        }
                    },
                )?;
                let resharing_public_coefficients = specialise::groth20::public_coefficients(
            resharing_public_coefficients,
        )
        .map_err(ni_dkg_errors::CspDkgCreateReshareTranscriptError::MalformedResharePublicCoefficientsError)?;
                // Static call:
                let transcript = clib::create_resharing_transcript(
                    threshold,
                    number_of_receivers,
                    &csp_dealings,
                    &resharing_public_coefficients,
                )?;
                // Generalise
                let transcript = CspNiDkgTranscript::Groth20_Bls12_381(transcript);
                Ok(transcript)
            }
            other => Err(
                ni_dkg_errors::CspDkgCreateReshareTranscriptError::UnsupportedAlgorithmId(other),
            ),
        }
    }
/// Create a CSP transcript from CSP dealings
Create a CSP transcript from CSP dealings
Create a CSP transcript from CSP dealings
pub fn create_resharing_transcript(
        algorithm_id: AlgorithmId,
        threshold: NumberOfNodes,
        number_of_receivers: NumberOfNodes,
        csp_dealings: BTreeMap<NodeIndex, CspNiDkgDealing>,
        resharing_public_coefficients: CspPublicCoefficients,
    ) -> Result<CspNiDkgTranscript, ni_dkg_errors::CspDkgCreateReshareTranscriptError> {
        match algorithm_id {
            AlgorithmId::NiDkg_Groth20_Bls12_381 => {
                // Specialise:
                let csp_dealings = specialise::groth20::dealings(csp_dealings).map_err(
                    |(dealer_index, error)| {
                        ni_dkg_errors::CspDkgCreateReshareTranscriptError::InvalidDealingError {
                            dealer_index,
                            error,
                        }
                    },
                )?;
                let resharing_public_coefficients = specialise::groth20::public_coefficients(
            resharing_public_coefficients,
        )
        .map_err(ni_dkg_errors::CspDkgCreateReshareTranscriptError::MalformedResharePublicCoefficientsError)?;
                // Static call:
                let transcript = clib::create_resharing_transcript(
                    threshold,
                    number_of_receivers,
                    &csp_dealings,
                    &resharing_public_coefficients,
                )?;
                // Generalise
                let transcript = CspNiDkgTranscript::Groth20_Bls12_381(transcript);
                Ok(transcript)
            }
            other => Err(
                ni_dkg_errors::CspDkgCreateReshareTranscriptError::UnsupportedAlgorithmId(other),
            ),
        }
    }
pub fn create_resharing_transcript ( algorithm_id : AlgorithmId , threshold : NumberOfNodes , number_of_receivers : NumberOfNodes , csp_dealings : BTreeMap < NodeIndex , CspNiDkgDealing > , resharing_public_coefficients : CspPublicCoefficients , ) -> Result < CspNiDkgTranscript , ni_dkg_errors :: CspDkgCreateReshareTranscriptError > { match algorithm_id { AlgorithmId :: NiDkg_Groth20_Bls12_381 => { // Specialise: let csp_dealings = specialise :: groth20 :: dealings ( csp_dealings ) . map_err ( | ( dealer_index , error ) | { ni_dkg_errors :: CspDkgCreateReshareTranscriptError :: InvalidDealingError { dealer_index , error , } } , ) ? ; let resharing_public_coefficients = specialise :: groth20 :: public_coefficients ( resharing_public_coefficients , ) . map_err ( ni_dkg_errors :: CspDkgCreateReshareTranscriptError :: MalformedResharePublicCoefficientsError ) ? ; // Static call: let transcript = clib :: create_resharing_transcript ( threshold , number_of_receivers , & csp_dealings , & resharing_public_coefficients , ) ? ; // Generalise let transcript = CspNiDkgTranscript :: Groth20_Bls12_381 ( transcript ) ; Ok ( transcript ) } other => Err ( ni_dkg_errors :: CspDkgCreateReshareTranscriptError :: UnsupportedAlgorithmId ( other ) , ) , } }
Create a CSP transcript from CSP dealings
Create a CSP transcript from CSP dealings
algorithm_id
AlgorithmId
threshold
NumberOfNodes
number_of_receivers
NumberOfNodes
csp_dealings
BTreeMap<NodeIndex, CspNiDkgDealing>
resharing_public_coefficients
CspPublicCoefficients
algorithm_id
AlgorithmId
threshold
NumberOfNodes
number_of_receivers
NumberOfNodes
csp_dealings
BTreeMap<NodeIndex, CspNiDkgDealing>
resharing_public_coefficients
CspPublicCoefficients