pub struct Blake2bCircuit {
pub length: usize,
pub message: Vec<Wire>,
pub digest: [Wire; 8],
}Expand description
BLAKE2b circuit following single-block pattern Processes messages block-by-block like Blake2s
Fields§
§length: usizeMessage size in bytes this circuit supports
message: Vec<Wire>Witness wires for the input message (little-endian 64-bit words)
digest: [Wire; 8]Witness wires for the expected 512-bit digest (8 × 64-bit words)
Implementations§
Source§impl Blake2bCircuit
impl Blake2bCircuit
Sourcepub fn new(builder: &CircuitBuilder) -> Self
pub fn new(builder: &CircuitBuilder) -> Self
Create a new BLAKE2b circuit with standard 64-byte output
Sourcepub fn new_with_length(
builder: &CircuitBuilder,
max_msg_len_bytes: usize,
) -> Self
pub fn new_with_length( builder: &CircuitBuilder, max_msg_len_bytes: usize, ) -> Self
Create a new BLAKE2b circuit for messages up to max_msg_len_bytes
Sourcepub fn new_with_params(
builder: &CircuitBuilder,
max_msg_len_bytes: usize,
outlen: usize,
) -> Self
pub fn new_with_params( builder: &CircuitBuilder, max_msg_len_bytes: usize, outlen: usize, ) -> Self
Create a new BLAKE2b circuit with specified message length and output length
Sourcepub fn populate_message(&self, w: &mut WitnessFiller<'_>, message: &[u8])
pub fn populate_message(&self, w: &mut WitnessFiller<'_>, message: &[u8])
Populate the message data into the witness
Sourcepub fn populate_digest(&self, w: &mut WitnessFiller<'_>, digest: &[u8; 64])
pub fn populate_digest(&self, w: &mut WitnessFiller<'_>, digest: &[u8; 64])
Populate the expected digest output for verification
Auto Trait Implementations§
impl Freeze for Blake2bCircuit
impl RefUnwindSafe for Blake2bCircuit
impl Send for Blake2bCircuit
impl Sync for Blake2bCircuit
impl Unpin for Blake2bCircuit
impl UnsafeUnpin for Blake2bCircuit
impl UnwindSafe for Blake2bCircuit
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more