func NewWithRounds(key []byte, nonce []byte, rounds uint8) (cipher.Stream, error) {
	if len(key) != KeySize {
		return nil, ErrInvalidKey
	}
	if len(nonce) != NonceSize {
		return nil, ErrInvalidNonce
	}
	if (rounds != 8) && (rounds != 12) && (rounds != 20) {
		return nil, ErrInvalidRounds
	}
	s := new(stream)
	s.init(key, nonce, rounds)
	s.advance()
	return s, nil
}
NewWithRounds creates and returns a new cipher.Stream just like New but
the rounds number of 8, 12, or 20 can be specified.
package chacha20
import (
	"crypto/cipher"
	"encoding/binary"
	"errors"
	"unsafe"
)
const (
	KeySize = 32
	NonceSize = 8
	XNonceSize = 24
)
var (
	ErrInvalidKey = errors.New("invalid key length (must be 256 bits)")
	ErrInvalidNonce = errors.New("invalid nonce length (must be 64 bits)")
	ErrInvalidXNonce = errors.New("invalid nonce length (must be 192 bits)")
	ErrInvalidRounds = errors.New("invalid rounds number (must be 8, 12, or 20)")
)
func New(key []byte, nonce []byte) (cipher.Stream, error) {
	return NewWithRounds(key, nonce, 20)
}