code: func generateKeyMaterial(out, tag []byte, r *kexResult) {
  	var digestsSoFar []byte
  
  	h := r.Hash.New()
  	for len(out) > 0 {
  		h.Reset()
  		h.Write(r.K)
  		h.Write(r.H)
  
  		if len(digestsSoFar) == 0 {
  			h.Write(tag)
  			h.Write(r.SessionID)
  		} else {
  			h.Write(digestsSoFar)
  		}
  
  		digest := h.Sum(nil)
  		n := copy(out, digest)
  		out = out[n:]
  		if len(out) > 0 {
  			digestsSoFar = append(digestsSoFar, digest...)
  		}
  	}
  }
docs: // generateKeyMaterial fills out with key material generated from tag, K, H
  // and sessionId, as specified in RFC 4253, section 7.2.