-
Notifications
You must be signed in to change notification settings - Fork 148
/
Copy pathcrypto_aes.htm
47 lines (46 loc) · 2.82 KB
/
crypto_aes.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!DOCTYPE html>
<html lang="en">
<head profile="http://a9.com/-/spec/opensearch/1.1/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="../assets/site.css" rel="stylesheet">
<title>crypto/aes</title>
</head>
<body>
<div class="container">
<h2 id="pkg-overview">package aes</h2>
<p><code>import "crypto/aes"</code>
<p>aes包实现了AES加密算法,参见U.S. Federal Information Processing Standards Publication 197。</p>
<h3 id="pkg-index" class="section-header">Index <a class="permalink" href="#pkg-index">¶</a></h3>
<a href="../main.html"><h3>返回首页</h3></a>
</br>
<li><a href="#pkg-constants">Constants</a></li>
<li><a href="#KeySizeError">type KeySizeError</a></li>
<ul>
<li><a href="#KeySizeError.Error">func (k KeySizeError) Error() string</a></li>
</ul>
<li><a href="#NewCipher">func NewCipher(key []byte) (cipher.Block, error)</a></li>
</ul>
<h3 id="pkg-constants">Constants <a class="permalink" href="#pkg-index">¶</a></h3>
<pre>const <span id="BlockSize">BlockSize</span> = 16</pre>
<p>AES字节块大小。</p>
<h3 id="KeySizeError">type <a title="View Source" href="https://github.com/golang/go/blob/master/src/crypto/aes/cipher.go?name=release#21">KeySizeError</a> <a class="permalink" href="#pkg-index">¶</a></h3>
<pre>type KeySizeError <a href="builtin.htm#int">int</a></pre>
<h4 id="KeySizeError.Error">func (KeySizeError) <a title="View Source" href="https://github.com/golang/go/blob/master/src/crypto/aes/cipher.go?name=release#23">Error</a> <a class="permalink" href="#pkg-index">¶</a></h4>
<pre class="funcdecl">func (k <a href="#KeySizeError">KeySizeError</a>) Error() <a href="builtin.htm#string">string</a></pre>
<h3 id="NewCipher">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/crypto/aes/cipher.go?name=release#31">NewCipher</a> <a class="permalink" href="#pkg-index">¶</a></h3>
<pre class="funcdecl">func NewCipher(key []<a href="builtin.htm#byte">byte</a>) (<a href="crypto/cipher.htm">cipher</a>.<a href="crypto/cipher.htm#Block">Block</a>, <a href="builtin.htm#error">error</a>)</pre>
<p>创建一个cipher.Block接口。参数key为密钥,长度只能是16、24、32字节,用以选择AES-128、AES-192、AES-256。</p>
</div>
<div id="x-footer" class="clearfix">
<div class="container">
<a href="http://studygolang.com/" target="_blank">Go语言中文网</a>
<span class="text-muted">|</span> <a href="http://golang.org/" target="_blank">Go Language</a>
<span class="pull-right"><a href="#">Back to top</a></span>
</div>
</div>
<script src="../assets/jquery-2.0.3.min.js"></script>
<script src="../assets/bootstrap.min.js"></script>
<script src="../assets/site.js"></script>
</body>
</html>