Documentation
¶
Overview ¶
Package kt128 implements KT128 (KangarooTwelve) as specified in RFC 9861.
KT128 is a tree-hash eXtendable-Output Function (XOF) built on TurboSHAKE128. For messages larger than 8192 bytes, it splits input into chunks and computes leaf chain values in parallel using SIMD-accelerated Keccak permutations.
Index ¶
- Constants
- type Hasher
- func (h *Hasher) BlockSize() int
- func (h *Hasher) Clone() *Hasher
- func (h *Hasher) Equal(other *Hasher) int
- func (h *Hasher) Pos() uint64
- func (h *Hasher) Read(p []byte) (int, error)
- func (h *Hasher) Reset()
- func (h *Hasher) SetCustomizationString(c []byte)
- func (h *Hasher) Write(p []byte) (int, error)
Constants ¶
const (
// BlockSize is the KT128 chunk size in bytes.
BlockSize = 8192
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hasher ¶
type Hasher struct {
// contains filtered or unexported fields
}
Hasher is an incremental KT128 instance.
func (*Hasher) Clone ¶
Clone returns an independent copy of the Hasher. The original and clone evolve independently.
func (*Hasher) Equal ¶
Equal returns 1 if h and other represent identical states, 0 otherwise. The comparison is constant-time with respect to buffered data and the underlying sponge state.
func (*Hasher) Read ¶
Read squeezes output from the XOF. On the first call, it finalizes absorption with empty customization.
func (*Hasher) SetCustomizationString ¶
SetCustomizationString sets the customization string for the hasher.