/// Form a protobuf structure of the public key and proof of possession
Form a protobuf structure of the public key and proof of possession
Form a protobuf structure of the public key and proof of possession
pub fn dkg_dealing_encryption_pk_to_proto(
        pk: CspFsEncryptionPublicKey,
        pop: CspFsEncryptionPop,
    ) -> PublicKeyProto {
        match (pk, pop) {
            (
                CspFsEncryptionPublicKey::Groth20_Bls12_381(fs_enc_pk),
                CspFsEncryptionPop::Groth20WithPop_Bls12_381(_),
            ) => PublicKeyProto {
                algorithm: AlgorithmIdProto::Groth20Bls12381 as i32,
                key_value: fs_enc_pk.as_bytes().to_vec(),
                version: 0,
                proof_data: Some(serde_cbor::to_vec(&pop).expect(
                    "Failed to serialize DKG dealing encryption key proof of possession (PoP) to CBOR",
                )),
            },
            _=> panic!("Unsupported types")
        }
    }
pub fn dkg_dealing_encryption_pk_to_proto ( pk : CspFsEncryptionPublicKey , pop : CspFsEncryptionPop , ) -> PublicKeyProto { match ( pk , pop ) { ( CspFsEncryptionPublicKey :: Groth20_Bls12_381 ( fs_enc_pk ) , CspFsEncryptionPop :: Groth20WithPop_Bls12_381 ( _ ) , ) => PublicKeyProto { algorithm : AlgorithmIdProto :: Groth20Bls12381 as i32 , key_value : fs_enc_pk . as_bytes ( ) . to_vec ( ) , version : 0 , proof_data : Some ( serde_cbor :: to_vec ( & pop ) . expect ( " " , ) ) , } , _ => panic ! ( " " ) } }
Form a protobuf structure of the public key and proof of possession
Form a protobuf structure of the public key and proof of possession
pk
CspFsEncryptionPublicKey
pop
CspFsEncryptionPop