pub struct X25519;
Expand description
Implementation for X25519.
Trait Implementations
sourceimpl KeGroup for X25519
impl KeGroup for X25519
The implementation of such a subgroup for Ristretto
type Pk = MontgomeryPoint
type Pk = MontgomeryPoint
Public key
type PkLen = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>
type PkLen = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>
Length of the public key
type SkLen = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>
type SkLen = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>
Length of the secret key
sourcefn serialize_pk(pk: Self::Pk) -> GenericArray<u8, Self::PkLen>
fn serialize_pk(pk: Self::Pk) -> GenericArray<u8, Self::PkLen>
Serializes
self
sourcefn deserialize_pk(bytes: &[u8]) -> Result<Self::Pk, InternalError>
fn deserialize_pk(bytes: &[u8]) -> Result<Self::Pk, InternalError>
Return a public key from its fixed-length bytes representation
sourcefn hash_to_scalar<'a, H>(
input: &[&[u8]],
dst: &[u8]
) -> Result<Self::Sk, InternalError>where
H: Digest + BlockSizeUser,
H::OutputSize: IsLess<U256> + IsLessOrEqual<H::BlockSize>,
fn hash_to_scalar<'a, H>(
input: &[&[u8]],
dst: &[u8]
) -> Result<Self::Sk, InternalError>where
H: Digest + BlockSizeUser,
H::OutputSize: IsLess<U256> + IsLessOrEqual<H::BlockSize>,
Hashes a slice of pseudo-random bytes to a scalar Read more
sourcefn is_zero_scalar(scalar: Self::Sk) -> Choice
fn is_zero_scalar(scalar: Self::Sk) -> Choice
Returns
true
if the scalar is zero.sourcefn public_key(sk: Self::Sk) -> Self::Pk
fn public_key(sk: Self::Sk) -> Self::Pk
Return a public key from its secret key
sourcefn diffie_hellman(pk: Self::Pk, sk: Self::Sk) -> GenericArray<u8, Self::PkLen>
fn diffie_hellman(pk: Self::Pk, sk: Self::Sk) -> GenericArray<u8, Self::PkLen>
Diffie-Hellman key exchange
sourcefn serialize_sk(sk: Self::Sk) -> GenericArray<u8, Self::SkLen>
fn serialize_sk(sk: Self::Sk) -> GenericArray<u8, Self::SkLen>
Serializes
self
sourcefn deserialize_sk(bytes: &[u8]) -> Result<Self::Sk, InternalError>
fn deserialize_sk(bytes: &[u8]) -> Result<Self::Sk, InternalError>
Return a public key from its fixed-length bytes representation
sourcefn derive_auth_keypair<CS: CipherSuite>(
seed: &[u8],
info: &[u8]
) -> Result<Self::Sk, InternalError>where
<CS::Hash as OutputSizeUser>::OutputSize: IsLess<U256> + IsLessOrEqual<<CS::Hash as BlockSizeUser>::BlockSize>,
fn derive_auth_keypair<CS: CipherSuite>(
seed: &[u8],
info: &[u8]
) -> Result<Self::Sk, InternalError>where
<CS::Hash as OutputSizeUser>::OutputSize: IsLess<U256> + IsLessOrEqual<<CS::Hash as BlockSizeUser>::BlockSize>,
Corresponds to the DeriveAuthKeyPair() function defined in
https://www.ietf.org/archive/id/draft-irtf-cfrg-opaque-08.html#section-6.4.2 Read more
Auto Trait Implementations
impl RefUnwindSafe for X25519
impl Send for X25519
impl Sync for X25519
impl Unpin for X25519
impl UnwindSafe for X25519
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more