code: func (d *state) permute() {
  	switch d.state {
  	case spongeAbsorbing:
  		// If we're absorbing, we need to xor the input into the state
  		// before applying the permutation.
  		xorIn(d, d.buf)
  		d.buf = d.storage[:0]
  		keccakF1600(&d.a)
  	case spongeSqueezing:
  		// If we're squeezing, we need to apply the permutatin before
  		// copying more output.
  		keccakF1600(&d.a)
  		d.buf = d.storage[:d.rate]
  		copyOut(d, d.buf)
  	}
  }
docs: // permute applies the KeccakF-1600 permutation. It handles
  // any input-output buffering.