Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Sloth ¶
type Sloth struct {
P *big.Int // 大素数模数, p ≡ 3 (mod 4)
Iterations int64 // 迭代次数 (延迟参数)
HashFunc func() hash.Hash
// contains filtered or unexported fields
}
Sloth 结构体持有 VDF 的所有参数
func (*Sloth) Compute ¶
Compute (编码) 执行可验证延迟函数 input: 任意字节数组作为输入 返回:
- hash: 最终输出的哈希值 (论文中的 g)
- witness: 用于验证的最终值 (论文中的 w)
- error: 计算过程中的错误
func (*Sloth) TauInverse ¶
tauInverse (τ⁻¹) 是 τ 的逆函数
Click to show internal directories.
Click to hide internal directories.