blob: 861c8d22fab41a5c494fa6ef3f6717f3b17f36dd [file] [log] [blame]
<!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="Safe, fast, small crypto using Rust with BoringSSL’s cryptography primitives."><meta name="keywords" content="rust, rustlang, rust-lang, ring"><title>ring - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../normalize.css"><link rel="stylesheet" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../ayu.css" disabled><link rel="stylesheet" href="../dark.css" disabled><link rel="stylesheet" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="../crates.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.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]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../ring/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../ring/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">Crate ring</a></h2><div class="sidebar-elems"><ul class="block"><li class="version">Version 0.16.20</li><li><a id="all-types" href="all.html">All Items</a></li></ul><section><ul class="block"><li><a href="#modules">Modules</a></li><li><a href="#macros">Macros</a></li></ul></section></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn">Crate <a class="mod" href="#">ring</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="srclink" href="../src/ring/lib.rs.html#15-135">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Safe, fast, small crypto using Rust with BoringSSL’s cryptography
primitives.</p>
<h2 id="feature-flags"><a href="#feature-flags">Feature Flags</a></h2><table>
<tr><th>Feature
<th>Description
<tr><td><code>alloc (default)</code>
<td>Enable features that require use of the heap, RSA in particular.
<tr><td><code>dev_urandom_fallback (default)</code>
<td>This is only applicable to Linux. On Linux, by default,
<code>ring::rand::SystemRandom</code> will fall back to reading
from <code>/dev/urandom</code> if the <code>getrandom()</code>
syscall isn't supported at runtime. When the
<code>dev_urandom_fallback</code> feature is disabled, such
fallbacks will not occur. See the documentation for
<code>rand::SystemRandom</code> for more details.
<tr><td><code>std</code>
<td>Enable features that use libstd, in particular
<code>std::error::Error</code> integration. Implies `alloc`.
<tr><td><code>wasm32_c</code>
<td>Enables features that require a C compiler on wasm32 targets, such as
the <code>constant_time</code> module, HMAC verification, and PBKDF2
verification. Without this feature, only a subset of functionality
is provided to wasm32 targets so that a C compiler isn't needed. A
typical invocation would be:
<code>TARGET_CC=clang-10 TARGET_AR=llvm-ar-10 cargo test --target=wasm32-unknown-unknown --features=wasm32_c</code>
with <code>llvm-ar-10</code> and <code>clang-10</code> in <code>$PATH</code>.
(Going forward more functionality should be enabled by default, without
requiring these hacks, and without requiring a C compiler.)
</table></div></details><h2 id="modules" class="small-section-header"><a href="#modules">Modules</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="mod" href="aead/index.html" title="ring::aead mod">aead</a></div><div class="item-right docblock-short">Authenticated Encryption with Associated Data (AEAD).</div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="agreement/index.html" title="ring::agreement mod">agreement</a></div><div class="item-right docblock-short">Key Agreement: ECDH, including X25519.</div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="constant_time/index.html" title="ring::constant_time mod">constant_time</a></div><div class="item-right docblock-short">Constant-time operations.</div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="digest/index.html" title="ring::digest mod">digest</a></div><div class="item-right docblock-short">SHA-2 and the legacy SHA-1 digest algorithm.</div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="error/index.html" title="ring::error mod">error</a></div><div class="item-right docblock-short">Error reporting.</div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="hkdf/index.html" title="ring::hkdf mod">hkdf</a></div><div class="item-right docblock-short">HMAC-based Extract-and-Expand Key Derivation Function.</div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="hmac/index.html" title="ring::hmac mod">hmac</a></div><div class="item-right docblock-short">HMAC is specified in <a href="https://tools.ietf.org/html/rfc2104">RFC 2104</a>.</div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="io/index.html" title="ring::io mod">io</a></div><div class="item-right docblock-short">Serialization and deserialization.</div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="pbkdf2/index.html" title="ring::pbkdf2 mod">pbkdf2</a></div><div class="item-right docblock-short">PBKDF2 derivation and verification.</div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="pkcs8/index.html" title="ring::pkcs8 mod">pkcs8</a></div><div class="item-right docblock-short">PKCS#8 is specified in <a href="https://tools.ietf.org/html/rfc5958.">RFC 5958</a>.</div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="rand/index.html" title="ring::rand mod">rand</a></div><div class="item-right docblock-short">Cryptographic pseudo-random number generation.</div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="signature/index.html" title="ring::signature mod">signature</a></div><div class="item-right docblock-short">Public key signatures: signing and verification.</div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="test/index.html" title="ring::test mod">test</a></div><div class="item-right docblock-short">Testing framework.</div></div></div><h2 id="macros" class="small-section-header"><a href="#macros">Macros</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="macro" href="macro.test_file.html" title="ring::test_file macro">test_file</a></div><div class="item-right docblock-short">References a test input file.</div></div></div></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="ring" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.66.0-nightly (5c8bff74b 2022-10-21)" ></div></body></html>