blob: 52b3cc22b7677a05896a50ec1b5103447a5f23a1 [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="Represents a symmetric cipher context."><meta name="keywords" content="rust, rustlang, rust-lang, Crypter"><title>Crypter in openssl::symm - 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="sidebar-items.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 struct"><!--[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="../../openssl/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="../../openssl/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">Crypter</a></h2><div class="sidebar-elems"><section><h3><a href="#implementations">Methods</a></h3><ul class="block"><li><a href="#method.aad_update">aad_update</a></li><li><a href="#method.finalize">finalize</a></li><li><a href="#method.get_tag">get_tag</a></li><li><a href="#method.new">new</a></li><li><a href="#method.pad">pad</a></li><li><a href="#method.set_data_len">set_data_len</a></li><li><a href="#method.set_tag">set_tag</a></li><li><a href="#method.set_tag_len">set_tag_len</a></li><li><a href="#method.update">update</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block"><li><a href="#impl-RefUnwindSafe-for-Crypter">RefUnwindSafe</a></li><li><a href="#impl-Send-for-Crypter">Send</a></li><li><a href="#impl-Sync-for-Crypter">Sync</a></li><li><a href="#impl-Unpin-for-Crypter">Unpin</a></li><li><a href="#impl-UnwindSafe-for-Crypter">UnwindSafe</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block"><li><a href="#impl-Any-for-Crypter">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-Crypter">Borrow&lt;T&gt;</a></li><li><a href="#impl-BorrowMut%3CT%3E-for-Crypter">BorrowMut&lt;T&gt;</a></li><li><a href="#impl-From%3CT%3E-for-Crypter">From&lt;T&gt;</a></li><li><a href="#impl-Into%3CU%3E-for-Crypter">Into&lt;U&gt;</a></li><li><a href="#impl-TryFrom%3CU%3E-for-Crypter">TryFrom&lt;U&gt;</a></li><li><a href="#impl-TryInto%3CU%3E-for-Crypter">TryInto&lt;U&gt;</a></li></ul></section><h2><a href="index.html">In openssl::symm</a></h2></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">Struct <a href="../index.html">openssl</a>::<wbr><a href="index.html">symm</a>::<wbr><a class="struct" href="#">Crypter</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/openssl/symm.rs.html#481-483">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="item-decl"><pre class="rust struct"><code>pub struct Crypter { /* private fields */ }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Represents a symmetric cipher context.</p>
<p>Padding is enabled by default.</p>
<h2 id="examples"><a href="#examples">Examples</a></h2>
<p>Encrypt some plaintext in chunks, then decrypt the ciphertext back into plaintext, in AES 128
CBC mode.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>openssl::symm::{Cipher, Mode, Crypter};
<span class="kw">let </span>plaintexts: [<span class="kw-2">&amp;</span>[u8]; <span class="number">2</span>] = [<span class="string">b&quot;Some Stream of&quot;</span>, <span class="string">b&quot; Crypto Text&quot;</span>];
<span class="kw">let </span>key = <span class="string">b&quot;\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F&quot;</span>;
<span class="kw">let </span>iv = <span class="string">b&quot;\x00\x01\x02\x03\x04\x05\x06\x07\x00\x01\x02\x03\x04\x05\x06\x07&quot;</span>;
<span class="kw">let </span>data_len = plaintexts.iter().fold(<span class="number">0</span>, |sum, x| sum + x.len());
<span class="comment">// Create a cipher context for encryption.
</span><span class="kw">let </span><span class="kw-2">mut </span>encrypter = Crypter::new(
Cipher::aes_128_cbc(),
Mode::Encrypt,
key,
<span class="prelude-val">Some</span>(iv)).unwrap();
<span class="kw">let </span>block_size = Cipher::aes_128_cbc().block_size();
<span class="kw">let </span><span class="kw-2">mut </span>ciphertext = <span class="macro">vec!</span>[<span class="number">0</span>; data_len + block_size];
<span class="comment">// Encrypt 2 chunks of plaintexts successively.
</span><span class="kw">let </span><span class="kw-2">mut </span>count = encrypter.update(plaintexts[<span class="number">0</span>], <span class="kw-2">&amp;mut </span>ciphertext).unwrap();
count += encrypter.update(plaintexts[<span class="number">1</span>], <span class="kw-2">&amp;mut </span>ciphertext[count..]).unwrap();
count += encrypter.finalize(<span class="kw-2">&amp;mut </span>ciphertext[count..]).unwrap();
ciphertext.truncate(count);
<span class="macro">assert_eq!</span>(
<span class="string">b&quot;\x0F\x21\x83\x7E\xB2\x88\x04\xAF\xD9\xCC\xE2\x03\x49\xB4\x88\xF6\xC4\x61\x0E\x32\x1C\xF9\
\x0D\x66\xB1\xE6\x2C\x77\x76\x18\x8D\x99&quot;</span>,
<span class="kw-2">&amp;</span>ciphertext[..]
);
<span class="comment">// Let&#39;s pretend we don&#39;t know the plaintext, and now decrypt the ciphertext.
</span><span class="kw">let </span>data_len = ciphertext.len();
<span class="kw">let </span>ciphertexts = [<span class="kw-2">&amp;</span>ciphertext[..<span class="number">9</span>], <span class="kw-2">&amp;</span>ciphertext[<span class="number">9</span>..]];
<span class="comment">// Create a cipher context for decryption.
</span><span class="kw">let </span><span class="kw-2">mut </span>decrypter = Crypter::new(
Cipher::aes_128_cbc(),
Mode::Decrypt,
key,
<span class="prelude-val">Some</span>(iv)).unwrap();
<span class="kw">let </span><span class="kw-2">mut </span>plaintext = <span class="macro">vec!</span>[<span class="number">0</span>; data_len + block_size];
<span class="comment">// Decrypt 2 chunks of ciphertexts successively.
</span><span class="kw">let </span><span class="kw-2">mut </span>count = decrypter.update(ciphertexts[<span class="number">0</span>], <span class="kw-2">&amp;mut </span>plaintext).unwrap();
count += decrypter.update(ciphertexts[<span class="number">1</span>], <span class="kw-2">&amp;mut </span>plaintext[count..]).unwrap();
count += decrypter.finalize(<span class="kw-2">&amp;mut </span>plaintext[count..]).unwrap();
plaintext.truncate(count);
<span class="macro">assert_eq!</span>(<span class="string">b&quot;Some Stream of Crypto Text&quot;</span>, <span class="kw-2">&amp;</span>plaintext[..]);</code></pre></div>
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Crypter" class="impl has-srclink"><a class="srclink rightside" href="../../src/openssl/symm.rs.html#485-611">source</a><a href="#impl-Crypter" class="anchor"></a><h3 class="code-header">impl <a class="struct" href="struct.Crypter.html" title="struct openssl::symm::Crypter">Crypter</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.new" class="method has-srclink"><a class="srclink rightside" href="../../src/openssl/symm.rs.html#493-524">source</a><h4 class="code-header">pub fn <a href="#method.new" class="fnname">new</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;t: <a class="struct" href="struct.Cipher.html" title="struct openssl::symm::Cipher">Cipher</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;mode: <a class="enum" href="enum.Mode.html" title="enum openssl::symm::Mode">Mode</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;key: &amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>],<br>&nbsp;&nbsp;&nbsp;&nbsp;iv: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]&gt;<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="struct.Crypter.html" title="struct openssl::symm::Crypter">Crypter</a>, <a class="struct" href="../error/struct.ErrorStack.html" title="struct openssl::error::ErrorStack">ErrorStack</a>&gt;</h4></section></summary><div class="docblock"><p>Creates a new <code>Crypter</code>. The initialisation vector, <code>iv</code>, is not necessary for certain
types of <code>Cipher</code>.</p>
<h5 id="panics"><a href="#panics">Panics</a></h5>
<p>Panics if an IV is required by the cipher but not provided. Also make sure that the key
and IV size are appropriate for your cipher.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.pad" class="method has-srclink"><a class="srclink rightside" href="../../src/openssl/symm.rs.html#530-532">source</a><h4 class="code-header">pub fn <a href="#method.pad" class="fnname">pad</a>(&amp;mut self, padding: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>)</h4></section></summary><div class="docblock"><p>Enables or disables padding.</p>
<p>If padding is disabled, total amount of data encrypted/decrypted must
be a multiple of the cipher’s block size.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.set_tag" class="method has-srclink"><a class="srclink rightside" href="../../src/openssl/symm.rs.html#537-539">source</a><h4 class="code-header">pub fn <a href="#method.set_tag" class="fnname">set_tag</a>(&amp;mut self, tag: &amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="../error/struct.ErrorStack.html" title="struct openssl::error::ErrorStack">ErrorStack</a>&gt;</h4></section></summary><div class="docblock"><p>Sets the tag used to authenticate ciphertext in AEAD ciphers such as AES GCM.</p>
<p>When decrypting cipher text using an AEAD cipher, this must be called before <code>finalize</code>.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.set_tag_len" class="method has-srclink"><a class="srclink rightside" href="../../src/openssl/symm.rs.html#545-547">source</a><h4 class="code-header">pub fn <a href="#method.set_tag_len" class="fnname">set_tag_len</a>(&amp;mut self, tag_len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="../error/struct.ErrorStack.html" title="struct openssl::error::ErrorStack">ErrorStack</a>&gt;</h4></section></summary><div class="docblock"><p>Sets the length of the authentication tag to generate in AES CCM.</p>
<p>When encrypting with AES CCM, the tag length needs to be explicitly set in order
to use a value different than the default 12 bytes.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.set_data_len" class="method has-srclink"><a class="srclink rightside" href="../../src/openssl/symm.rs.html#553-555">source</a><h4 class="code-header">pub fn <a href="#method.set_data_len" class="fnname">set_data_len</a>(&amp;mut self, data_len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="../error/struct.ErrorStack.html" title="struct openssl::error::ErrorStack">ErrorStack</a>&gt;</h4></section></summary><div class="docblock"><p>Feeds total plaintext length to the cipher.</p>
<p>The total plaintext or ciphertext length MUST be passed to the cipher when it operates in
CCM mode.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.aad_update" class="method has-srclink"><a class="srclink rightside" href="../../src/openssl/symm.rs.html#562-565">source</a><h4 class="code-header">pub fn <a href="#method.aad_update" class="fnname">aad_update</a>(&amp;mut self, input: &amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="../error/struct.ErrorStack.html" title="struct openssl::error::ErrorStack">ErrorStack</a>&gt;</h4></section></summary><div class="docblock"><p>Feeds Additional Authenticated Data (AAD) through the cipher.</p>
<p>This can only be used with AEAD ciphers such as AES GCM. Data fed in is not encrypted, but
is factored into the authentication tag. It must be called before the first call to
<code>update</code>.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.update" class="method has-srclink"><a class="srclink rightside" href="../../src/openssl/symm.rs.html#581-583">source</a><h4 class="code-header">pub fn <a href="#method.update" class="fnname">update</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self,<br>&nbsp;&nbsp;&nbsp;&nbsp;input: &amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>],<br>&nbsp;&nbsp;&nbsp;&nbsp;output: &amp;mut [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="../error/struct.ErrorStack.html" title="struct openssl::error::ErrorStack">ErrorStack</a>&gt;</h4></section></summary><div class="docblock"><p>Feeds data from <code>input</code> through the cipher, writing encrypted/decrypted
bytes into <code>output</code>.</p>
<p>The number of bytes written to <code>output</code> is returned. Note that this may
not be equal to the length of <code>input</code>.</p>
<h5 id="panics-1"><a href="#panics-1">Panics</a></h5>
<p>Panics for stream ciphers if <code>output.len() &lt; input.len()</code>.</p>
<p>Panics for block ciphers if <code>output.len() &lt; input.len() + block_size</code>,
where <code>block_size</code> is the block size of the cipher (see <code>Cipher::block_size</code>).</p>
<p>Panics if <code>output.len() &gt; c_int::max_value()</code>.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.finalize" class="method has-srclink"><a class="srclink rightside" href="../../src/openssl/symm.rs.html#596-598">source</a><h4 class="code-header">pub fn <a href="#method.finalize" class="fnname">finalize</a>(&amp;mut self, output: &amp;mut [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="../error/struct.ErrorStack.html" title="struct openssl::error::ErrorStack">ErrorStack</a>&gt;</h4></section></summary><div class="docblock"><p>Finishes the encryption/decryption process, writing any remaining data
to <code>output</code>.</p>
<p>The number of bytes written to <code>output</code> is returned.</p>
<p><code>update</code> should not be called after this method.</p>
<h5 id="panics-2"><a href="#panics-2">Panics</a></h5>
<p>Panics for block ciphers if <code>output.len() &lt; block_size</code>,
where <code>block_size</code> is the block size of the cipher (see <code>Cipher::block_size</code>).</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.get_tag" class="method has-srclink"><a class="srclink rightside" href="../../src/openssl/symm.rs.html#608-610">source</a><h4 class="code-header">pub fn <a href="#method.get_tag" class="fnname">get_tag</a>(&amp;self, tag: &amp;mut [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="../error/struct.ErrorStack.html" title="struct openssl::error::ErrorStack">ErrorStack</a>&gt;</h4></section></summary><div class="docblock"><p>Retrieves the authentication tag used to authenticate ciphertext in AEAD ciphers such
as AES GCM.</p>
<p>When encrypting data with an AEAD cipher, this must be called after <code>finalize</code>.</p>
<p>The size of the buffer indicates the required size of the tag. While some ciphers support a
range of tag sizes, it is recommended to pick the maximum size. For AES GCM, this is 16
bytes, for example.</p>
</div></details></div></details></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><section id="impl-RefUnwindSafe-for-Crypter" class="impl has-srclink"><a href="#impl-RefUnwindSafe-for-Crypter" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.Crypter.html" title="struct openssl::symm::Crypter">Crypter</a></h3></section><section id="impl-Send-for-Crypter" class="impl has-srclink"><a href="#impl-Send-for-Crypter" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.Crypter.html" title="struct openssl::symm::Crypter">Crypter</a></h3></section><section id="impl-Sync-for-Crypter" class="impl has-srclink"><a href="#impl-Sync-for-Crypter" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.Crypter.html" title="struct openssl::symm::Crypter">Crypter</a></h3></section><section id="impl-Unpin-for-Crypter" class="impl has-srclink"><a href="#impl-Unpin-for-Crypter" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.Crypter.html" title="struct openssl::symm::Crypter">Crypter</a></h3></section><section id="impl-UnwindSafe-for-Crypter" class="impl has-srclink"><a href="#impl-UnwindSafe-for-Crypter" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.Crypter.html" title="struct openssl::symm::Crypter">Crypter</a></h3></section></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Any-for-Crypter" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#200">source</a><a href="#impl-Any-for-Crypter" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#201">source</a><a href="#method.type_id" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-Crypter" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211">source</a><a href="#impl-Borrow%3CT%3E-for-Crypter" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213">source</a></span><a href="#method.borrow" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-Crypter" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220">source</a><a href="#impl-BorrowMut%3CT%3E-for-Crypter" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221">source</a></span><a href="#method.borrow_mut" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-Crypter" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#733">source</a><a href="#impl-From%3CT%3E-for-Crypter" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#736">source</a></span><a href="#method.from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-Crypter" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#717">source</a><a href="#impl-Into%3CU%3E-for-Crypter" class="anchor"></a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#725">source</a></span><a href="#method.into" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -&gt; U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
<p>That is, this conversion is whatever the implementation of
<code><a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="From">From</a>&lt;T&gt; for U</code> chooses to do.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-Crypter" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#775">source</a><a href="#impl-TryFrom%3CU%3E-for-Crypter" class="anchor"></a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Error-1" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#781">source</a></span><a href="#method.try_from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-Crypter" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#760">source</a><a href="#impl-TryInto%3CU%3E-for-Crypter" class="anchor"></a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#766">source</a></span><a href="#method.try_into" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details></div></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="openssl" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.66.0-nightly (5c8bff74b 2022-10-21)" ></div></body></html>