var searchIndex = {}; searchIndex["self_encryption"] = {"doc":"A file **content** self encryptor","items":[[3,"ChunkDetails","self_encryption","Struct holds pre and post encryption hashes as well as original chunk size.",null,null],[12,"chunk_num","","Index number (starts at 0)",0,null],[12,"hash","","Post encryption hash of chunk",0,null],[12,"pre_hash","","Pre encryption hash of chunk",0,null],[12,"source_size","","size before encryption (compression alters this as well as any possible padding depending\non cipher used)",0,null],[3,"Sequencer","","Optionally create a sequence of bytes via a vector or memory map.",null,null],[3,"SelfEncryptor","","This is the encryption object and all file handling should be done using this object as the low\nlevel mechanism to read and write *content*. This library has no knowledge of file metadata.\nThis is a library to ensure content is secured.",null,null],[4,"DataMap","","Holds the information that is required to recover the content of the encrypted file. Depending\non the file size, such info can be held as a vector of ChunkDetails, or as raw data.",null,null],[13,"Chunks","","If the file is large enough (larger than 3072 bytes, 3 * MIN_CHUNK_SIZE), this algorithm\nholds the list of the files chunks and corresponding hashes.",1,null],[13,"Content","","Very small files (less than 3072 bytes, 3 * MIN_CHUNK_SIZE) are not split into chunks and\nare put in here in their entirety.",1,null],[13,"None","","empty datamap",1,null],[11,"clone","","",0,null],[11,"cmp","","",0,null],[11,"partial_cmp","","",0,null],[11,"lt","","",0,null],[11,"le","","",0,null],[11,"gt","","",0,null],[11,"ge","","",0,null],[11,"eq","","",0,null],[11,"ne","","",0,null],[11,"decode","","",0,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"encode","","",0,null],[11,"new","","Holds information required for successful recovery of a chunk, as well as for the\nencryption/decryption of it's two immediate successors, modulo the number of chunks in the\ncorresponding DataMap.",0,{"inputs":[],"output":{"name":"chunkdetails"}}],[11,"fmt","","",0,null],[11,"clone","","",1,null],[11,"cmp","","",1,null],[11,"partial_cmp","","",1,null],[11,"lt","","",1,null],[11,"le","","",1,null],[11,"gt","","",1,null],[11,"ge","","",1,null],[11,"eq","","",1,null],[11,"ne","","",1,null],[11,"decode","","",1,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"encode","","",1,null],[11,"len","","Original (pre-encryption) size of file in DataMap.",1,null],[11,"get_chunks","","Returns the list of chunks pre and post encryption hashes if present.",1,null],[11,"get_sorted_chunks","","The algorithm requires this to be a sorted list to allow get_pad_iv_key to obtain the\ncorrect pre-encryption hashes for decryption/encryption.",1,null],[11,"has_chunks","","Whether the content is stored as chunks or as raw data.",1,null],[11,"fmt","","",1,null],[17,"MAX_MEMORY_MAP_SIZE","","MAX_MEMORY_MAP_SIZE defined as 1GB.",null,null],[17,"MAX_CHUNK_SIZE","","MAX_CHUNK_SIZE defined as 1MB.",null,null],[17,"MIN_CHUNK_SIZE","","MIN_CHUNK_SIZE defined as 1KB.",null,null],[8,"Storage","","Storage traits of SelfEncryptor. Data stored in Storage is encrypted, name is the SHA512 hash\nof content. Storage can be in-memory HashMap or disk based",null,null],[10,"get","","Fetch the data bearing the name",2,null],[10,"put","","Insert the data bearing the name.",2,null],[11,"new_as_vector","","Initialise as a vector.",3,{"inputs":[],"output":{"name":"sequencer"}}],[11,"new_as_mmap","","Initialise as a memory map",3,{"inputs":[],"output":{"name":"result"}}],[11,"len","","Return the current length of the sequencer.",3,null],[11,"init","","Initialise with the Sequencer with 'content'.",3,null],[11,"truncate","","Truncate internal object to given size. Note that this affects the vector only since the\nmemory map is a fixed size.",3,null],[11,"create_mapping","","Create a memory map if we haven't already done so.",3,null],[11,"to_vec","","If we are a vector return the vector otherwise return empty vector.",3,null],[11,"index","","",3,null],[11,"index_mut","","",3,null],[11,"deref","","",3,null],[11,"deref_mut","","",3,null],[11,"extend","","",3,null],[11,"new","","This is the only constructor for an encryptor object. Each SelfEncryptor is used for a\nsingle file. The parameters are a DataMap and Storage. If new file, use DataMap::None as\nfirst parameter. The get and put of Storage need to be implemented to allow the\nSelfEncryptor to store encrypted chunks and retrieve them when necessary.",4,{"inputs":[{"name":"arc"},{"name":"datamap"}],"output":{"name":"selfencryptor"}}],[11,"get_storage","","This is an implementation of the get_storage function from example.",4,null],[11,"write","","Write method mirrors a posix type write mechanism. It loosely mimics a filesystem interface\nfor easy connection to FUSE like programs as well as fine grained access to system level\nlibraries for developers. The input data will be written from the specified position\n(starts from 0).",4,null],[11,"read","","The returned content is read from the specified position with specified length. Trying to\nread beyond the file size will cause the self_encryptor to return content filled with 0u8\nin the gap (file size isn't affected). Any other unwritten gaps will also be filled with\n'0u8's.",4,null],[11,"close","","This function returns a DataMap, which is the info required to recover encrypted content\nfrom data storage location. Content temporarily held in self_encryptor will only get\nflushed into storage when this function gets called.",4,null],[11,"truncate","","Truncate the self_encryptor to the specified size (if extended, filled with 0u8).",4,null],[11,"len","","Current file size as is known by encryptor.",4,null],[11,"is_empty","","Returns true if file size as is known by encryptor == 0.",4,null],[11,"fmt","","",4,null]],"paths":[[3,"ChunkDetails"],[4,"DataMap"],[8,"Storage"],[3,"Sequencer"],[3,"SelfEncryptor"]]}; initSearch(searchIndex);