code: func (s *EDStore) Encrypt(pbuf *[]byte, data []byte) ([]byte, error) {
  	var buf []byte
  	// If given a buffer, use that one
  	if pbuf != nil {
  		buf = *pbuf
  	}
  	// Make sure size is ok, expand if necessary
  	buf = util.EnsureBufBigEnough(buf, 1+s.nonceSize+s.cryptoOverhead+len(data))
  	// If buffer was passed, update the reference
  	if pbuf != nil {
  		*pbuf = buf
  	}
  	buf[0] = s.code
  	copy(buf[1:], s.nonce)
  	copy(buf[1+s.nonceSize:], data)
  	dst := buf[1+s.nonceSize : 1+s.nonceSize+len(data)]
  	ed := s.gcm.Seal(dst[:0], s.nonce, dst, nil)
  	for i := s.nonceSize - 1; i >= 0; i-- {
  		s.nonce[i]++
  		if s.nonce[i] != 0 {
  			break
  		}
  	}
  	return buf[:1+s.nonceSize+len(ed)], nil
  }
docs: // Encrypt returns the encrypted data or an error