Documentation ¶
Index ¶
Constants ¶
View Source
const HeaderSize = 512
HeaderSize is the fixed size allocated for the header.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Header ¶
type Header struct { // ShardIndex is the index of the shard. ShardIndex int `msgpack:"i"` // ShardCount is the total number of shards. ShardCount int `msgpack:"c"` // FileHash is the SHA256 hash of the whole file plaintext. FileHash []byte `msgpack:"h"` // FileKey is one shard of the AES key used to encrypt the file plaintext. FileKey []byte `msgpack:"k"` // FileSize is the size of the file plaintext. FileSize uint64 `msgpack:"s"` // EncryptedSize is the size of the file ciphertext. EncryptedSize uint64 `msgpack:"e"` // CompressedSize is the size of the file after compression. CompressedSize uint64 `msgpack:"z"` // RSBlockSize is the size of the Reed-Solomon block. RSBlockSize int `msgpack:"b"` // AESBlockSize is the size of the AES block. AESBlockSize int `msgpack:"a"` // IsComplete marks whether the header is complete. IsComplete bool `msgpack:"o"` }
Header describes the header of a shard. This struct only contains the actual data. The full header of each shard is composed of the following:
| Description | Length | | ----------------------------- | ------ | | magic bytes `STITCHv1` | 8 | | length of header data uint16 | 2 | | header data | - | | padding to fill to 1024 bytes | - |
Click to show internal directories.
Click to hide internal directories.