Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AESCTRNonceSize ¶ added in v1.0.1
func AESCTRNonceSize() int
AESCTRNonceSize returns the AES-CTR nonce size in bytes.
func ChaCha20KeySize ¶
func ChaCha20KeySize() int
ChaCha20KeySize returns the ChaCha20 key size in bytes.
func ChaCha20NonceSize ¶
func ChaCha20NonceSize() int
ChaCha20NonceSize returns the ChaCha20 nonce size in bytes.
func XChaCha20KeySize ¶
func XChaCha20KeySize() int
XChaCha20KeySize returns the XChaCha20 key size in bytes.
func XChaCha20NonceSize ¶
func XChaCha20NonceSize() int
XChaCha20NonceSize returns the XChaCha20 nonce size in bytes.
Types ¶
type Stream ¶
type Stream interface {
// KeyStream writes len(dst) keystream bytes into dst.
KeyStream(dst []byte)
// XORKeyStream XORs the keystream with src, writing the result to dst.
// The src and dst slices may overlap.
XORKeyStream(dst, src []byte)
// Reset rewinds the stream to the supplied block counter.
Reset(counter uint32)
}
Stream represents a synchronous stream cipher that can either generate raw keystream bytes or XOR them with input in place.
func NewChaCha20 ¶
NewChaCha20 returns a ChaCha20 stream cipher implementing Stream.
Click to show internal directories.
Click to hide internal directories.