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§
Sourcefn new(label: &'static [u8]) -> Selfwhere
Self: Sized,
fn new(label: &'static [u8]) -> Selfwhere
Self: Sized,
Create a new transcript with the given domain-separation label.
Sourcefn append_message(&mut self, label: &'static [u8], message: &[u8])
fn append_message(&mut self, label: &'static [u8], message: &[u8])
Absorb an arbitrary byte string under a label.
Sourcefn append_u64(&mut self, label: &'static [u8], value: u64)
fn append_u64(&mut self, label: &'static [u8], value: u64)
Absorb a u64 value under a label.
Sourcefn challenge_bytes(&mut self, label: &'static [u8], dest: &mut [u8])
fn challenge_bytes(&mut self, label: &'static [u8], dest: &mut [u8])
Fill dest with challenge bytes derived from the transcript state.
Provided Methods§
Sourcefn append_point<C>(&mut self, label: &'static [u8], point: &C::ProjectivePoint)
fn append_point<C>(&mut self, label: &'static [u8], point: &C::ProjectivePoint)
Absorb an elliptic-curve point in compressed form.
Sourcefn append_scalar<C>(&mut self, label: &'static [u8], scalar: &C::Scalar)
fn append_scalar<C>(&mut self, label: &'static [u8], scalar: &C::Scalar)
Absorb an elliptic-curve scalar in canonical representation.
Sourcefn challenge_scalar<C>(&mut self, label: &'static [u8]) -> C::Scalar
fn challenge_scalar<C>(&mut self, label: &'static [u8]) -> C::Scalar
Derive a scalar challenge from the transcript.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".