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.3 2004/02/04 21:37:09 nilsson Exp $ + /* $Id: RSA.pike,v 1.4 2004/02/05 19:21:15 nilsson Exp $    *    * Follow the PKCS#1 standard for padding and encryption.    */      #pike __REAL_VERSION__   #pragma strict_types      #if constant(Gmp.mpz)      static Gmp.mpz n; /* modulo */
pike.git/lib/modules/Crypto.pmod/RSA.pike:227: Inside #if constant(Gmp.mpz)
  int(0..1) verify(string msg, .Hash h, Gmp.mpz sign)   {    string s = Standards.PKCS.Signature.build_digestinfo(msg, h);    return raw_verify(s, sign);   }      //! @fixme   //! Document this function.   string sha_sign(string message, mixed|void r)   { -  string s = Crypto.SHA.hash(message); +  string s = Crypto.SHA1.hash(message);    s = sprintf("%c%s%c%s", 4, "sha1", sizeof(s), s);    return cooked_sign(s);   }      //! @fixme   //! Document this function.   int sha_verify(string message, string signature)   { -  string s = Crypto.SHA.hash(message); +  string s = Crypto.SHA1.hash(message);    s = sprintf("%c%s%c%s", 4, "sha1", sizeof(s), s);    return raw_verify(s, Gmp.mpz(signature, 256));   }      //! @fixme   //! Document this function.   string md5_sign(string message, mixed|void r)   {    string s = Crypto.MD5.hash(message);    s = "0 0\14\6\10*\x86H\x86\xf7\15\2\5\5\0\4\20"+s;