Trait pairing_ce::EncodedPoint

source ·
pub trait EncodedPoint: Sized + Send + Sync + AsRef<[u8]> + AsMut<[u8]> + Clone + Copy + 'static {
    type Affine: CurveAffine;

    // Required methods
    fn empty() -> Self;
    fn size() -> usize;
    fn into_affine(&self) -> Result<Self::Affine, GroupDecodingError>;
    fn into_affine_unchecked(&self) -> Result<Self::Affine, GroupDecodingError>;
    fn from_affine(affine: Self::Affine) -> Self;
}
Expand description

An encoded elliptic curve point, which should essentially wrap a [u8; N].

Required Associated Types§

Required Methods§

source

fn empty() -> Self

Creates an empty representation.

source

fn size() -> usize

Returns the number of bytes consumed by this representation.

source

fn into_affine(&self) -> Result<Self::Affine, GroupDecodingError>

Converts an EncodedPoint into a CurveAffine element, if the encoding represents a valid element.

source

fn into_affine_unchecked(&self) -> Result<Self::Affine, GroupDecodingError>

Converts an EncodedPoint into a CurveAffine element, without guaranteeing that the encoding represents a valid element. This is useful when the caller knows the encoding is valid already.

If the encoding is invalid, this can break API invariants, so caution is strongly encouraged.

source

fn from_affine(affine: Self::Affine) -> Self

Creates an EncodedPoint from an affine point, as long as the point is not the point at infinity.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl EncodedPoint for pairing_ce::bls12_381::G1Compressed

source§

impl EncodedPoint for pairing_ce::bls12_381::G1Uncompressed

source§

impl EncodedPoint for pairing_ce::bls12_381::G2Compressed

source§

impl EncodedPoint for pairing_ce::bls12_381::G2Uncompressed

source§

impl EncodedPoint for pairing_ce::bn256::G1Compressed

source§

impl EncodedPoint for pairing_ce::bn256::G1Uncompressed

source§

impl EncodedPoint for pairing_ce::bn256::G2Compressed

source§

impl EncodedPoint for pairing_ce::bn256::G2Uncompressed

source§

impl EncodedPoint for pairing_ce::compact_bn256::G1Compressed

source§

impl EncodedPoint for pairing_ce::compact_bn256::G1Uncompressed

source§

impl EncodedPoint for pairing_ce::compact_bn256::G2Compressed

source§

impl EncodedPoint for pairing_ce::compact_bn256::G2Uncompressed