pub struct HarakaPipeline<const STAGES: usize> { /* private fields */ }Expand description
Prefix of the twenty-stage Haraka pipeline, for bounded validation.
STAGES must be between one and twenty inclusive. Only the full twenty
stages implement Haraka-512. Shorter instances expose the truncated,
feed-forwarded intermediate state for focused equivalence tests; they must
never be used as a cryptographic hash. Every specialization accepts one
token per cycle without backpressure and delays validity by STAGES
registered transfers. Reset flushes every in-flight token.
Four parallel shift registers, all STAGES deep, move in lock step:
input ─▶ [stage 0] ─▶ [stage 1] ─▶ ... ─▶ [stage STAGES-1] ─▶ digest
state: sub/shift mix/key (computed)
feed_forward, tag, valid: copied unchanged from stage to stageOnly valid has a reset value. The data registers do not, which keeps
them cheap (no reset fan-out) and is safe because nothing reads data
whose valid is false.
Trait Implementations§
Source§impl<const STAGES: usize> Clone for HarakaPipeline<STAGES>
impl<const STAGES: usize> Clone for HarakaPipeline<STAGES>
Source§fn clone(&self) -> HarakaPipeline<STAGES>
fn clone(&self) -> HarakaPipeline<STAGES>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<const STAGES: usize> Debug for HarakaPipeline<STAGES>
impl<const STAGES: usize> Debug for HarakaPipeline<STAGES>
Source§impl<const STAGES: usize> Default for HarakaPipeline<STAGES>
Build a pipeline of STAGES stages, checking that STAGES is legal.
impl<const STAGES: usize> Default for HarakaPipeline<STAGES>
Build a pipeline of STAGES stages, checking that STAGES is legal.
Source§impl<const STAGES: usize> Synchronous for HarakaPipeline<STAGES>
impl<const STAGES: usize> Synchronous for HarakaPipeline<STAGES>
Source§type S = (<HarakaPipeline<STAGES> as SynchronousDQ>::Q, <[DFF<[Bits<8>; 64]>; STAGES] as Synchronous>::S, <[DFF<[Bits<8>; 32]>; STAGES] as Synchronous>::S, <[DFF<Bits<32>>; STAGES] as Synchronous>::S, <[DFF<bool>; STAGES] as Synchronous>::S)
type S = (<HarakaPipeline<STAGES> as SynchronousDQ>::Q, <[DFF<[Bits<8>; 64]>; STAGES] as Synchronous>::S, <[DFF<[Bits<8>; 32]>; STAGES] as Synchronous>::S, <[DFF<Bits<32>>; STAGES] as Synchronous>::S, <[DFF<bool>; STAGES] as Synchronous>::S)
PartialEq and Clone. It holds whatever
state is needed to compute the output of the circuit given it’s input.
This state is typically auto-derived by the Synchronous derive macro,
and it’s typically a struct containing the states of all the subcircuits,
along with their last know outputs.Source§fn init(&self) -> Self::S
fn init(&self) -> Self::S
Synchronous derive macro,
and it typically initializes the states of all the subcircuits to their
initial states.Source§fn children(
&self,
parent_scope: &ScopedName,
) -> impl Iterator<Item = Result<Descriptor<SyncKind>, RHDLError>>
fn children( &self, parent_scope: &ScopedName, ) -> impl Iterator<Item = Result<Descriptor<SyncKind>, RHDLError>>
Source§fn sim(
&self,
clock_reset: ClockReset,
input: <Self as SynchronousIO>::I,
state: &mut Self::S,
) -> <Self as SynchronousIO>::O
fn sim( &self, clock_reset: ClockReset, input: <Self as SynchronousIO>::I, state: &mut Self::S, ) -> <Self as SynchronousIO>::O
§fn descriptor(
&self,
scoped_name: ScopedName,
) -> Result<Descriptor<SyncKind>, RHDLError>
fn descriptor( &self, scoped_name: ScopedName, ) -> Result<Descriptor<SyncKind>, RHDLError>
Source§impl<const STAGES: usize> SynchronousDQ for HarakaPipeline<STAGES>
impl<const STAGES: usize> SynchronousDQ for HarakaPipeline<STAGES>
Source§impl<const STAGES: usize> SynchronousIO for HarakaPipeline<STAGES>
Ports of HarakaPipeline: one block in, one digest out per clock.
impl<const STAGES: usize> SynchronousIO for HarakaPipeline<STAGES>
Ports of HarakaPipeline: one block in, one digest out per clock.
Auto Trait Implementations§
impl<const STAGES: usize> Freeze for HarakaPipeline<STAGES>
impl<const STAGES: usize> RefUnwindSafe for HarakaPipeline<STAGES>
impl<const STAGES: usize> Send for HarakaPipeline<STAGES>
impl<const STAGES: usize> Sync for HarakaPipeline<STAGES>
impl<const STAGES: usize> Unpin for HarakaPipeline<STAGES>
impl<const STAGES: usize> UnsafeUnpin for HarakaPipeline<STAGES>
impl<const STAGES: usize> UnwindSafe for HarakaPipeline<STAGES>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg] or
a color-specific method, such as [OwoColorize::green], Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg] or
a color-specific method, such as [OwoColorize::on_yellow], Read more