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

version» Context lines:

pike.git/lib/modules/Crypto.pmod/RSA.pike:1: - /* $Id: RSA.pike,v 1.10 2008/05/09 02:20:24 nilsson Exp $ + /* $Id: RSA.pike,v 1.11 2008/06/28 16:36:54 nilsson Exp $    *    * Follow the PKCS#1 standard for padding and encryption.    */      #pike __REAL_VERSION__   #pragma strict_types      #if constant(Gmp) && constant(Gmp.mpz) && constant(Crypto.Hash)    - static Gmp.mpz n; /* modulo */ - static Gmp.mpz e; /* public exponent */ - static Gmp.mpz d; /* private exponent (if known) */ - static int size; + protected Gmp.mpz n; /* modulo */ + protected Gmp.mpz e; /* public exponent */ + protected Gmp.mpz d; /* private exponent (if known) */ + protected int size;      /* Extra info associated with a private key. Not currently used. */    - static Gmp.mpz p; - static Gmp.mpz q; + protected Gmp.mpz p; + protected Gmp.mpz q;      //! Returns the RSA modulo (n).   Gmp.mpz get_n()   {    return n;   }      //! Returns the RSA public exponent (e).   Gmp.mpz get_e()   {
pike.git/lib/modules/Crypto.pmod/RSA.pike:333: Inside #if constant(Gmp) && constant(Gmp.mpz) && constant(Crypto.Hash)
   set_private_key(gs[1], ({ p, q }));       } while (!sha_verify(msg, sha_sign(msg, r)));    return this;   }      /*    * Block cipher compatibility.    */    - static int encrypt_mode; // For block cipher compatible functions + protected int encrypt_mode; // For block cipher compatible functions      //! Sets the public key to @[key] and the mode to encryption.   //! @seealso   //! @[set_decrypt_key], @[crypt]   this_program set_encrypt_key(array(Gmp.mpz) key)   {    set_public_key(key[0], key[1]);    encrypt_mode = 1;    return this;   }
pike.git/lib/modules/Crypto.pmod/RSA.pike:372: Inside #if constant(Gmp) && constant(Gmp.mpz) && constant(Crypto.Hash)
  }      //! Returns the string @expr{"RSA"@}.   string name() {    return "RSA";   }      #else   constant this_program_does_not_exist=1;   #endif +