var searchIndex = {}; searchIndex["onionsalt"] = {"doc":"The onionsalt crate.","items":[[3,"OnionBox","onionsalt","",null,null],[3,"OpenedOnionBox","","",null,null],[5,"onionbox","","Encrypt a message in an onion defined by `keys_and_routings`, with\n`payload` directed to `payload_recipient`.",null,null],[5,"onionbox_open","","The buffer already contains the message, and contains the next message\non exit.",null,null],[0,"crypto","","A rust translation of the TweetNaCl library. It is mostly a\ndirect translation, but in places I tried to make the API more\nrustic. It has three major features, of which you are likely\nto use only one.",null,null],[3,"PublicKey","onionsalt::crypto","A public key.",null,null],[12,"0","","",0,null],[3,"SecretKey","","A secret key.",null,null],[12,"0","","",1,null],[3,"Nonce","","A nonce. You should never reuse a nonce for two different\nmessages between the same set of keys.",null,null],[12,"0","","",2,null],[3,"KeyPair","","",null,null],[12,"public","","",3,null],[12,"secret","","",3,null],[4,"NaClError","","The error return type. You can get errors for only one of three reasons:",null,null],[13,"AuthFailed","","",4,null],[13,"InvalidInput","","",4,null],[13,"WrongKey","","",4,null],[13,"IOError","","",4,null],[13,"RecvError","","",4,null],[5,"secretbox","","Use symmetric encryption to encrypt a message.",null,null],[5,"secretbox_open","","Decrypt a message encrypted with `secretbox`.",null,null],[5,"funnybox_open","","Decrypt a message encrypted with `funnybox`, only authenticating\nthe first `nauth` bytes.",null,null],[5,"box_keypair","","Generate a random public/secret key pair. This is the *only*\nway you generate keys.",null,{"inputs":[],"output":{"name":"result"}}],[5,"random_nonce","","Securely creates a random nonce. This function isn't in the\nNaCl, but I feel like it could be very handy, and a random\nnonce from a secure source is often what you want.",null,{"inputs":[],"output":{"name":"result"}}],[5,"box_beforenm","","Prepare to either open or encrypt some public-key messages.\nThis is useful if you want to handle many messages between the\nsame two recipients, since it allows you to do the public-key\nbusiness just once.",null,{"inputs":[{"name":"pk"},{"name":"sk"}],"output":{"name":"result"}}],[5,"box_afternm","","Encrypt a message after creating a secret key using\n`box_beforenm`. The two functions together come out to the\nsame thing as `box_up`.",null,null],[5,"box_up","","An implementation of the NaCl function `crypto_box`, renamed\nto `crypto::box_up` because `box` is a keyword in rust.",null,null],[5,"box_open_afternm","","Decrypt a message using a key that was precomputed using\n`box_beforenm`. The two functions together are the same as\nthe easier-to-use `box_open`.",null,null],[5,"box_open","","Open a message encrypted with `crypto::box_up`.",null,null],[5,"sillybox_beforenm","","Prepare to either open or encrypt some public-key messages.\nThis is useful if you want to handle many messages between the\nsame two recipients, since it allows you to do the public-key\nbusiness just once.",null,{"inputs":[{"name":"pk"},{"name":"sk"}],"output":{"name":"result"}}],[5,"sillybox_afternm","","Encrypt a message after creating a secret key using\n`sillybox_beforenm`. The two functions together come out to the\nsame thing as `sillybox`, which you should read to find out how it\ndiffers from the standard NaCl `box` encryption.",null,null],[5,"sillybox","","An implementation of public-key encryption similar to the NaCl\nfunction `crypto_box` (renamed `crypto::sillybox_up` in this\npackage), but with the feature that it only authenticates the\nfirst `nauth` bytes. This is not useful for most purposes (thus\nits silly name), but is helpful for enabling round-trip onion\nrouting in which all the routing information is authenticated (to\ninformation leaks triggered by maliciously modified packets), but\ninformation may be added to the communication en-route.",null,null],[5,"sillybox_open_afternm","","Decrypt a message using a key that was precomputed using\n`sillybox_beforenm`. The two functions together are the same as\nthe easier-to-use `sillybox_open`.",null,null],[5,"sillybox_open","","Open a message encrypted with `crypto::sillybox_up`, only\nauthenticating the first `nauth` bytes. It is your business to\nseparately verify (or distrust) the remaining bytes. An obvious\napproach would be to nest in the remaining bytes an encrypted and\nauthenticated message.",null,null],[5,"hash","","Compute the SHA512 hash of some data.",null,null],[17,"EMPTY_PAIR","","",null,null],[8,"ToPublicKey","","A trait that is defined for types that can be used as a public\nkey. Specifically, [u8; 32], &[u8] (with possible crash on the\nwrong length) and PublicKey all implement this trait.",null,null],[10,"to_public_key","","",5,null],[8,"ToSecretKey","","A trait that is defined for types that can be used as a secret\nkey. Specifically, [u8; 32], &[u8] (with possible crash on the\nwrong length) and SecretKey all implement this trait.",null,null],[10,"to_secret_key","","",6,null],[8,"ToNonce","","A trait that is defined for types that can be used as a nonce.\nSpecifically, [u8; 32], &[u8] (with possible crash on the wrong\nlength) and Nonce all implement this trait.",null,null],[10,"to_nonce","","",7,null],[11,"fmt","","",4,null],[11,"from","","",4,{"inputs":[{"name":"error"}],"output":{"name":"naclerror"}}],[11,"from","","",4,{"inputs":[{"name":"recverror"}],"output":{"name":"naclerror"}}],[11,"from","","",4,{"inputs":[{"name":"str"}],"output":{"name":"naclerror"}}],[11,"hash","","",0,null],[11,"eq","","",0,null],[11,"ne","","",0,null],[11,"clone","","",0,null],[11,"fmt","","",0,null],[11,"new","","",0,{"inputs":[{"name":"t"}],"output":{"name":"result"}}],[11,"fmt","","",0,null],[11,"to_public_key","","",0,null],[11,"hash","","",1,null],[11,"eq","","",1,null],[11,"ne","","",1,null],[11,"clone","","",1,null],[11,"fmt","","",1,null],[11,"new","","",1,{"inputs":[{"name":"t"}],"output":{"name":"result"}}],[11,"fmt","","",1,null],[11,"to_secret_key","","",1,null],[11,"hash","","",2,null],[11,"eq","","",2,null],[11,"ne","","",2,null],[11,"clone","","",2,null],[11,"fmt","","",2,null],[11,"fmt","","",2,null],[11,"to_nonce","","",2,null],[11,"hash","","",3,null],[11,"eq","","",3,null],[11,"ne","","",3,null],[11,"clone","","",3,null],[11,"fmt","","",3,null],[0,"creatediagrams","onionsalt","",null,null],[5,"shouldbeprivate","onionsalt::creatediagrams","",null,{"inputs":[],"output":null}],[17,"OVERHEADBYTES","onionsalt","The number of extra bytes needed per recipient. Includes public\nkey and authentication bytes.",null,null],[17,"ROUTING_LENGTH","","The ROUTING_LENGTH is big enough for an ipv6 address and some\nextra information.",null,null],[17,"ROUTE_COUNT","","The number of routers we send through. Eventually I want to\nimplement the feature to send through fewer routers with the\nmessage arriving back early.",null,null],[17,"PACKET_LENGTH","","`PACKET_LENGTH` is the size that we actually send to each recipient.",null,null],[17,"ENCRYPTEDPAYLOAD_LENGTH","","`ENCRYPTEDPAYLOAD_LENGTH` is the size of the encrypted payload\nthat is intended for the primary recipient. It differs from\n`PACKET_LENGTH` by the total routing overhead.",null,null],[17,"PAYLOAD_LENGTH","","`PAYLOAD_LENGTH` is the size of the payload that the primary\nrecipient can get. It differs from `ENCRYPTEDPAYLOAD_LENGTH` by 48\n(or `OVERHEADBYTES`).",null,null],[11,"packet","","The encrypted packet, to be sent to the first receiver.",8,null],[11,"read_return","","This function accepts a packet that has been sent to us, and\ndecrypts it without authentication if it is the response to\nour original message.",8,null],[11,"add_payload","","",8,null],[11,"packet","","The packet to be forwarded onwards to the next router.",9,null],[11,"routing","","The routing information for us.",9,null],[11,"key","","The payload public key of the sender (if we are the recipient).",9,null],[11,"payload","","Attempt to decrypt and authenticate the payload.",9,null],[11,"respond","","Set `response` to the response payload information. This is\nonly likely to work correctly if the sender intended to ask us\nfor a response.",9,null]],"paths":[[3,"PublicKey"],[3,"SecretKey"],[3,"Nonce"],[3,"KeyPair"],[4,"NaClError"],[8,"ToPublicKey"],[8,"ToSecretKey"],[8,"ToNonce"],[3,"OnionBox"],[3,"OpenedOnionBox"]]}; initSearch(searchIndex);