blob: 24507c43da1d72176696b8b64dfdeab8b5e18d14 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
<h1> Package aes </h1> <ul id="short-nav">
<li><code>import "crypto/aes"</code></li>
<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
<li><a href="#pkg-index" class="indexLink">Index</a></li>
</ul> <h2 id="pkg-overview">Overview </h2> <p>Package aes implements AES encryption (formerly Rijndael), as defined in U.S. Federal Information Processing Standards Publication 197. </p>
<p>The AES operations in this package are not implemented using constant-time algorithms. An exception is when running on systems with enabled hardware support for AES that makes these operations constant-time. Examples include amd64 systems using AES-NI extensions and s390x systems using Message-Security-Assist extensions. On such systems, when the result of NewCipher is passed to cipher.NewGCM, the GHASH operation used by GCM is also constant-time. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
<li><a href="#pkg-constants">Constants</a></li>
<li><a href="#NewCipher">func NewCipher(key []byte) (cipher.Block, error)</a></li>
<li><a href="#KeySizeError">type KeySizeError</a></li>
<li> <a href="#KeySizeError.Error">func (k KeySizeError) Error() string</a>
</li>
</ul> <h3>Package files</h3> <p> <span>aes_gcm.go</span> <span>block.go</span> <span>cipher.go</span> <span>cipher_asm.go</span> <span>const.go</span> <span>modes.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>The AES block size in bytes. </p>
<pre data-language="go">const BlockSize = 16</pre> <h2 id="NewCipher">func <span>NewCipher</span> </h2> <pre data-language="go">func NewCipher(key []byte) (cipher.Block, error)</pre> <p>NewCipher creates and returns a new <span>cipher.Block</span>. The key argument should be the AES key, either 16, 24, or 32 bytes to select AES-128, AES-192, or AES-256. </p>
<h2 id="KeySizeError">type <span>KeySizeError</span> </h2> <pre data-language="go">type KeySizeError int</pre> <h3 id="KeySizeError.Error">func (KeySizeError) <span>Error</span> </h3> <pre data-language="go">func (k KeySizeError) Error() string</pre><div class="_attribution">
<p class="_attribution-p">
© Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
<a href="http://golang.org/pkg/crypto/aes/" class="_attribution-link">http://golang.org/pkg/crypto/aes/</a>
</p>
</div>
|