pub enum HashAlgorithm {
Sha256,
Sha512,
Blake3,
}Expand description
The hash functions a content address (or an integrity claim over one) may
name. The enum admits only strong functions — BLAKE3 (Aumasson, O’Connor,
Neves & Wilcox-O’Hearn 2020) and SHA-256 / SHA-512 (NIST FIPS 180-4) — so
weak functions (MD5, SHA-1)
are unrepresentable: “refuse weak algorithms” is a type invariant, not a
runtime branch. Praxis EMITS addresses under exactly one algorithm per
format epoch (ADDRESS_ALGORITHM); it VERIFIES claims under any variant
here (the W3C SRI verify-many discipline).
Variants§
Sha256
NIST FIPS 180-4 §6.2.
Sha512
NIST FIPS 180-4 §6.4.
Blake3
Aumasson, O’Connor, Neves & Wilcox-O’Hearn (2020).
Trait Implementations§
Source§impl Clone for HashAlgorithm
impl Clone for HashAlgorithm
Source§fn clone(&self) -> HashAlgorithm
fn clone(&self) -> HashAlgorithm
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for HashAlgorithm
Source§impl Debug for HashAlgorithm
impl Debug for HashAlgorithm
impl Eq for HashAlgorithm
Source§impl Hash for HashAlgorithm
impl Hash for HashAlgorithm
Source§impl PartialEq for HashAlgorithm
impl PartialEq for HashAlgorithm
Source§fn eq(&self, other: &HashAlgorithm) -> bool
fn eq(&self, other: &HashAlgorithm) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for HashAlgorithm
Auto Trait Implementations§
impl Freeze for HashAlgorithm
impl RefUnwindSafe for HashAlgorithm
impl Send for HashAlgorithm
impl Sync for HashAlgorithm
impl Unpin for HashAlgorithm
impl UnsafeUnpin for HashAlgorithm
impl UnwindSafe for HashAlgorithm
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