pub fn verify_forward_secure_key(
        algorithm_id: AlgorithmId,
        public_key: CspFsEncryptionPublicKey,
        pop: CspFsEncryptionPop,
        node_id: NodeId,
    ) -> Result<(), ni_dkg_errors::CspDkgVerifyFsKeyError> {
        // Specialisation to this scheme:
        match algorithm_id {
            AlgorithmId::NiDkg_Groth20_Bls12_381 => {
                // Specialise:
                let public_key = specialise::groth20::fs_public_key(public_key)
                    .map_err(ni_dkg_errors::CspDkgVerifyFsKeyError::MalformedPublicKeyError)?;
                let fs_pop = specialise::groth20::fs_pop(pop)
                    .map_err(ni_dkg_errors::CspDkgVerifyFsKeyError::MalformedPopError)?;

                // Call lib:
                clib::verify_forward_secure_key(&public_key, &fs_pop, node_id.get().as_slice())
                    .map_err(ni_dkg_errors::CspDkgVerifyFsKeyError::InvalidPop)
            }
            other => Err(ni_dkg_errors::CspDkgVerifyFsKeyError::UnsupportedAlgorithmId(other)),
        }
    }
/// Verifies that a forward secure public key and PoP are valid.
Verifies that a forward secure public key and PoP are valid.
Verifies that a forward secure public key and PoP are valid .
pub fn verify_forward_secure_key(
        algorithm_id: AlgorithmId,
        public_key: CspFsEncryptionPublicKey,
        pop: CspFsEncryptionPop,
        node_id: NodeId,
    ) -> Result<(), ni_dkg_errors::CspDkgVerifyFsKeyError> {
        // Specialisation to this scheme:
        match algorithm_id {
            AlgorithmId::NiDkg_Groth20_Bls12_381 => {
                // Specialise:
                let public_key = specialise::groth20::fs_public_key(public_key)
                    .map_err(ni_dkg_errors::CspDkgVerifyFsKeyError::MalformedPublicKeyError)?;
                let fs_pop = specialise::groth20::fs_pop(pop)
                    .map_err(ni_dkg_errors::CspDkgVerifyFsKeyError::MalformedPopError)?;
                // Call lib:
                clib::verify_forward_secure_key(&public_key, &fs_pop, node_id.get().as_slice())
                    .map_err(ni_dkg_errors::CspDkgVerifyFsKeyError::InvalidPop)
            }
            other => Err(ni_dkg_errors::CspDkgVerifyFsKeyError::UnsupportedAlgorithmId(other)),
        }
    }
pub fn verify_forward_secure_key ( algorithm_id : AlgorithmId , public_key : CspFsEncryptionPublicKey , pop : CspFsEncryptionPop , node_id : NodeId , ) -> Result < ( ) , ni_dkg_errors :: CspDkgVerifyFsKeyError > { // Specialisation to this scheme: match algorithm_id { AlgorithmId :: NiDkg_Groth20_Bls12_381 => { // Specialise: let public_key = specialise :: groth20 :: fs_public_key ( public_key ) . map_err ( ni_dkg_errors :: CspDkgVerifyFsKeyError :: MalformedPublicKeyError ) ? ; let fs_pop = specialise :: groth20 :: fs_pop ( pop ) . map_err ( ni_dkg_errors :: CspDkgVerifyFsKeyError :: MalformedPopError ) ? ; // Call lib: clib :: verify_forward_secure_key ( & public_key , & fs_pop , node_id . get ( ) . as_slice ( ) ) . map_err ( ni_dkg_errors :: CspDkgVerifyFsKeyError :: InvalidPop ) } other => Err ( ni_dkg_errors :: CspDkgVerifyFsKeyError :: UnsupportedAlgorithmId ( other ) ) , } }
Verifies that a forward secure public key and PoP are valid.
Verifies that a forward secure public key and PoP are valid .
algorithm_id
AlgorithmId
public_key
CspFsEncryptionPublicKey
pop
CspFsEncryptionPop
node_id
NodeId
algorithm_id
AlgorithmId
public_key
CspFsEncryptionPublicKey
pop
CspFsEncryptionPop
node_id
NodeId