Skip to main content

Ecc

Struct Ecc 

Source
pub struct Ecc<'d, Dm: DriverMode> { /* private fields */ }
Expand description

The ECC Accelerator driver.

Note that as opposed to commonly used standards, this driver operates on little-endian data.

Implementations§

Source§

impl<'d> Ecc<'d, Blocking>

Source

pub fn new(ecc: ECC<'d>, config: Config) -> Self

Create a new instance in Blocking mode.

Source§

impl<'d, Dm: DriverMode> Ecc<'d, Dm>

Source

pub fn apply_config(&mut self, config: &Config)

Applies the given configuration to the ECC peripheral.

Source

pub fn reset(&mut self)

Resets the ECC peripheral.

Source

pub fn set_interrupt_handler(&mut self, handler: InterruptHandler)

Available on crate feature unstable only.

Register an interrupt handler for the ECC peripheral.

Note that this will replace any previously registered interrupt handlers.

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn affine_point_multiplication<'op>( &'op mut self, curve: EllipticCurve, k: &[u8], px: &[u8], py: &[u8], ) -> Result<EccResultHandle<'op, AffinePointMultiplication>, KeyLengthMismatch>

§Base Point Multiplication

This operation performs (Qx, Qy) = k * (Px, Py).

§Errors

This function will return an error if the bitlength of the parameters is different from the bitlength of the prime fields of the curve.

Source

pub fn affine_point_verification<'op>( &'op mut self, curve: EllipticCurve, px: &[u8], py: &[u8], ) -> Result<EccResultHandle<'op, AffinePointVerification>, KeyLengthMismatch>

§Base Point Verification

This operation verifies whether Point (Px, Py) is on the selected elliptic curve.

§Errors

This function will return an error if the bitlength of the parameters is different from the bitlength of the prime fields of the curve.

Source

pub fn affine_point_verification_multiplication<'op>( &'op mut self, curve: EllipticCurve, k: &[u8], px: &[u8], py: &[u8], ) -> Result<EccResultHandle<'op, AffinePointVerificationAndMultiplication>, KeyLengthMismatch>

§Base Point Verification and Multiplication

This operation verifies whether Point (Px, Py) is on the selected elliptic curve and performs (Qx, Qy) = k * (Px, Py).

§Errors

This function will return an error if the bitlength of the parameters is different from the bitlength of the prime fields of the curve.

Source

pub fn jacobian_point_multiplication<'op>( &'op mut self, curve: EllipticCurve, k: &[u8], px: &[u8], py: &[u8], ) -> Result<EccResultHandle<'op, JacobianPointMultiplication>, KeyLengthMismatch>

§Jacobian Point Multiplication

This operation performs (Qx, Qy, Qz) = k * (Px, Py, 1).

§Errors

This function will return an error if the bitlength of the parameters is different from the bitlength of the prime fields of the curve.

Source

pub fn jacobian_point_verification<'op>( &'op mut self, curve: EllipticCurve, qx: &[u8], qy: &[u8], qz: &[u8], ) -> Result<EccResultHandle<'op, JacobianPointVerification>, KeyLengthMismatch>

§Jacobian Point Verification

This operation verifies whether Point (Qx, Qy, Qz) is on the selected elliptic curve.

§Errors

This function will return an error if the bitlength of the parameters is different from the bitlength of the prime fields of the curve.

Source

pub fn affine_point_verification_jacobian_multiplication<'op>( &'op mut self, curve: EllipticCurve, k: &[u8], px: &[u8], py: &[u8], ) -> Result<EccResultHandle<'op, AffinePointVerificationAndJacobianPointMultiplication>, KeyLengthMismatch>

§Base Point Verification + Jacobian Point Multiplication

This operation first verifies whether Point (Px, Py) is on the selected elliptic curve. If yes, it performs (Qx, Qy, Qz) = k * (Px, Py, 1).

§Errors

This function will return an error if the bitlength of the parameters is different from the bitlength of the prime fields of the curve.

Trait Implementations§

Source§

impl InterruptConfigurable for Ecc<'_, Blocking>

Available on crate feature unstable only.

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source§

fn set_interrupt_handler(&mut self, handler: InterruptHandler)

Registers an interrupt handler for the peripheral. Read more

Auto Trait Implementations§

§

impl<'d, Dm> Freeze for Ecc<'d, Dm>

§

impl<'d, Dm> RefUnwindSafe for Ecc<'d, Dm>
where Dm: RefUnwindSafe,

§

impl<'d, Dm> Send for Ecc<'d, Dm>
where Dm: Send,

§

impl<'d, Dm> Sync for Ecc<'d, Dm>
where Dm: Sync,

§

impl<'d, Dm> Unpin for Ecc<'d, Dm>
where Dm: Unpin,

§

impl<'d, Dm> UnsafeUnpin for Ecc<'d, Dm>

§

impl<'d, Dm> !UnwindSafe for Ecc<'d, Dm>

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

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

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.