Skip to main content

Blake3Hasher

Struct Blake3Hasher 

Source
pub struct Blake3Hasher { /* private fields */ }
Expand description

BLAKE3 hasher. 32-byte digest (the standard BLAKE3 output width; XOF mode is not exposed at the axis level).

Trait Implementations§

Source§

impl AxisExtension for Blake3Hasher

Source§

const AXIS_ADDRESS: &'static str = <Blake3Hasher as HashAxis>::AXIS_ADDRESS

ADR-017 content address of this axis trait. The SDK macro derives this from the trait name and method signatures.
Source§

const MAX_OUTPUT_BYTES: usize = <Blake3Hasher as HashAxis>::MAX_OUTPUT_BYTES

Maximum bytes any kernel of this axis returns.
Source§

fn dispatch_kernel( kernel_id: u32, input: &[u8], out: &mut [u8], ) -> Result<usize, ShapeViolation>

Dispatch the kernel identified by kernel_id against the evaluated input bytes. The implementation copies the kernel’s output into out and returns the written length. Read more
Source§

impl Clone for Blake3Hasher

Source§

fn clone(&self) -> Blake3Hasher

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Blake3Hasher

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for Blake3Hasher

Source§

fn default() -> Blake3Hasher

Returns the “default value” for a type. Read more
Source§

impl HashAxis for Blake3Hasher

Source§

const AXIS_ADDRESS: &'static str = "https://uor.foundation/axis/HashAxis/Blake3"

Source§

const MAX_OUTPUT_BYTES: usize = BLAKE3_BYTES

Source§

fn hash(input: &[u8], out: &mut [u8]) -> Result<usize, ShapeViolation>

Compute the digest of input into out[..n], returning n. Read more
Source§

impl Hasher for Blake3Hasher

Source§

const OUTPUT_BYTES: usize = BLAKE3_BYTES

Active output width in bytes. Must lie within the bounds the application’s selected HostBounds declares — [<B as HostBounds>::FINGERPRINT_MIN_BYTES, FP_MAX].
Source§

fn initial() -> Blake3Hasher

Initial hasher state.
Source§

fn fold_byte(self, b: u8) -> Blake3Hasher

Fold a single byte into the running state.
Source§

fn fold_bytes(self, bytes: &[u8]) -> Blake3Hasher

Fold a slice of bytes (default impl: byte-by-byte).
Source§

fn finalize(self) -> [u8; 32]

Finalize into the canonical max-width buffer of FP_MAX bytes. Bytes 0..OUTPUT_BYTES carry the hash result; bytes OUTPUT_BYTES..FP_MAX MUST be zero.
Source§

impl SubstrateTermBody for Blake3Hasher

Source§

fn body_arena() -> &'static [Term]

The Term arena the kernel decomposes to. Empty slice signals a primitive-fast-path axis whose body the implementation may evaluate through dispatch_kernel directly per ADR-055’s optional fast-path.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<H> AxisTuple for H
where H: Hasher,

Source§

const AXIS_COUNT: usize = 1

Number of axes carried in this tuple.
Source§

const MAX_OUTPUT_BYTES: usize = <H as crate::enforcement::Hasher>::OUTPUT_BYTES

Maximum kernel-output byte width across all axes in this tuple.
Source§

fn dispatch( axis_index: u32, kernel_id: u32, input: &[u8], out: &mut [u8], ) -> Result<usize, ShapeViolation>

Dispatch a kernel against the axis at axis_index. Returns the kernel’s output bytes (length up to [MAX_OUTPUT_BYTES]). Read more
Source§

fn body_arena_at(_axis_index: u32) -> &'static [Term]

ADR-055: return the substrate-Term body arena for the axis at axis_index. An empty slice means the axis is a primitive-fast-path axis whose body is byte-output-equivalent to its dispatch_kernel. Non-empty slices carry the recursive-fold decomposition the catamorphism walks per ADR-055’s amended Term::AxisInvocation fold-rule.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.