digest

abstract suspend fun digest(algorithm: HashAlgorithm, data: ByteArray): ByteArray(source)

A digest of HashAlgorithm.outputLength bytes.

For HashAlgorithm.SHAKE256 that is the first 64 bytes of SHAKE256 (FIPS 202 §6.2), the hash of EDHOC suite 25 and of the post-quantum suites (RFC 9528 §3.6, draft-ietf-lake-pqsuites). Every backend answers it, since common code always can: one without a native SHAKE256 returns Shake256.digest(data, algorithm.outputLength) (Shake256) rather than throwing UnsupportedAlgorithmException. Its MAC is not here: KMAC256 (NIST SP 800-185), which EDHOC derives keys with for SHAKE256 suites (RFC 9528 §4.1), is common code on Keccak (Kmac256) and never goes through the backend, just as Hkdf is common code on hmac.