rawchunked

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2026 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package rawchunked implements raw mode of c2sp.org/chunked-encryption.

It assumes 16-byte AEAD overhead, and AEAD nonces of at lest 12 bytes and at most 32 bytes.

Index

Constants

View Source
const ChunkOverhead = 16
View Source
const ChunkSize = 16 * 1024

Variables

This section is empty.

Functions

func EncryptedChunkCount

func EncryptedChunkCount(encryptedSize int64) (int64, error)

func PlaintextSize

func PlaintextSize(encryptedSize int64) (int64, error)

Types

type DecryptReader

type DecryptReader struct {
	// contains filtered or unexported fields
}

func NewDecryptReader

func NewDecryptReader(aead cipher.AEAD, baseNonce []byte, src io.Reader) (*DecryptReader, error)

func (*DecryptReader) Read

func (r *DecryptReader) Read(p []byte) (int, error)

type DecryptReaderAt

type DecryptReaderAt struct {
	// contains filtered or unexported fields
}

func NewDecryptReaderAt

func NewDecryptReaderAt(aead cipher.AEAD, baseNonce []byte, src io.ReaderAt, size int64) (*DecryptReaderAt, error)

func (*DecryptReaderAt) ReadAt

func (r *DecryptReaderAt) ReadAt(p []byte, off int64) (n int, err error)

type EncryptReader

type EncryptReader struct {
	// contains filtered or unexported fields
}

func NewEncryptReader

func NewEncryptReader(aead cipher.AEAD, baseNonce []byte, src io.Reader) (*EncryptReader, error)

func (*EncryptReader) Read

func (r *EncryptReader) Read(p []byte) (int, error)

type EncryptWriter

type EncryptWriter struct {
	// contains filtered or unexported fields
}

func NewEncryptWriter

func NewEncryptWriter(aead cipher.AEAD, baseNonce []byte, dst io.Writer) (*EncryptWriter, error)

func (*EncryptWriter) Close

func (w *EncryptWriter) Close() error

Close flushes the last chunk. It does not close the underlying Writer.

func (*EncryptWriter) Write

func (w *EncryptWriter) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL