var searchIndex = {}; searchIndex["ntru"] = {"doc":"This crate implements the NTRUEncrypt library in Rust. It is an interface to libntru, even\nthough many of the methods are being implemented in pure Rust. The plan is to gradually\nimplement the library natively. It uses this library since it has proven to be faster than the\noriginal NTRUEncrypt implementation. In any case, it is much faster than usual encryption /\ndecryption mecanisms, and quantum-proof. More on NTRUEncrypt\n[here](https://en.wikipedia.org/wiki/NTRUEncrypt).","items":[[5,"generate_key_pair","ntru","Key generation",null,{"inputs":[{"name":"encparams"},{"name":"randcontext"}],"output":{"name":"result"}}],[5,"generate_multiple_key_pairs","","Key generation with multiple public keys",null,{"inputs":[{"name":"encparams"},{"name":"randcontext"},{"name":"usize"}],"output":{"name":"result"}}],[5,"generate_public","","New public key",null,{"inputs":[{"name":"encparams"},{"name":"privatekey"},{"name":"randcontext"}],"output":{"name":"result"}}],[5,"encrypt","","Encrypts a message",null,null],[5,"decrypt","","Decrypts a message.",null,null],[0,"types","","NTRUEncrypt type definitions",null,null],[3,"IntPoly","ntru::types","A polynomial with integer coefficients.",null,null],[3,"TernPoly","","A ternary polynomial, i.e. all coefficients are equal to -1, 0, or 1.",null,null],[3,"ProdPoly","","A product-form polynomial, i.e. a polynomial of the form f1*f2+f3 where f1,f2,f3 are very\nsparsely populated ternary polynomials.",null,null],[3,"PrivPoly","","Private polynomial, can be ternary or product-form",null,null],[3,"PrivateKey","","NtruEncrypt private key",null,null],[3,"PublicKey","","NtruEncrypt public key",null,null],[3,"KeyPair","","NtruEncrypt key pair",null,null],[4,"Error","","The error enum",null,null],[13,"OutOfMemory","","Out of memory error.",0,null],[13,"Prng","","Error in the random number generator.",0,null],[13,"MessageTooLong","","Message is too long.",0,null],[13,"InvalidMaxLength","","Invalid maximum length.",0,null],[13,"Md0Violation","","MD0 violation.",0,null],[13,"NoZeroPad","","No zero pad.",0,null],[13,"InvalidEncoding","","Invalid encoding of the message.",0,null],[13,"NullArgument","","Null argument.",0,null],[13,"UnknownParamSet","","Unknown parameter set.",0,null],[13,"InvalidParam","","Invalid parameter.",0,null],[13,"InvalidKey","","Invalid key.",0,null],[17,"MAX_DEGREE","","Max N value for all param sets; +1 for ntru_invert_...()",null,null],[17,"MAX_ONES","","max(df1, df2, df3, dg)",null,null],[11,"default","","",1,{"inputs":[],"output":{"name":"intpoly"}}],[11,"clone","","",1,null],[11,"add","","",1,null],[11,"sub","","",1,null],[11,"fmt","","",1,null],[11,"eq","","",1,null],[11,"new","","Create a new IntPoly",1,null],[11,"rand","","Create a new random IntPoly",1,{"inputs":[{"name":"u16"},{"name":"u16"},{"name":"randcontext"}],"output":{"name":"intpoly"}}],[11,"from_arr","","Convert array to IntPoly",1,null],[11,"get_coeffs","","Get the coefficients",1,null],[11,"set_coeffs","","Set the coefficients",1,null],[11,"set_coeff","","Set a coefficient",1,null],[11,"mod_mask","","Modifies the IntPoly with the given mask",1,null],[11,"to_arr","","Converts the IntPoly to a byte array using 32 bit arithmetic",1,null],[11,"mult_tern","","General polynomial by ternary polynomial multiplication",1,null],[11,"add_tern","","Add a ternary polynomial",1,null],[11,"mult_prod","","General polynomial by product-form polynomial multiplication",1,null],[11,"mult_priv","","General polynomial by private polynomial multiplication",1,null],[11,"mult_int","","General polynomial by general polynomial multiplication",1,null],[11,"mult_fac","","Multiply by factor",1,null],[11,"mod_center","","",1,null],[11,"mod3","","",1,null],[11,"equals_mod","","Check if both polynomials are equals given a modulus",1,null],[11,"equals1","","Check if the IntPoly equals 1",1,null],[11,"default","","",2,{"inputs":[],"output":{"name":"ternpoly"}}],[11,"clone","","",2,null],[11,"fmt","","",2,null],[11,"eq","","",2,null],[11,"new","","Creates a new TernPoly",2,null],[11,"get_n","","Get the",2,null],[11,"get_ones","","Get +1 coefficients",2,null],[11,"get_neg_ones","","Get -1 coefficients",2,null],[11,"to_int_poly","","Ternary to general integer polynomial",2,null],[11,"clone","","",3,null],[11,"eq","","",3,null],[11,"ne","","",3,null],[11,"fmt","","",3,null],[11,"default","","",3,{"inputs":[],"output":{"name":"prodpoly"}}],[11,"new","","Creates a new `ProdPoly` from three `TernPoly`s",3,{"inputs":[{"name":"u16"},{"name":"ternpoly"},{"name":"ternpoly"},{"name":"ternpoly"}],"output":{"name":"prodpoly"}}],[11,"rand","","Random product-form polynomial",3,{"inputs":[{"name":"u16"},{"name":"u16"},{"name":"u16"},{"name":"u16"},{"name":"u16"},{"name":"randcontext"}],"output":{"name":"option"}}],[11,"to_int_poly","","Returns an IntPoly equivalent to the ProdPoly",3,null],[11,"clone","","",4,null],[11,"default","","",4,{"inputs":[],"output":{"name":"privpoly"}}],[11,"fmt","","",4,null],[11,"eq","","",4,null],[11,"new_with_prod_poly","","Create a new PrivPoly with a ProdPoly",4,{"inputs":[{"name":"prodpoly"}],"output":{"name":"privpoly"}}],[11,"new_with_tern_poly","","Create a new PrivPoly with a TernPoly",4,{"inputs":[{"name":"ternpoly"}],"output":{"name":"privpoly"}}],[11,"is_product","","If the PrivPoly contains a ProdPoly",4,null],[11,"get_poly_prod","","Get the ProdPoly of the union",4,null],[11,"get_poly_tern","","Get the TernPoly of the union",4,null],[11,"invert","","Inverse modulo q",4,null],[11,"clone","","",5,null],[11,"eq","","",5,null],[11,"ne","","",5,null],[11,"fmt","","",5,null],[11,"default","","",5,{"inputs":[],"output":{"name":"privatekey"}}],[11,"get_q","","Gets the q parameter of the PrivateKey",5,null],[11,"get_t","","Gets the tparameter of the PrivateKey",5,null],[11,"get_params","","Get params from the private key",5,null],[11,"import","","Import private key",5,null],[11,"export","","Export private key",5,null],[11,"clone","","",6,null],[11,"eq","","",6,null],[11,"ne","","",6,null],[11,"fmt","","",6,null],[11,"default","","",6,{"inputs":[],"output":{"name":"publickey"}}],[11,"get_q","","Get the q parameter of the PublicKey",6,null],[11,"get_h","","Get the h parameter of the PublicKey",6,null],[11,"import","","Import a public key",6,null],[11,"export","","Export public key",6,null],[11,"clone","","",7,null],[11,"eq","","",7,null],[11,"ne","","",7,null],[11,"fmt","","",7,null],[11,"default","","",7,{"inputs":[],"output":{"name":"keypair"}}],[11,"new","","Generate a new key pair",7,{"inputs":[{"name":"privatekey"},{"name":"publickey"}],"output":{"name":"keypair"}}],[11,"get_params","","Get params from the key pair",7,null],[11,"get_private","","The private key",7,null],[11,"get_public","","The public key",7,null],[11,"clone","","",0,null],[11,"eq","","",0,null],[11,"fmt","","",0,null],[11,"fmt","","",0,null],[11,"from","","",0,{"inputs":[{"name":"uint8_t"}],"output":{"name":"error"}}],[11,"description","","",0,null],[0,"rand","ntru","Rand module",null,null],[3,"RandContext","ntru::rand","A random context for key generation and encryption",null,null],[3,"RandGen","","Random number generator",null,null],[5,"init","","Initialize a new rand context",null,{"inputs":[{"name":"randgen"}],"output":{"name":"result"}}],[5,"init_det","","Generate a new deterministic rand context",null,null],[5,"generate","","Generate random data",null,{"inputs":[{"name":"u16"},{"name":"randcontext"}],"output":{"name":"result"}}],[17,"RNG_DEVURANDOM","","Unix default RNG, /dev/urandom",null,null],[17,"RNG_DEVRANDOM","","Unix RNG, /dev/random",null,null],[17,"RNG_DEFAULT","","Default RNG",null,null],[17,"RNG_CTR_DRBG","","Deterministic RNG based on CTR_DRBG",null,null],[11,"default","","",8,{"inputs":[],"output":{"name":"randcontext"}}],[11,"drop","","",8,null],[11,"get_c_rand_ctx","","Gets the native struct representing the RandContext",8,null],[11,"get_seed","","Gets the seed for the RandContext",8,null],[11,"get_rng","","Gets the RNG of the RandContext",8,null],[11,"init","","Initialize a new random contex",9,null],[11,"generate","","Generate random data",9,null],[11,"rand","ntru::types","Random ternary polynomial",2,{"inputs":[{"name":"u16"},{"name":"u16"},{"name":"u16"},{"name":"randcontext"}],"output":{"name":"option"}}],[0,"encparams","ntru","NTRUEncrypt Encryption parameters",null,null],[3,"EncParams","ntru::encparams","A set of parameters for NtruEncrypt",null,null],[17,"EES401EP1","","An IEEE 1361.1 parameter set that gives 112 bits of security and is optimized for key size.",null,null],[17,"EES449EP1","","An IEEE 1361.1 parameter set that gives 128 bits of security and is optimized for key size.",null,null],[17,"EES677EP1","","An IEEE 1361.1 parameter set that gives 192 bits of security and is optimized for key size.",null,null],[17,"EES1087EP2","","An IEEE 1361.1 parameter set that gives 256 bits of security and is optimized for key size.",null,null],[17,"EES541EP1","","An IEEE 1361.1 parameter set that gives 112 bits of security and is a tradeoff between key size\nand encryption/decryption speed.",null,null],[17,"EES613EP1","","An IEEE 1361.1 parameter set that gives 128 bits of security and is a tradeoff between key\nsize and encryption/decryption speed.",null,null],[17,"EES887EP1","","An IEEE 1361.1 parameter set that gives 192 bits of security and is a tradeoff between key size\nand encryption/decryption speed.",null,null],[17,"EES1171EP1","","An IEEE 1361.1 parameter set that gives 256 bits of security and is a tradeoff between key size\nand encryption/decryption speed.",null,null],[17,"EES659EP1","","An IEEE 1361.1 parameter set that gives 112 bits of security and is optimized for\nencryption/decryption speed.",null,null],[17,"EES761EP1","","An IEEE 1361.1 parameter set that gives 128 bits of security and is optimized for\nencryption/decryption speed.",null,null],[17,"EES1087EP1","","An IEEE 1361.1 parameter set that gives 192 bits of security and is optimized for\nencryption/decryption speed.",null,null],[17,"EES1499EP1","","An IEEE 1361.1 parameter set that gives 256 bits of security and is optimized for\nencryption/decryption speed.",null,null],[17,"EES401EP2","","A product-form parameter set that gives 112 bits of security.",null,null],[17,"EES439EP1","","**DEPRECATED** A product-form parameter set that gives 128 bits of security.",null,null],[17,"EES443EP1","","A product-form parameter set that gives 128 bits of security.",null,null],[17,"EES593EP1","","**DEPRECATED** A product-form parameter set that gives 192 bits of security.",null,null],[17,"EES587EP1","","A product-form parameter set that gives 192 bits of security.",null,null],[17,"EES743EP1","","A product-form parameter set that gives 256 bits of security.",null,null],[17,"DEFAULT_PARAMS_112_BITS","","The default parameter set for 112 bits of security.",null,null],[17,"DEFAULT_PARAMS_128_BITS","","The default parameter set for 128 bits of security.",null,null],[17,"DEFAULT_PARAMS_192_BITS","","The default parameter set for 192 bits of security.",null,null],[17,"DEFAULT_PARAMS_256_BITS","","The default parameter set for 256 bits of security.",null,null],[17,"ALL_PARAM_SETS","","All parameter sets, in an array",null,null],[11,"default","","",10,{"inputs":[],"output":{"name":"encparams"}}],[11,"eq","","",10,null],[11,"fmt","","",10,null],[11,"get_name","","Get the name of the parameter set",10,null],[11,"get_n","","Get the number of polynomial coefficients",10,null],[11,"get_q","","Get the modulus",10,null],[11,"get_db","","Get the number of random bits to prepend to the message",10,null],[11,"max_msg_len","","Maximum message length",10,null],[11,"enc_len","","Encryption length",10,null],[11,"public_len","","Public key length",10,null],[11,"private_len","","Private key length",10,null]],"paths":[[4,"Error"],[3,"IntPoly"],[3,"TernPoly"],[3,"ProdPoly"],[3,"PrivPoly"],[3,"PrivateKey"],[3,"PublicKey"],[3,"KeyPair"],[3,"RandContext"],[3,"RandGen"],[3,"EncParams"]]}; initSearch(searchIndex);