/// Returns a hash of the group element and message, in the second group.
Returns a hash of the group element and message, in the second group.
Returns a hash of the group element and message in the second group .
pub fn hash_g1_g2<M: AsRef<[u8]>>(g1: G1, msg: M) -> G2 {
    // If the message is large, hash it, otherwise copy it.
    // TODO: Benchmark and optimize the threshold.
    let mut msg = if msg.as_ref().len() > 64 {
        sha3_256(msg.as_ref()).to_vec()
    } else {
        msg.as_ref().to_vec()
    };
    msg.extend(g1.into_affine().into_compressed().as_ref());
    hash_g2(&msg)
}
pub fn hash_g1_g2 < M : AsRef < [ u8 ] > > ( g1 : G1 , msg : M ) -> G2 { // If the message is large, hash it, otherwise copy it. // TODO: Benchmark and optimize the threshold. let mut msg = if msg . as_ref ( ) . len ( ) > 64 { sha3_256 ( msg . as_ref ( ) ) . to_vec ( ) } else { msg . as_ref ( ) . to_vec ( ) } ; msg . extend ( g1 . into_affine ( ) . into_compressed ( ) . as_ref ( ) ) ; hash_g2 ( & msg ) }
Returns a hash of the group element and message, in the second group.
Returns a hash of the group element and message in the second group .
g1
G1
msg
M