Trait spake2::Group

source ·
pub trait Group {
    type Scalar;
    type Element;
    type TranscriptHash;

Show 13 methods // Required methods fn name() -> &'static str; fn const_m() -> Self::Element; fn const_n() -> Self::Element; fn const_s() -> Self::Element; fn hash_to_scalar(s: &[u8]) -> Self::Scalar; fn random_scalar<T>(cspring: &mut T) -> Self::Scalar where T: RngCore + CryptoRng; fn scalar_neg(s: &Self::Scalar) -> Self::Scalar; fn element_to_bytes(e: &Self::Element) -> Vec<u8> ; fn bytes_to_element(b: &[u8]) -> Option<Self::Element>; fn element_length() -> usize; fn basepoint_mult(s: &Self::Scalar) -> Self::Element; fn scalarmult(e: &Self::Element, s: &Self::Scalar) -> Self::Element; fn add(a: &Self::Element, b: &Self::Element) -> Self::Element;
}
Expand description

Group trait.

Required Associated Types§

source

type Scalar

Scalar element

source

type Element

Base field element

source

type TranscriptHash

Transcript hash

Required Methods§

source

fn name() -> &'static str

Name

source

fn const_m() -> Self::Element

m constant

source

fn const_n() -> Self::Element

n constant

source

fn const_s() -> Self::Element

s constant

source

fn hash_to_scalar(s: &[u8]) -> Self::Scalar

Hash to scalar

source

fn random_scalar<T>(cspring: &mut T) -> Self::Scalarwhere T: RngCore + CryptoRng,

Generate a random scalar

source

fn scalar_neg(s: &Self::Scalar) -> Self::Scalar

Scalar negation

source

fn element_to_bytes(e: &Self::Element) -> Vec<u8>

Convert base field element to bytes

source

fn bytes_to_element(b: &[u8]) -> Option<Self::Element>

Convert bytes to base field element

source

fn element_length() -> usize

Length of a base field element

source

fn basepoint_mult(s: &Self::Scalar) -> Self::Element

Fixed-base scalar multiplication

source

fn scalarmult(e: &Self::Element, s: &Self::Scalar) -> Self::Element

Variable-base scalar multiplication

source

fn add(a: &Self::Element, b: &Self::Element) -> Self::Element

Group operation

Implementors§

source§

impl Group for Ed25519Group

§

type Scalar = Scalar

§

type Element = EdwardsPoint

§

type TranscriptHash = CoreWrapper<CtVariableCoreWrapper<Sha256VarCore, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, OidSha256>>