AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
# package aes `import "crypto/aes"` aes包实现了AES加密算法,参见U.S. Federal Information Processing Standards Publication 197。 ## Index * [Constants](#pkg-constants) * [type KeySizeError](#KeySizeError) * [func (k KeySizeError) Error() string](#KeySizeError.Error) * [func NewCipher(key []byte) (cipher.Block, error)](#NewCipher) ## Constants ``` const BlockSize = 16 ``` AES字节块大小。 ## type [KeySizeError](https://github.com/golang/go/blob/master/src/crypto/aes/cipher.go#L21 "View Source") ``` type KeySizeError int ``` ### func (KeySizeError) [Error](https://github.com/golang/go/blob/master/src/crypto/aes/cipher.go#L23 "View Source") ``` func (k KeySizeError) Error() string ``` ## func [NewCipher](https://github.com/golang/go/blob/master/src/crypto/aes/cipher.go#L31 "View Source") ``` func NewCipher(key []byte) (cipher.Block, error) ``` 创建一个cipher.Block接口。参数key为密钥,长度只能是16、24、32字节,用以选择AES-128、AES-192、AES-256。