pike.git / lib / modules / Crypto.pmod / DH.pmod

version» Context lines:

pike.git/lib/modules/Crypto.pmod/DH.pmod:1: + #pike __REAL_VERSION__ + #pragma strict_types +  +    //!   //! Diffie-Hellman key-exchange related stuff.   //!      //! Diffie-Hellman parameters.   class Parameters   {   #if constant(Nettle.DH_Params)    inherit Nettle.DH_Params;   #else
pike.git/lib/modules/Crypto.pmod/DH.pmod:83:    //! The prime for the group.    //!    //! @param g    //! The generator for the group. Defaults to @expr{2@}.    //!    //! @param q    //! The order of the group. Defaults to @expr{(p-1)/2@}.    protected variant void create(Gmp.mpz|int p, Gmp.mpz|int|void g,    Gmp.mpz|int|void q)    { -  this_program::p = p; -  this_program::g = g || Gmp.mpz(2); -  this_program::q = q || (p-1)/2; +  this_program::p = Gmp.mpz(p); +  this_program::g = g && Gmp.mpz(g) || Gmp.mpz(2); +  this_program::q = q && Gmp.mpz(q) || Gmp.mpz( [int](p-1)/2 );    }   }      //! MODP Group 1 (768 bit) (aka First Oakley Group (aka ORM96 group 1)).   //!   //! RFC 2409 6.1   //!   //! @note   //! Not allowed for use with FIPS 140.   Parameters MODPGroup1 =