pub fn to_compressed(&self) -> [u8; 96] {
        // Strictly speaking, self.x is zero already when self.infinity is true, but
        // to guard against implementation mistakes we do not assume this.
        let x = Fp2::conditional_select(&self.x, &Fp2::zero(), self.infinity);

        let mut res = [0; 96];

        (&mut res[0..48]).copy_from_slice(&x.c1.to_bytes()[..]);
        (&mut res[48..96]).copy_from_slice(&x.c0.to_bytes()[..]);

        // This point is in compressed form, so we set the most significant bit.
        res[0] |= 1u8 << 7;

        // Is this point at infinity? If so, set the second-most significant bit.
        res[0] |= u8::conditional_select(&0u8, &(1u8 << 6), self.infinity);

        // Is the y-coordinate the lexicographically largest of the two associated with the
        // x-coordinate? If so, set the third-most significant bit so long as this is not
        // the point at infinity.
        res[0] |= u8::conditional_select(
            &0u8,
            &(1u8 << 5),
            (!self.infinity) & self.y.lexicographically_largest(),
        );

        res
    }
/// Serializes this element into compressed form. See [`notes::serialization`](crate::notes::serialization)
/// for details about how group elements are serialized.
Serializes this element into compressed form.
Serializes this element into compressed form .
pub fn to_compressed(&self) -> [u8; 96] {
        // Strictly speaking, self.x is zero already when self.infinity is true, but
        // to guard against implementation mistakes we do not assume this.
        let x = Fp2::conditional_select(&self.x, &Fp2::zero(), self.infinity);
        let mut res = [0; 96];
        (&mut res[0..48]).copy_from_slice(&x.c1.to_bytes()[..]);
        (&mut res[48..96]).copy_from_slice(&x.c0.to_bytes()[..]);
        // This point is in compressed form, so we set the most significant bit.
        res[0] |= 1u8 << 7;
        // Is this point at infinity? If so, set the second-most significant bit.
        res[0] |= u8::conditional_select(&0u8, &(1u8 << 6), self.infinity);
        // Is the y-coordinate the lexicographically largest of the two associated with the
        // x-coordinate? If so, set the third-most significant bit so long as this is not
        // the point at infinity.
        res[0] |= u8::conditional_select(
            &0u8,
            &(1u8 << 5),
            (!self.infinity) & self.y.lexicographically_largest(),
        );
        res
    }
pub fn to_compressed ( & self ) -> [ u8 ; 96 ] { // Strictly speaking, self.x is zero already when self.infinity is true, but // to guard against implementation mistakes we do not assume this. let x = Fp2 :: conditional_select ( & self . x , & Fp2 :: zero ( ) , self . infinity ) ; let mut res = [ 0 ; 96 ] ; ( & mut res [ 0 .. 48 ] ) . copy_from_slice ( & x . c1 . to_bytes ( ) [ .. ] ) ; ( & mut res [ 48 .. 96 ] ) . copy_from_slice ( & x . c0 . to_bytes ( ) [ .. ] ) ; // This point is in compressed form, so we set the most significant bit. res [ 0 ] |= 1u8 << 7 ; // Is this point at infinity? If so, set the second-most significant bit. res [ 0 ] |= u8 :: conditional_select ( & 0u8 , & ( 1u8 << 6 ) , self . infinity ) ; // Is the y-coordinate the lexicographically largest of the two associated with the // x-coordinate? If so, set the third-most significant bit so long as this is not // the point at infinity. res [ 0 ] |= u8 :: conditional_select ( & 0u8 , & ( 1u8 << 5 ) , ( ! self . infinity ) & self . y . lexicographically_largest ( ) , ) ; res }
Serializes this element into compressed form.
Serializes this element into compressed form .
&self
&self