Skip to main content

SessionFieldElement

Trait SessionFieldElement 

Source
pub trait SessionFieldElement {
    // Required methods
    fn random_for_session<R: CryptoRng + RngCore>(rng: &mut R) -> FieldElement;
    fn is_valid_for_session(&self) -> bool;
}
Expand description

Allows field element generation for Session Proofs

Required Methods§

Source

fn random_for_session<R: CryptoRng + RngCore>(rng: &mut R) -> FieldElement

Generate a randomized field element with a specific prefix used only for Session Proofs.

This is generally used to:

  • Generate the SessionId::oprf_seed used as input for the OPRF derivation of session_id_r_seed
  • Generate a randomized action for the nullifier input of a Session Proof
Source

fn is_valid_for_session(&self) -> bool

Returns whether a Field Element is valid for Session Proof use, i.e. it has the right prefix

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§