pub struct Curve {}Expand description
Implementations§
Source§impl Curve
impl Curve
pub const fn new() -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Curve
impl<'de> Deserialize<'de> for Curve
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Dh for Curve
impl Dh for Curve
type H = CoreWrapper<CtVariableCoreWrapper<Sha256VarCore, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, OidSha256>>
Source§fn dh_exchange<SUITE: Suite>(
suite: SUITE,
own_private: <SUITE::POINT as Point>::SCALAR,
remote_public: SUITE::POINT,
) -> SUITE::POINT
fn dh_exchange<SUITE: Suite>( suite: SUITE, own_private: <SUITE::POINT as Point>::SCALAR, remote_public: SUITE::POINT, ) -> SUITE::POINT
[
dh_exchange()] computes the shared key from a private key and a public keyfn hkdf( ikm: &[u8], info: &[u8], output_size: Option<usize>, ) -> Result<Vec<u8>, DhError>
fn aes_encrypt( key: &[u8], nonce: &[u8; 12], data: &[u8], additional_data: Option<&[u8]>, ) -> Result<Vec<u8>, DhError>
fn aes_decrypt( key: &[u8], nonce: &[u8; 12], ciphertext: &[u8], additional_data: Option<&[u8]>, ) -> Result<Vec<u8>, DhError>
fn encrypt<POINT: Point>( pre_key: &POINT, info: &[u8], nonce: &[u8; 12], data: &[u8], ) -> Result<Vec<u8>, DhError>
fn decrypt<POINT: Point>( pre_key: &POINT, info: &[u8], nonce: &[u8; 12], cipher: &[u8], ) -> Result<Vec<u8>, DhError>
Source§impl Group for Curve
impl Group for Curve
Source§fn scalar(&self) -> Scalar
fn scalar(&self) -> Scalar
[scalar()] creates a new scalar for the prime-order subgroup of the Ed25519 curve.
The scalars in this package implement scalar’s [set_bytes()]
method, interpreting the bytes as a little-endian integer, in order to remain
compatible with other Ed25519 implementations, and with the standard implementation
of the EdDSA signature.
Source§fn scalar_len(&self) -> usize
fn scalar_len(&self) -> usize
[scalar_len()] returns 32, the size in bytes of an encoded Scalar
for the Ed25519 curve.
Source§fn point_len(&self) -> usize
fn point_len(&self) -> usize
[point_len()] returns 32, the size in bytes of an encoded Point on the Ed25519 curve.
type POINT = Point
Source§fn is_prime_order(&self) -> Option<bool>
fn is_prime_order(&self) -> Option<bool>
[
is_prime_order()] returns Some(true) if the group has a prime order,
if None is returned is assumes that the group has a prime orderimpl Copy for Curve
Auto Trait Implementations§
impl Freeze for Curve
impl RefUnwindSafe for Curve
impl Send for Curve
impl Sync for Curve
impl Unpin for Curve
impl UnwindSafe for Curve
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more