pub struct Ecc<'d, Dm: DriverMode> { /* private fields */ }Expand description
The ECC Accelerator driver.
Unlike commonly used standards, this driver operates on little-endian data.
Implementations§
Source§impl<'d, Dm: DriverMode> Ecc<'d, Dm>
impl<'d, Dm: DriverMode> Ecc<'d, Dm>
Sourcepub fn apply_config(&mut self, config: &Config)
pub fn apply_config(&mut self, config: &Config)
Applies the given configuration to the ECC peripheral.
Sourcepub fn set_interrupt_handler(&mut self, handler: InterruptHandler)
Available on crate feature unstable only.
pub fn set_interrupt_handler(&mut self, handler: InterruptHandler)
unstable only.Registers an interrupt handler for the ECC peripheral.
Replaces 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.
Sourcepub fn affine_point_multiplication<'op>(
&'op mut self,
curve: EllipticCurve,
k: &[u8],
px: &[u8],
py: &[u8],
) -> Result<EccResultHandle<'op, AffinePointMultiplication>, KeyLengthMismatch>
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
KeyLengthMismatch when the bitlength of the parameters is different from the bitlength of the prime fields of the curve.
Sourcepub fn affine_point_verification<'op>(
&'op mut self,
curve: EllipticCurve,
px: &[u8],
py: &[u8],
) -> Result<EccResultHandle<'op, AffinePointVerification>, KeyLengthMismatch>
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
KeyLengthMismatch when the bitlength of the parameters is different from the bitlength of the prime fields of the curve.
Sourcepub fn affine_point_verification_multiplication<'op>(
&'op mut self,
curve: EllipticCurve,
k: &[u8],
px: &[u8],
py: &[u8],
) -> Result<EccResultHandle<'op, AffinePointVerificationAndMultiplication>, KeyLengthMismatch>
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
KeyLengthMismatch when the bitlength of the parameters is different from the bitlength of the prime fields of the curve.
Sourcepub fn jacobian_point_multiplication<'op>(
&'op mut self,
curve: EllipticCurve,
k: &[u8],
px: &[u8],
py: &[u8],
) -> Result<EccResultHandle<'op, JacobianPointMultiplication>, KeyLengthMismatch>
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
KeyLengthMismatch when the bitlength of the parameters is different from the bitlength of the prime fields of the curve.
Sourcepub fn jacobian_point_verification<'op>(
&'op mut self,
curve: EllipticCurve,
qx: &[u8],
qy: &[u8],
qz: &[u8],
) -> Result<EccResultHandle<'op, JacobianPointVerification>, KeyLengthMismatch>
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
KeyLengthMismatch when the bitlength of the parameters is different from the bitlength of the prime fields of the curve.
Sourcepub fn affine_point_verification_jacobian_multiplication<'op>(
&'op mut self,
curve: EllipticCurve,
k: &[u8],
px: &[u8],
py: &[u8],
) -> Result<EccResultHandle<'op, AffinePointVerificationAndJacobianPointMultiplication>, KeyLengthMismatch>
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
KeyLengthMismatch when 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.
impl InterruptConfigurable for Ecc<'_, Blocking>
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.