26 lines
11 KiB
HTML
26 lines
11 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="This crate provides traits which describe functionality of cryptographic hash functions and Message Authentication algorithms."><title>digest - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="digest" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="../crates.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Crate digest</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../digest/index.html"><img src="https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg" alt="logo"></a><h2><a href="../digest/index.html">digest</a><span class="version">0.10.7</span></h2></div><div class="sidebar-elems"><ul class="block"><li><a id="all-types" href="all.html">All Items</a></li></ul><section id="rustdoc-toc"><h3><a href="#reexports">Crate Items</a></h3><ul class="block"><li><a href="#reexports" title="Re-exports">Re-exports</a></li><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#macros" title="Macros">Macros</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#traits" title="Traits">Traits</a></li><li><a href="#types" title="Type Aliases">Type Aliases</a></li></ul></section><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><h1>Crate <span>digest</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/digest/lib.rs.html#1-301">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This crate provides traits which describe functionality of cryptographic hash
|
|
functions and Message Authentication algorithms.</p>
|
|
<p>Traits in this repository are organized into the following levels:</p>
|
|
<ul>
|
|
<li><strong>High-level convenience traits</strong>: <a href="trait.Digest.html" title="trait digest::Digest"><code>Digest</code></a>, <a href="trait.DynDigest.html" title="trait digest::DynDigest"><code>DynDigest</code></a>, [<code>Mac</code>].
|
|
Wrappers around lower-level traits for most common use-cases. Users should
|
|
usually prefer using these traits.</li>
|
|
<li><strong>Mid-level traits</strong>: <a href="trait.Update.html" title="trait digest::Update"><code>Update</code></a>, <a href="trait.FixedOutput.html" title="trait digest::FixedOutput"><code>FixedOutput</code></a>, <a href="trait.FixedOutputReset.html" title="trait digest::FixedOutputReset"><code>FixedOutputReset</code></a>,
|
|
<a href="trait.ExtendableOutput.html" title="trait digest::ExtendableOutput"><code>ExtendableOutput</code></a>, <a href="trait.ExtendableOutputReset.html" title="trait digest::ExtendableOutputReset"><code>ExtendableOutputReset</code></a>, <a href="trait.XofReader.html" title="trait digest::XofReader"><code>XofReader</code></a>,
|
|
<a href="trait.VariableOutput.html" title="trait digest::VariableOutput"><code>VariableOutput</code></a>, <a href="trait.Reset.html" title="trait digest::Reset"><code>Reset</code></a>, [<code>KeyInit</code>], and [<code>InnerInit</code>]. These
|
|
traits atomically describe available functionality of an algorithm.</li>
|
|
<li><strong>Marker traits</strong>: <a href="trait.HashMarker.html" title="trait digest::HashMarker"><code>HashMarker</code></a>, [<code>MacMarker</code>]. Used to distinguish
|
|
different algorithm classes.</li>
|
|
<li><strong>Low-level traits</strong> defined in the <a href="core_api/index.html" title="mod digest::core_api"><code>core_api</code></a> module. These traits
|
|
operate at a block-level and do not contain any built-in buffering.
|
|
They are intended to be implemented by low-level algorithm providers only.
|
|
Usually they should not be used in application-level code.</li>
|
|
</ul>
|
|
<p>Additionally hash functions implement traits from the standard library:
|
|
<a href="https://doc.rust-lang.org/1.93.1/core/default/trait.Default.html" title="trait core::default::Default"><code>Default</code></a>, <a href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone"><code>Clone</code></a>, <a href="https://doc.rust-lang.org/1.93.1/std/io/trait.Write.html" title="trait std::io::Write"><code>Write</code></a>. The latter is
|
|
feature-gated behind <code>std</code> feature, which is usually enabled by default
|
|
by hash implementation crates.</p>
|
|
</div></details><h2 id="reexports" class="section-header">Re-exports<a href="#reexports" class="anchor">§</a></h2><dl class="item-table reexports"><dt id="reexport.block_buffer"><code>pub use <a class="mod" href="../block_buffer/index.html" title="mod block_buffer">block_buffer</a>;</code></dt><dt id="reexport.crypto_common"><code>pub use <a class="mod" href="../crypto_common/index.html" title="mod crypto_common">crypto_common</a>;</code></dt><dt id="reexport.generic_array"><code>pub use crypto_common::<a class="mod" href="../generic_array/index.html" title="mod generic_array">generic_array</a>;</code></dt><dt id="reexport.typenum"><code>pub use crypto_common::<a class="mod" href="../typenum/index.html" title="mod typenum">typenum</a>;</code></dt></dl><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="consts/index.html" title="mod digest::consts">consts</a></dt><dt><a class="mod" href="core_api/index.html" title="mod digest::core_api">core_<wbr>api</a></dt><dd>Low-level traits operating on blocks and wrappers around them.</dd></dl><h2 id="macros" class="section-header">Macros<a href="#macros" class="anchor">§</a></h2><dl class="item-table"><dt><a class="macro" href="macro.impl_oid_carrier.html" title="macro digest::impl_oid_carrier">impl_<wbr>oid_<wbr>carrier</a></dt><dd>Implement dummy type with hidden docs which is used to “carry” hasher
|
|
OID for <a href="core_api/struct.CtVariableCoreWrapper.html" title="struct digest::core_api::CtVariableCoreWrapper"><code>CtVariableCoreWrapper</code></a>.</dd></dl><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.InvalidBufferSize.html" title="struct digest::InvalidBufferSize">Invalid<wbr>Buffer<wbr>Size</a></dt><dd>Buffer length is not equal to hash output size.</dd><dt><a class="struct" href="struct.InvalidOutputSize.html" title="struct digest::InvalidOutputSize">Invalid<wbr>Output<wbr>Size</a></dt><dd>The error type used in variable hash traits.</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.Digest.html" title="trait digest::Digest">Digest</a></dt><dd>Convenience wrapper trait covering functionality of cryptographic hash
|
|
functions with fixed output size.</dd><dt><a class="trait" href="trait.DynDigest.html" title="trait digest::DynDigest">DynDigest</a></dt><dd>Modification of the <a href="trait.Digest.html" title="trait digest::Digest"><code>Digest</code></a> trait suitable for trait objects.</dd><dt><a class="trait" href="trait.ExtendableOutput.html" title="trait digest::ExtendableOutput">Extendable<wbr>Output</a></dt><dd>Trait for hash functions with extendable-output (XOF).</dd><dt><a class="trait" href="trait.ExtendableOutputReset.html" title="trait digest::ExtendableOutputReset">Extendable<wbr>Output<wbr>Reset</a></dt><dd>Trait for hash functions with extendable-output (XOF) able to reset themselves.</dd><dt><a class="trait" href="trait.FixedOutput.html" title="trait digest::FixedOutput">Fixed<wbr>Output</a></dt><dd>Trait for hash functions with fixed-size output.</dd><dt><a class="trait" href="trait.FixedOutputReset.html" title="trait digest::FixedOutputReset">Fixed<wbr>Output<wbr>Reset</a></dt><dd>Trait for hash functions with fixed-size output able to reset themselves.</dd><dt><a class="trait" href="trait.HashMarker.html" title="trait digest::HashMarker">Hash<wbr>Marker</a></dt><dd>Marker trait for cryptographic hash functions.</dd><dt><a class="trait" href="trait.OutputSizeUser.html" title="trait digest::OutputSizeUser">Output<wbr>Size<wbr>User</a></dt><dd>Types which return data with the given size.</dd><dt><a class="trait" href="trait.Reset.html" title="trait digest::Reset">Reset</a></dt><dd>Resettable types.</dd><dt><a class="trait" href="trait.Update.html" title="trait digest::Update">Update</a></dt><dd>Types which consume data with byte granularity.</dd><dt><a class="trait" href="trait.VariableOutput.html" title="trait digest::VariableOutput">Variable<wbr>Output</a></dt><dd>Trait for hash functions with variable-size output.</dd><dt><a class="trait" href="trait.VariableOutputReset.html" title="trait digest::VariableOutputReset">Variable<wbr>Output<wbr>Reset</a></dt><dd>Trait for hash functions with variable-size output able to reset themselves.</dd><dt><a class="trait" href="trait.XofReader.html" title="trait digest::XofReader">XofReader</a></dt><dd>Trait for reader types which are used to extract extendable output
|
|
from a XOF (extendable-output function) result.</dd></dl><h2 id="types" class="section-header">Type Aliases<a href="#types" class="anchor">§</a></h2><dl class="item-table"><dt><a class="type" href="type.Output.html" title="type digest::Output">Output</a></dt><dd>Output array of <a href="trait.OutputSizeUser.html" title="trait digest::OutputSizeUser"><code>OutputSizeUser</code></a> implementors.</dd></dl><script type="text/json" id="notable-traits-data">{"&[u8]":"<h3>Notable traits for <code>&[<a class=\"primitive\" href=\"https://doc.rust-lang.org/1.93.1/std/primitive.u8.html\">u8</a>]</code></h3><pre><code><div class=\"where\">impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.93.1/std/io/trait.Read.html\" title=\"trait std::io::Read\">Read</a> for &[<a class=\"primitive\" href=\"https://doc.rust-lang.org/1.93.1/std/primitive.u8.html\">u8</a>]</div>"}</script></section></div></main></body></html> |