Documentation ¶
Overview ¶
Package encryption exposes functionalities needed for encryption and decryption operations in Pen.
Index ¶
Constants ¶
View Source
const ( KeyLength = 32 ReferenceSize = 64 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChunkEncrypter ¶
type ChunkEncrypter interface {
EncryptChunk([]byte) (key Key, encryptedSpan, encryptedData []byte, err error)
}
ChunkEncrypter encrypts chunk data.
func NewChunkEncrypter ¶
func NewChunkEncrypter() ChunkEncrypter
type Encryption ¶
type Encryption struct {
// contains filtered or unexported fields
}
func (*Encryption) Decrypt ¶
func (e *Encryption) Decrypt(data []byte) ([]byte, error)
Decrypt decrypts the data, if padding was used caller must know original length and truncate
func (*Encryption) Encrypt ¶
func (e *Encryption) Encrypt(data []byte) ([]byte, error)
Encrypt encrypts the data and does padding if specified
func (*Encryption) Reset ¶
func (e *Encryption) Reset()
Reset resets the counter. It is only safe to call after an encryption operation is completed After Reset is called, the Encryption object can be re-used for other data
func (*Encryption) Transcrypt ¶
func (e *Encryption) Transcrypt(i int, in, out []byte) error
used for segmentwise transformation if in is shorter than out, padding is used
Click to show internal directories.
Click to hide internal directories.