/// Decode BLS12-381 G2 point from bytes, without guaranteeing that the encoding
/// represents an element in the large prime order subgroup.
///
/// # Security Notice
///
/// This should only be used if the `bytes` are from a trusted source.
///
/// # Arguments
/// * `bytes`: a compressed instance of G2 point
/// # Errors
/// * `GroupDecodingError` if the input is invalid
/// # Returns
/// The decoded point
Decode BLS12-381 G2 point from bytes, without guaranteeing that the encoding
represents an element in the large prime order subgroup.
Decode BLS12 - 381 G2 point from bytes without guaranteeing that the encoding represents an element in the large prime order subgroup .
pub fn g2_from_bytes_unchecked(bytes: &[u8; G2_SIZE]) -> Result<G2Projective, GroupDecodingError> {
    let g2a = G2Affine::from_compressed_unchecked(bytes);
    if bool::from(g2a.is_some()) {
        Ok(G2Projective::from(g2a.unwrap()))
    } else {
        Err(GroupDecodingError::InvalidPoint)
    }
}
pub fn g2_from_bytes_unchecked ( bytes : & [ u8 ; G2_SIZE ] ) -> Result < G2Projective , GroupDecodingError > { let g2a = G2Affine :: from_compressed_unchecked ( bytes ) ; if bool :: from ( g2a . is_some ( ) ) { Ok ( G2Projective :: from ( g2a . unwrap ( ) ) ) } else { Err ( GroupDecodingError :: InvalidPoint ) } }
Decode BLS12-381 G2 point from bytes, without guaranteeing that the encoding
represents an element in the large prime order subgroup.
Decode BLS12 - 381 G2 point from bytes without guaranteeing that the encoding represents an element in the large prime order subgroup .
The decoded point
The decoded point
bytes
&[u8; G2_SIZE]
security notice
This should only be used if the `bytes` are from a trusted source.
This should only be used if the ` bytes ` are from a trusted source .
errors
`GroupDecodingError` if the input is invalid
` GroupDecodingError ` if the input is invalid