var searchIndex = {}; searchIndex["self_encryption"] = {"doc":"A file **content** self encryptor","items":[[3,"SelfEncryptor","self_encryption","This is the encryption object and all file handling should be done using this object as the low level\nmechanism to read and write *content*. This library has no knowledge of file metadata. This is\na library to ensure content is secured.",null,null],[5,"xor","","Helper function to XOR a data with a pad (pad will be rotated to fill the length)",null,null],[0,"encryption","","",null,null],[5,"encrypt","self_encryption::encryption","",null,null],[5,"decrypt","","",null,null],[0,"datamap","self_encryption","Information required to recover file content from chunks.",null,null],[3,"ChunkDetails","self_encryption::datamap","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],[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 holds the list\nof 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 are 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","","",0,{"inputs":[],"output":{"name":"chunkdetails"}}],[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 correct\npre-encryption hashes for decryption/encryption.",1,null],[11,"has_chunks","","Whether the content is stored as chunks or as raw data.",1,null],[17,"MAX_CHUNK_SIZE","self_encryption","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.\nData stored in Storage is encrypted, name is the SHA512 hash of content.\nStorage 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","","This is the only constructor for an encryptor object.\nEach SelfEncryptor is used for a single file.\nThe parameters are a DataMap and Storage.\nIf new file, use DataMap::None as first parameter.\nThe get and put of Storage need to be implemented to\nallow the SelfEncryptor to store encrypted chunks and retrieve them when necessary.",3,{"inputs":[{"name":"arc"},{"name":"datamap"}],"output":{"name":"selfencryptor"}}],[11,"get_storage","","This is an implementation of the get_storage function from example.",3,null],[11,"write","","Write method mirrors a posix type write mechanism.\nIt loosely mimics a filesystem interface for easy connection to FUSE like\nprograms as well as fine grained access to system level libraries for developers.\nThe input data will be written from the specified position (starts from 0).",3,null],[11,"read","","The returned content is read from the specified position with specified length.\nTrying to read beyond the file size will cause the self_encryptor to be truncated up\nand return content filled with 0u8 in the gap. Any other unwritten gaps will also be filled\nwith '0u8's.",3,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 flushed into storage\nwhen this function gets called.",3,null],[11,"truncate","","Truncate the self_encryptor to the specified size (if extend, filled with 0u8).",3,null],[11,"len","","Current file size as is known by encryptor.",3,null]],"paths":[[3,"ChunkDetails"],[4,"DataMap"],[8,"Storage"],[3,"SelfEncryptor"]]}; initSearch(searchIndex);