Documentation
¶
Overview ¶
Package cobblestone implements the chunked (or streaming) encryption scheme Cobblestone-128, as described in c2sp.org/chunked-encryption.
Index ¶
- Constants
- func CiphertextSize(plaintextSize int64) int64
- func NewDecryptReader(key []byte, context string, src io.Reader) (io.Reader, error)
- func NewDecryptReaderAt(key []byte, context string, src io.ReaderAt, size int64) (io.ReaderAt, error)
- func NewEncryptReader(key []byte, context string, src io.Reader) (io.Reader, error)
- func NewEncryptWriter(key []byte, context string, dst io.Writer) (io.WriteCloser, error)
- func PlaintextSize(ciphertextSize int64) (int64, error)
Constants ¶
const KeySize = 16
Variables ¶
This section is empty.
Functions ¶
func CiphertextSize ¶
CiphertextSize returns the size of the ciphertext corresponding to a given plaintext size.
func NewDecryptReader ¶
NewDecryptReader returns a Reader that decrypts ciphertext read from src and produces the plaintext.
The key must be 16 bytes long. The context is an optional string that is included in the key derivation and commitment, and can be used to bind the ciphertext to a specific context (e.g. a filename or a user ID).
func NewDecryptReaderAt ¶
func NewDecryptReaderAt(key []byte, context string, src io.ReaderAt, size int64) (io.ReaderAt, error)
NewDecryptReaderAt returns a ReaderAt that decrypts ciphertext read from src and produces the plaintext. The size parameter is the total size of the ciphertext available through src.
The key must be 16 bytes long. The context is an optional string that is included in the key derivation and commitment, and can be used to bind the ciphertext to a specific context (e.g. a filename or a user ID).
func NewEncryptReader ¶
NewEncryptReader returns a Reader that encrypts plaintext read from src and produces the ciphertext.
The key must be 16 bytes long. The context is an optional string that is included in the key derivation and commitment, and can be used to bind the ciphertext to a specific context (e.g. a filename or a user ID).
func NewEncryptWriter ¶
NewEncryptWriter returns a WriteCloser that encrypts data written to it and writes the ciphertext to dst.
The key must be 16 bytes long. The context is an optional string that is included in the key derivation and commitment, and can be used to bind the ciphertext to a specific context (e.g. a filename or a user ID).
The caller must always call the Close method on the returned WriteCloser to flush the final chunk.
func PlaintextSize ¶
PlaintextSize returns the size of the plaintext corresponding to a given ciphertext size, or an error if the ciphertext size is invalid.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
cmd/vectors
command
Command vectors produces the c2sp.org/chunked-encryption test vectors as JSON files in testdata/vectors_aes_{128,256}_gcm.json, in the Wycheproof format (see testvectors_v1/c2sp_chunked_encryption_aes_{128,256}_gcm_test.json).
|
Command vectors produces the c2sp.org/chunked-encryption test vectors as JSON files in testdata/vectors_aes_{128,256}_gcm.json, in the Wycheproof format (see testvectors_v1/c2sp_chunked_encryption_aes_{128,256}_gcm_test.json). |
|
testkit
Package testkit provides utilities for generating chunked-encryption test vectors, including the ability to construct well-formed and malformed ciphertexts at the byte level.
|
Package testkit provides utilities for generating chunked-encryption test vectors, including the ability to construct well-formed and malformed ciphertexts at the byte level. |
|
Package rawchunked implements raw mode of c2sp.org/chunked-encryption.
|
Package rawchunked implements raw mode of c2sp.org/chunked-encryption. |