mirror of
https://github.com/cheat/cheat.git
synced 2026-03-07 19:23:34 +01:00
chore(deps): upgrade dependencies
Upgrade all dependencies to newest versions.
This commit is contained in:
40
vendor/github.com/cloudflare/circl/internal/sha3/shake.go
generated
vendored
40
vendor/github.com/cloudflare/circl/internal/sha3/shake.go
generated
vendored
@@ -57,6 +57,17 @@ func NewShake128() State {
|
||||
return State{rate: rate128, dsbyte: dsbyteShake}
|
||||
}
|
||||
|
||||
// NewTurboShake128 creates a new TurboSHAKE128 variable-output-length ShakeHash.
|
||||
// Its generic security strength is 128 bits against all attacks if at
|
||||
// least 32 bytes of its output are used.
|
||||
// D is the domain separation byte and must be between 0x01 and 0x7f inclusive.
|
||||
func NewTurboShake128(D byte) State {
|
||||
if D == 0 || D > 0x7f {
|
||||
panic("turboshake: D out of range")
|
||||
}
|
||||
return State{rate: rate128, dsbyte: D, turbo: true}
|
||||
}
|
||||
|
||||
// NewShake256 creates a new SHAKE256 variable-output-length ShakeHash.
|
||||
// Its generic security strength is 256 bits against all attacks if
|
||||
// at least 64 bytes of its output are used.
|
||||
@@ -64,6 +75,17 @@ func NewShake256() State {
|
||||
return State{rate: rate256, dsbyte: dsbyteShake}
|
||||
}
|
||||
|
||||
// NewTurboShake256 creates a new TurboSHAKE256 variable-output-length ShakeHash.
|
||||
// Its generic security strength is 256 bits against all attacks if
|
||||
// at least 64 bytes of its output are used.
|
||||
// D is the domain separation byte and must be between 0x01 and 0x7f inclusive.
|
||||
func NewTurboShake256(D byte) State {
|
||||
if D == 0 || D > 0x7f {
|
||||
panic("turboshake: D out of range")
|
||||
}
|
||||
return State{rate: rate256, dsbyte: D, turbo: true}
|
||||
}
|
||||
|
||||
// ShakeSum128 writes an arbitrary-length digest of data into hash.
|
||||
func ShakeSum128(hash, data []byte) {
|
||||
h := NewShake128()
|
||||
@@ -77,3 +99,21 @@ func ShakeSum256(hash, data []byte) {
|
||||
_, _ = h.Write(data)
|
||||
_, _ = h.Read(hash)
|
||||
}
|
||||
|
||||
// TurboShakeSum128 writes an arbitrary-length digest of data into hash.
|
||||
func TurboShakeSum128(hash, data []byte, D byte) {
|
||||
h := NewTurboShake128(D)
|
||||
_, _ = h.Write(data)
|
||||
_, _ = h.Read(hash)
|
||||
}
|
||||
|
||||
// TurboShakeSum256 writes an arbitrary-length digest of data into hash.
|
||||
func TurboShakeSum256(hash, data []byte, D byte) {
|
||||
h := NewTurboShake256(D)
|
||||
_, _ = h.Write(data)
|
||||
_, _ = h.Read(hash)
|
||||
}
|
||||
|
||||
func (d *State) SwitchDS(D byte) {
|
||||
d.dsbyte = D
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user