Struct opaque_ke::key_exchange::group::ristretto255::Ristretto255
source · [−]pub struct Ristretto255;
Expand description
Implementation for Ristretto255.
Trait Implementations
sourceimpl CipherSuite for Ristretto255
impl CipherSuite for Ristretto255
sourceconst ID: u16 = 1u16
const ID: u16 = 1u16
The ciphersuite identifier as dictated by
https://datatracker.ietf.org/doc/draft-irtf-cfrg-voprf/ Read more
type Group = <Ristretto255 as CipherSuite>::Group
type Group = <Ristretto255 as CipherSuite>::Group
type Hash = <Ristretto255 as CipherSuite>::Hash
type Hash = <Ristretto255 as CipherSuite>::Hash
The main hash function to use (for HKDF computations and hashing
transcripts). Read more
sourceimpl Group for Ristretto255
impl Group for Ristretto255
type Elem = <Ristretto255 as Group>::Elem
type Elem = <Ristretto255 as Group>::Elem
The type of group elements
type ElemLen = <Ristretto255 as Group>::ElemLen
type ElemLen = <Ristretto255 as Group>::ElemLen
The byte length necessary to represent group elements
type Scalar = <Ristretto255 as Group>::Scalar
type Scalar = <Ristretto255 as Group>::Scalar
The type of base field scalars
type ScalarLen = <Ristretto255 as Group>::ScalarLen
type ScalarLen = <Ristretto255 as Group>::ScalarLen
The byte length necessary to represent scalars
sourcefn hash_to_curve<H>(
input: &[&[u8]],
dst: &[u8]
) -> Result<Self::Elem, InternalError>where
H: Digest + BlockSizeUser,
H::OutputSize: IsLess<U256> + IsLessOrEqual<H::BlockSize>,
fn hash_to_curve<H>(
input: &[&[u8]],
dst: &[u8]
) -> Result<Self::Elem, InternalError>where
H: Digest + BlockSizeUser,
H::OutputSize: IsLess<U256> + IsLessOrEqual<H::BlockSize>,
Transforms a password and domain separation tag (DST) into a curve point Read more
sourcefn hash_to_scalar<H>(
input: &[&[u8]],
dst: &[u8]
) -> Result<Self::Scalar, InternalError>where
H: Digest + BlockSizeUser,
H::OutputSize: IsLess<U256> + IsLessOrEqual<H::BlockSize>,
fn hash_to_scalar<H>(
input: &[&[u8]],
dst: &[u8]
) -> Result<Self::Scalar, 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 identity_elem() -> Self::Elem
fn identity_elem() -> Self::Elem
Returns the identity group element
sourcefn serialize_elem(elem: Self::Elem) -> GenericArray<u8, Self::ElemLen>
fn serialize_elem(elem: Self::Elem) -> GenericArray<u8, Self::ElemLen>
Serializes the
self
group elementsourcefn deserialize_elem(element_bits: &[u8]) -> Result<Self::Elem>
fn deserialize_elem(element_bits: &[u8]) -> Result<Self::Elem>
Return an element from its fixed-length bytes representation. If the
element is the identity element, return an error. Read more
sourcefn invert_scalar(scalar: Self::Scalar) -> Self::Scalar
fn invert_scalar(scalar: Self::Scalar) -> Self::Scalar
The multiplicative inverse of this scalar
sourcefn is_zero_scalar(scalar: Self::Scalar) -> Choice
fn is_zero_scalar(scalar: Self::Scalar) -> Choice
Returns
true
if the scalar is zero.sourcefn serialize_scalar(scalar: Self::Scalar) -> GenericArray<u8, Self::ScalarLen>
fn serialize_scalar(scalar: Self::Scalar) -> GenericArray<u8, Self::ScalarLen>
Serializes a scalar to bytes
sourcefn deserialize_scalar(scalar_bits: &[u8]) -> Result<Self::Scalar>
fn deserialize_scalar(scalar_bits: &[u8]) -> Result<Self::Scalar>
Return a scalar from its fixed-length bytes representation. If the
scalar is zero or invalid, then return an error. Read more
sourcefn is_identity_elem(elem: Self::Elem) -> Choice
fn is_identity_elem(elem: Self::Elem) -> Choice
Returns
true
if the element is equal to the identity elementsourceimpl KeGroup for Ristretto255
impl KeGroup for Ristretto255
type Pk = RistrettoPoint
type Pk = RistrettoPoint
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 Ristretto255
impl Send for Ristretto255
impl Sync for Ristretto255
impl Unpin for Ristretto255
impl UnwindSafe for Ristretto255
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