TurboSHAKE
Generate digest bytes with TurboSHAKE128 or TurboSHAKE256 and a chosen domain separation byte.
from oxcrypto.xof.turboshake import TURBOSHAKE
algorithm = TURBOSHAKE.TURBOSHAKE256
output = algorithm.digest(b"message", 32)
tagged = algorithm.digest(b"message", 32, domain_separation=0x0B)domain_separation defaults to 0x1F, the RFC 9861 default, and accepts any
byte from 0x01 to 0x7F (RFC 9861 calls these CTurboSHAKE domains). Other
values raise ValueError. Pick a distinct byte per protocol use so outputs for
different purposes cannot collide.
TurboSHAKE is specified in RFC 9861 (Informational, IRTF CFRG, October 2025).
The implementation is the RustCrypto turboshake crate 0.7.1, a stable
release with no published audit. Tests use the RFC 9861 Appendix A
vectors, including the custom domain separation bytes.