Go参考手册
加密 | crypto
crypto/subtle
import "crypto/subtle"
- 概述
- 索引
概述
Subtle 包实现了在密码学中经常使用的功能,但需要仔细考虑才能正确使用。
索引
- func ConstantTimeByteEq(x, y uint8) int
- func ConstantTimeCompare(x, y []byte) int
- func ConstantTimeCopy(v int, x, y []byte)
- func ConstantTimeEq(x, y int32) int
- func ConstantTimeLessOrEq(x, y int) int
- func ConstantTimeSelect(v, x, y int) int
文件包
constant_time.go
func ConstantTimeByteEq(查看源代码)
func ConstantTimeByteEq(x, y uint8) int
如果 x == y 则 ConstantTimeByteEq 返回1,否则返回0。
func ConstantTimeCompare(查看源代码)
func ConstantTimeCompare(x, y []byte) int
当且仅当两个切片 x和y 具有相等的内容时,ConstantTimeCompare 返回1。所花费的时间是切片长度的函数,并且与内容无关。
func ConstantTimeCopy(查看源代码)
func ConstantTimeCopy(v int, x, y []byte)
如果v == 1,ConstantTimeCopy 将y的内容复制到x(一个等长的片段)中。如果v == 0,x保持不变。如果v取任何其他值,它的行为是不确定的。
func ConstantTimeEq(查看源代码)
func ConstantTimeEq(x, y int32) int
如果x == y,则ConstantTimeEq 返回1,否则返回0。
func ConstantTimeLessOrEq(查看源代码)
func ConstantTimeLessOrEq(x, y int) int
如果x <= y,则ConstantTimeLessOrEq 返回1,否则返回0。如果x或y为负值或> 2**31 - 1,则其行为不确定。
func ConstantTimeSelect(查看源代码)
func ConstantTimeSelect(v, x, y int) int
如果v为1,则ConstantTimeSelect 返回x;如果v为0,则返回y。如果v采用任何其他值,则其行为是不确定的。
加密 | crypto相关
Go 是一种编译型语言,它结合了解释型语言的游刃有余,动态类型语言的开发效率,以及静态类型的安全性。它也打算成为现代的,支持网络与多核计算的语言。要满足这些目标,需要解决一些语言上的问题:一个富有表达能力但轻量级的类型系统,并发与垃圾回收机制,严格的依赖规范等等。这些无法通过库或工具解决好,因此Go也就应运而生了。
主页 | https://golang.org/ |
源码 | https://go.googlesource.com/go |
发布版本 | 1.9.2 |