Struct openssl::ec::EcPoint

source ·
pub struct EcPoint(_);
Expand description

Represents a point on the curve

Implementations§

Creates a new point on the specified curve.

This corresponds to EC_POINT_new.

Examples found in repository?
src/ec.rs (line 616)
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
    pub fn from_bytes(
        group: &EcGroupRef,
        buf: &[u8],
        ctx: &mut BigNumContextRef,
    ) -> Result<EcPoint, ErrorStack> {
        let point = EcPoint::new(group)?;
        unsafe {
            cvt(ffi::EC_POINT_oct2point(
                group.as_ptr(),
                point.as_ptr(),
                buf.as_ptr(),
                buf.len(),
                ctx.as_ptr(),
            ))?;
        }
        Ok(point)
    }

Creates point from a binary representation

This corresponds to EC_POINT_oct2point.

Methods from Deref<Target = EcPointRef>§

Computes a + b, storing the result in self.

This corresponds to EC_POINT_add.

Computes q * m, storing the result in self.

This corresponds to EC_POINT_mul.

Computes generator * n, storing the result in self.

This corresponds to EC_POINT_mul.

Computes generator * n + q * m, storing the result in self.

This corresponds to EC_POINT_mul.

Inverts self.

This corresponds to EC_POINT_invert.

Serializes the point to a binary representation.

This corresponds to EC_POINT_point2oct.

Creates a new point on the specified curve with the same value.

This corresponds to EC_POINT_dup.

Determines if this point is equal to another.

This corresponds to EC_POINT_cmp.

Places affine coordinates of a curve over a prime field in the provided x and y BigNums.

This corresponds to EC_POINT_get_affine_coordinates.

Places affine coordinates of a curve over a prime field in the provided x and y BigNums

This corresponds to EC_POINT_get_affine_coordinates_GFp.

Sets affine coordinates of a curve over a prime field using the provided x and y BigNums

This corresponds to EC_POINT_set_affine_coordinates_GFp.

Places affine coordinates of a curve over a binary field in the provided x and y BigNums

This corresponds to EC_POINT_get_affine_coordinates_GF2m.

Checks if point is infinity

This corresponds to EC_POINT_is_at_infinity.

Checks if point is on a given curve

This corresponds to EC_POINT_is_on_curve.

Trait Implementations§

Converts this type into a shared reference of the (usually inferred) input type.
Immutably borrows from an owned value. Read more
The resulting type after dereferencing.
Dereferences the value.
Mutably dereferences the value.
Executes the destructor for this type. Read more
The raw C type.
The type representing a reference to this type.
Constructs an instance of this type from its raw type.
Returns a raw pointer to the wrapped value.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.