Skip to main content

TranscriptProtocol

Trait TranscriptProtocol 

Source
pub trait TranscriptProtocol {
    // Required methods
    fn new(label: &'static [u8]) -> Self
       where Self: Sized;
    fn append_message(&mut self, label: &'static [u8], message: &[u8]);
    fn append_u64(&mut self, label: &'static [u8], value: u64);
    fn challenge_bytes(&mut self, label: &'static [u8], dest: &mut [u8]);

    // Provided methods
    fn append_point<C>(
        &mut self,
        label: &'static [u8],
        point: &C::ProjectivePoint,
    )
       where C: CurveArithmetic,
             C::FieldBytesSize: ModulusSize,
             C::ProjectivePoint: ToEncodedPoint<C> { ... }
    fn append_scalar<C>(&mut self, label: &'static [u8], scalar: &C::Scalar)
       where C: CurveArithmetic,
             C::FieldBytesSize: ModulusSize,
             C::ProjectivePoint: ToEncodedPoint<C> { ... }
    fn challenge_scalar<C>(&mut self, label: &'static [u8]) -> C::Scalar
       where C: CurveArithmetic,
             C::FieldBytesSize: ModulusSize,
             C::ProjectivePoint: ToEncodedPoint<C> { ... }
    fn new_dlog_proof(
        session_id: &[u8],
        party_id: usize,
        action: &[u8],
        label: &'static [u8],
    ) -> Self
       where Self: Sized { ... }
}
Expand description

Common transcript interface used by protocol code.

Implementations provide labeled absorption and challenge generation. The primitive methods are new, append_message, append_u64, and challenge_bytes; the curve helpers have default implementations.

Required Methods§

Source

fn new(label: &'static [u8]) -> Self
where Self: Sized,

Create a new transcript with the given domain-separation label.

Source

fn append_message(&mut self, label: &'static [u8], message: &[u8])

Absorb an arbitrary byte string under a label.

Source

fn append_u64(&mut self, label: &'static [u8], value: u64)

Absorb a u64 value under a label.

Source

fn challenge_bytes(&mut self, label: &'static [u8], dest: &mut [u8])

Fill dest with challenge bytes derived from the transcript state.

Provided Methods§

Source

fn append_point<C>(&mut self, label: &'static [u8], point: &C::ProjectivePoint)

Absorb an elliptic-curve point in compressed form.

Source

fn append_scalar<C>(&mut self, label: &'static [u8], scalar: &C::Scalar)

Absorb an elliptic-curve scalar in canonical representation.

Source

fn challenge_scalar<C>(&mut self, label: &'static [u8]) -> C::Scalar

Derive a scalar challenge from the transcript.

Source

fn new_dlog_proof( session_id: &[u8], party_id: usize, action: &[u8], label: &'static [u8], ) -> Self
where Self: Sized,

Construct the transcript context used by DLog proofs.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§