var searchIndex = {}; searchIndex["encryptfile"] = {"doc":"This library provides an interface to Rust Crypto([1]) for encrypting and decrypting files.\nIt provides the following features:","items":[[3,"Config","encryptfile","The main Configuration type. This is a Builder object [1].",null,null],[3,"ScryptR","","The Scrypt R parameter.",null,null],[12,"0","","",0,null],[3,"ScryptP","","The Scrypt P parameter.",null,null],[12,"0","","",1,null],[3,"ScryptLogN","","The Scrypt LogN parameter.",null,null],[12,"0","","",2,null],[4,"PasswordType","","Specifies the encryption password.",null,null],[13,"Unknown","","",3,null],[13,"Text","","Use the specified text string and PasswordKeyGenMethod.\nLeading/trailing whitespace is not trimmed on the string. Consider specifying\nsalt via `Config.salt()`.",3,null],[13,"Func","","Use the specified function to provide the key.",3,null],[4,"PasswordKeyGenMethod","","Controls how the encryption key is generated from a text password.",null,null],[13,"Scrypt","","Use the scrypt algorithm.\nhttp://www.tarsnap.com/scrypt/scrypt-slides.pdf",4,null],[13,"ReadFromFile","","",4,null],[4,"InitializationVector","","Specifies the initialization vector. Note, when decrypting, you do not need to specify\nthis since the IV is in the file.",null,null],[13,"Unknown","","",5,null],[13,"GenerateFromRng","","Generate the vector randomly. See `RngMode`.",5,null],[13,"Func","","Use the specified function to provide the IV. It should return a fully populated IV\narray.",5,null],[4,"RngMode","","Controls how random numbers are generated whenever they are needed by this library.\nCurrently this is only required when generating an initialization vector\n(`InitializationVector::GenerateFromRng`). Note, when decrypting, you do not need\nto specify this.",null,null],[13,"Os","","Use the [Os RNG](https://doc.rust-lang.org/rand/rand/os/struct.OsRng.html) only",6,null],[13,"OsIssac","","Use a combination of the Os and\n[Isaac64](https://doc.rust-lang.org/rand/rand/isaac/struct.Isaac64Rng.html) generators.\nIsaac is seeded with the Os RNG,\nand the two RNGs are used to generate the resulting IV 50/50.",6,null],[13,"OsRandIssac","","Use a combination of the Os,\n[`rand::random`](https://doc.rust-lang.org/rand/rand/fn.random.html), and Isaac.\nIsaac is seeded with the Os Rng\nand rand. Os and Isaac are used to generate the resulting IV 50/50.",6,null],[13,"Func","","Use the specified function to generate random u8 values. The function should return a\nrandom u8 each time it is called.",6,null],[4,"InputStream","","Data input streams.",null,null],[13,"Unknown","","",7,null],[13,"File","","Read from the specified file.",7,null],[4,"Mode","","The current encryption mode. Initially set to Unknown.",null,null],[13,"Unknown","","",8,null],[13,"Encrypt","","",8,null],[13,"Decrypt","","",8,null],[4,"OutputStream","","Data output streams.",null,null],[13,"Unknown","","",9,null],[13,"File","","Write to the specified file.",9,null],[4,"OutputOption","","Output options.",null,null],[13,"AllowOverwrite","","If the output file exists and this is set, it will be overwritten. If this is NOT set\nand the file exists, encryption/decryption will return an error.",10,null],[13,"IncludeKeyMetadata","","Controls whether metadata about the generated key is included (as cleartext)\nin the output file.\nFor example, if scrypt is used, the metadata contains the Log(N),R,and P\nparameters vaues that were provided to scrypt to\ngenerate the key. The metadata does not include the\noriginal password text or salt.",10,null],[4,"EncryptError","","",null,null],[13,"ValidateFailed","","",11,null],[13,"OsRngFailed","","",11,null],[13,"OutputFileExists","","",11,null],[13,"PwKeyIsZeroed","","",11,null],[13,"IvIsZeroed","","",11,null],[13,"IvEqualsCheckValue","","",11,null],[13,"HeaderTooSmall","","",11,null],[13,"ShortIvRead","","",11,null],[13,"ShortHmacRead","","",11,null],[13,"BadHeaderMagic","","",11,null],[13,"UnexpectedVersion","","",11,null],[13,"InvalidHmacLength","","",11,null],[13,"HmacMismatch","","",11,null],[13,"InvalidPasswordGenMethod","","",11,null],[13,"InvalidKeyMetadataType","","",11,null],[13,"UnexpectedEnumVariant","","",11,null],[13,"NoKeyMetadataFound","","",11,null],[13,"ByteOrderError","","",11,null],[13,"IoError","","",11,null],[13,"CryptoError","","",11,null],[13,"InternalError","","",11,null],[5,"scrypt_defaults","","Returns a set of default scrypt parameters: LogN 16, R 8, P 1.\nSee http://www.tarsnap.com/scrypt/scrypt-slides.pdf for more details.",null,{"inputs":[],"output":{"name":"passwordkeygenmethod"}}],[5,"scrypt_params_encrypt1","","Returns a set of scrypt parameters tuned for file encryption: LogN 20, R 8, P 1\nSee http://www.tarsnap.com/scrypt/scrypt-slides.pdf for more details.",null,{"inputs":[],"output":{"name":"passwordkeygenmethod"}}],[5,"process","","Process the config and produce the result. This function does not "consume" the config,\nso it can be reconfigured and reused after `process()` returns.",null,{"inputs":[{"name":"config"}],"output":{"name":"result"}}],[11,"hash","","",10,null],[11,"eq","","",10,null],[11,"new","","Constructs a new Config with default settings. At a minimum, you must set input\nstreams and a password method, and configure it for encryption or decryption.",12,{"inputs":[],"output":{"name":"self"}}],[11,"decrypt","","Enable decryption mode.",12,null],[11,"encrypt","","Enable encryption mode.",12,null],[11,"input_stream","","Set the input stream.",12,null],[11,"output_stream","","Set the output stream.",12,null],[11,"output_options","","Set output options.",12,null],[11,"add_output_option","","Add an output option.",12,null],[11,"remove_output_option","","Remove an output option.",12,null],[11,"rng_mode","","Set the random number mode. See the `RngMode` enum for information\non how this is used.",12,null],[11,"initialization_vector","","Set the method of determining the initialization vector.",12,null],[11,"password","","Set the password method.",12,null],[11,"salt","","Set the salt. Only used in password methods that require it; if not set,\ndefaults to "DefaultSalt".",12,null],[11,"encryption_method","","Set the encryption method.",12,null],[11,"buffer_size","","Set the buffer size used for encryption and decryption. Default is 65536 bytes.",12,null],[11,"validate","","Validate the encryption object; it is not necessary to call this manually since the\nconfiguration will be validated when it is used.",12,null],[11,"get_mode","","",12,null],[11,"get_input_stream","","",12,null],[11,"get_output_stream","","",12,null],[11,"get_output_format","","",12,null],[11,"get_output_options","","",12,null],[11,"get_rng_mode","","",12,null],[11,"get_initialization_vector","","",12,null],[11,"get_password","","",12,null],[11,"get_salt","","",12,null],[11,"get_encryption_method","","",12,null],[11,"get_buffer_size","","",12,null],[6,"PwKeyArray","","",null,null],[6,"IvArray","","",null,null],[17,"PW_KEY_SIZE","","",null,null],[17,"IV_SIZE","","",null,null],[11,"fmt","","",11,null],[11,"from","","",11,{"inputs":[{"name":"error"}],"output":{"name":"self"}}],[11,"from","","",11,{"inputs":[{"name":"error"}],"output":{"name":"self"}}]],"paths":[[3,"ScryptR"],[3,"ScryptP"],[3,"ScryptLogN"],[4,"PasswordType"],[4,"PasswordKeyGenMethod"],[4,"InitializationVector"],[4,"RngMode"],[4,"InputStream"],[4,"Mode"],[4,"OutputStream"],[4,"OutputOption"],[4,"EncryptError"],[3,"Config"]]}; initSearch(searchIndex);