pub struct Sha3_224 { /* private fields */ }
Expand description
SHA3-224 streaming state.
Implementations§
Trait Implementations§
source§impl Write for Sha3_224
Available on crate feature safe_api
only.
impl Write for Sha3_224
Available on crate feature
safe_api
only.Example: hashing from a Read
er with SHA3-224.
use orion::{
hazardous::hash::sha3::sha3_224::{Sha3_224, Digest},
errors::UnknownCryptoError,
};
use std::io::{self, Read, Write};
// `reader` could also be a `File::open(...)?`.
let mut reader = io::Cursor::new(b"some data");
let mut hasher = Sha3_224::new();
std::io::copy(&mut reader, &mut hasher)?;
let digest: Digest = hasher.finalize()?;
source§fn write(&mut self, bytes: &[u8]) -> Result<usize>
fn write(&mut self, bytes: &[u8]) -> Result<usize>
Update the hasher’s internal state with all of the bytes given.
If this function returns the Ok
variant, it’s guaranteed that it
will contain the length of the buffer passed to Write
.
Note that this function is just a small wrapper over
Sha3_224::update
.
Errors:
This function will only ever return the std::io::ErrorKind::Other
variant when it returns an error. Additionally, this will always contain Orion’s
UnknownCryptoError
type.
source§fn flush(&mut self) -> Result<(), Error>
fn flush(&mut self) -> Result<(), Error>
This type doesn’t buffer writes, so flushing is a no-op.
source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
🔬This is a nightly-only experimental API. (
can_vector
)1.0.0 · source§fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Attempts to write an entire buffer into this writer. Read more
source§fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
🔬This is a nightly-only experimental API. (
write_all_vectored
)Attempts to write multiple buffers into this writer. Read more
Auto Trait Implementations§
impl RefUnwindSafe for Sha3_224
impl Send for Sha3_224
impl Sync for Sha3_224
impl Unpin for Sha3_224
impl UnwindSafe for Sha3_224
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