pub fn public_key_into_miracl(
    public_key_with_pop: (&FsEncryptionPublicKey, &FsEncryptionPop),
) -> Result<crypto::PublicKeyWithPop, ()> {
    let (public_key, pop) = public_key_with_pop;
    Ok(crypto::PublicKeyWithPop {
        key_value: miracl_g1_from_bytes(public_key.as_bytes())?,
        proof_data: crypto::EncryptionKeyPop {
            pop_key: miracl_g1_from_bytes(&pop.pop_key.0)?,
            challenge: miracl_fr_from_bytes(&pop.challenge.0)?,
            response: miracl_fr_from_bytes(&pop.response.0)?,
        },
    })
}
/// Parses a standard form public key into the miracl-based type.
///
/// # Errors
/// Returns an error if any of the components is not a correct group element.
Parses a standard form public key into the miracl-based type.
Parses a standard form public key into the miracl - based type .
pub fn public_key_into_miracl(
    public_key_with_pop: (&FsEncryptionPublicKey, &FsEncryptionPop),
) -> Result<crypto::PublicKeyWithPop, ()> {
    let (public_key, pop) = public_key_with_pop;
    Ok(crypto::PublicKeyWithPop {
        key_value: miracl_g1_from_bytes(public_key.as_bytes())?,
        proof_data: crypto::EncryptionKeyPop {
            pop_key: miracl_g1_from_bytes(&pop.pop_key.0)?,
            challenge: miracl_fr_from_bytes(&pop.challenge.0)?,
            response: miracl_fr_from_bytes(&pop.response.0)?,
        },
    })
}
pub fn public_key_into_miracl ( public_key_with_pop : ( & FsEncryptionPublicKey , & FsEncryptionPop ) , ) -> Result < crypto :: PublicKeyWithPop , ( ) > { let ( public_key , pop ) = public_key_with_pop ; Ok ( crypto :: PublicKeyWithPop { key_value : miracl_g1_from_bytes ( public_key . as_bytes ( ) ) ? , proof_data : crypto :: EncryptionKeyPop { pop_key : miracl_g1_from_bytes ( & pop . pop_key . 0 ) ? , challenge : miracl_fr_from_bytes ( & pop . challenge . 0 ) ? , response : miracl_fr_from_bytes ( & pop . response . 0 ) ? , } , } ) }
Parses a standard form public key into the miracl-based type.
Parses a standard form public key into the miracl - based type .
public_key_with_pop
(&FsEncryptionPublicKey, &FsEncryptionPop)
public_key_with_pop
(&FsEncryptionPublicKey, &FsEncryptionPop)
errors
Returns an error if any of the components is not a correct group element.
Returns an error if any of the components is not a correct group element .