Struct bacteria::Transcript [−][src]
pub struct Transcript { pub strobe: Strobe128, }
Expand description
A transcript of a public-coin argument.
The prover’s messages are added to the transcript using
append_message
, and the verifier’s
challenges can be computed using
challenge_bytes
.
Creating and using a Merlin transcript
To create a Merlin transcript, use Transcript::new()
. This
function takes a domain separation label which should be unique to
the application.
To use the transcript with a Merlin-based proof implementation,
the prover’s side creates a Merlin transcript with an
application-specific domain separation label, and passes a &mut
reference to the transcript to the proving function(s).
To verify the resulting proof, the verifier creates their own
Merlin transcript using the same domain separation label, then
passes a &mut
reference to the verifier’s transcript to the
verification function.
Extends Merlin transcript API that allows committing scalars and points and generating challenges as scalars.
Fields
strobe: Strobe128
Implementations
impl Transcript
[src]
impl Transcript
[src]pub fn new(label: &'static [u8]) -> Transcript
[src]
pub fn new(label: &'static [u8]) -> Transcript
[src]Initialize a new transcript with the supplied label
, which
is used as a domain separator.
Note
This function should be called by a proof library’s API consumer (i.e., the application using the proof library), and not by the proof implementation.
pub fn append_message(&mut self, label: &'static [u8], message: &[u8])
[src]
pub fn append_message(&mut self, label: &'static [u8], message: &[u8])
[src]Append a prover’s message
to the transcript.
The label
parameter is metadata about the message, and is
also appended to the transcript.
pub fn append_u64(&mut self, label: &'static [u8], x: u64)
[src]
pub fn append_u64(&mut self, label: &'static [u8], x: u64)
[src]Convenience method for appending a u64
to the transcript.
The label
parameter is metadata about the message, and is
also appended to the transcript. See the Transcript
Protocols section of
the Merlin website for details on labels.
Implementation
Calls append_message
with the 8-byte little-endian encoding
of x
.
pub fn challenge_bytes(&mut self, label: &'static [u8], dest: &mut [u8])
[src]
pub fn challenge_bytes(&mut self, label: &'static [u8], dest: &mut [u8])
[src]Fill the supplied buffer with the verifier’s challenge bytes.
The label
parameter is metadata about the challenge, and is
also appended to the transcript.
pub fn build_rng(&self) -> TranscriptRngBuilder
[src]
pub fn build_rng(&self) -> TranscriptRngBuilder
[src]Fork the current Transcript
to construct an RNG whose output is bound
to the current transcript state as well as prover’s secrets.
See the TranscriptRngBuilder
documentation for more details.
pub fn challenge_scalar(&mut self, label: &'static [u8]) -> Scalar
[src]
pub fn challenge_scalar(&mut self, label: &'static [u8]) -> Scalar
[src]Compute a label
ed challenge variable.
pub fn commit_scalar(&mut self, label: &'static [u8], scalar: &Scalar)
[src]
pub fn commit_scalar(&mut self, label: &'static [u8], scalar: &Scalar)
[src]Commit a scalar
with the given label
.
pub fn commit_point(
&mut self,
label: &'static [u8],
point: &CompressedRistretto
)
[src]
pub fn commit_point(
&mut self,
label: &'static [u8],
point: &CompressedRistretto
)
[src]Commit a point
with the given label
.
pub fn proto_name(&mut self, label: &'static [u8])
[src]
pub fn proto_name(&mut self, label: &'static [u8])
[src]Extend transcript with a protocol name
Trait Implementations
impl Clone for Transcript
[src]
impl Clone for Transcript
[src]fn clone(&self) -> Transcript
[src]
fn clone(&self) -> Transcript
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for Transcript
impl Send for Transcript
impl Sync for Transcript
impl Unpin for Transcript
impl UnwindSafe for Transcript
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T, U> Cast<U> for T where
U: FromCast<T>,
impl<T, U> Cast<U> for T where
U: FromCast<T>,
pub fn cast(self) -> U
pub fn cast(self) -> U
Numeric cast from self
to T
.
impl<T> FromBits<T> for T
impl<T> FromBits<T> for T
pub fn from_bits(t: T) -> T
pub fn from_bits(t: T) -> T
Safe lossless bitwise transmute from T
to Self
.
impl<T> FromCast<T> for T
impl<T> FromCast<T> for T
pub fn from_cast(t: T) -> T
pub fn from_cast(t: T) -> T
Numeric cast from T
to Self
.
impl<T, U> IntoBits<U> for T where
U: FromBits<T>,
impl<T, U> IntoBits<U> for T where
U: FromBits<T>,
pub fn into_bits(self) -> U
pub fn into_bits(self) -> U
Safe lossless bitwise transmute from self
to T
.
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more