Documentation
¶
Index ¶
- func DeriveKey(masterKey, context []byte, keyLen int) []byte
- func DeriveKeyWithLabel(masterKey []byte, label string, context []byte, keyLen int) []byte
- func DeriveMultipleKeys(masterKey []byte, labels []string, keyLen int) [][]byte
- func KMAC128(key, data []byte, customization string, outputLen int) []byte
- func KMAC256(key, data []byte, customization string, outputLen int) []byte
- func KMACXOF128(key, data []byte, customization string) *sha3.ShakeHash
- func KMACXOF256(key, data []byte, customization string) *sha3.ShakeHash
- func MAC128(key, message []byte) []byte
- func MAC256(key, message []byte) []byte
- func PRF(key []byte, counter uint64, outputLen int) []byte
- func Verify(key, message, expectedMAC []byte) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeriveKey ¶
DeriveKey 使用 KMAC256 派生密钥
参数:
- masterKey: 主密钥
- context: 上下文/标签 (用于域分离)
- keyLen: 输出密钥长度
返回:
- 派生的密钥
func DeriveKeyWithLabel ¶
DeriveKeyWithLabel 使用标签派生密钥
参数:
- masterKey: 主密钥
- label: 字符串标签
- context: 二进制上下文
- keyLen: 输出长度
func DeriveMultipleKeys ¶
DeriveMultipleKeys 派生多个密钥
func KMAC128 ¶
KMAC128 使用 KMAC128 计算 MAC 或派生密钥
参数:
- key: 密钥
- data: 输入数据
- customization: 自定义字符串 (用于域分离,可为空)
- outputLen: 输出长度 (字节)
返回:
- MAC/派生密钥
func KMACXOF128 ¶
KMACXOF128 可扩展输出函数模式 (无限输出) 返回一个 io.Reader,可按需读取任意长度的输出
func KMACXOF256 ¶
KMACXOF256 可扩展输出函数模式 (无限输出)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.