package tls

import (
	

	
)

// kyberDecapsulate implements decapsulation according to Kyber Round 3.
func ( *mlkem.DecapsulationKey768,  []byte) ([]byte, error) {
	,  := .Decapsulate()
	if  != nil {
		return nil, 
	}
	return kyberSharedSecret(, ), nil
}

func (,  []byte) []byte {
	// Package mlkem implements ML-KEM, which compared to Kyber removed a
	// final hashing step. Compute SHAKE-256(K || SHA3-256(c), 32) to match Kyber.
	// See https://words.filippo.io/mlkem768/#bonus-track-using-a-ml-kem-implementation-as-kyber-v3.
	 := sha3.NewShake256()
	.Write()
	 := sha3.New256()
	.Write()
	.Write(.Sum(nil))
	 := make([]byte, 32)
	.Read()
	return 
}