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

version» Context lines:

pike.git/lib/modules/Crypto.pmod/RSA.pike:232: Inside #if constant(Gmp) && constant(Gmp.mpz) && constant(Crypto.Hash)
  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.SHA1->hash(message); -  s = sprintf("%c%s%c%s", 4, "sha1", sizeof(s), s); +  string s = sprintf("%c%s%1H", 4, "sha1", Crypto.SHA1->hash(message));    return cooked_sign(s);r;   }      //! @fixme   //! Document this function.   int sha_verify(string message, string signature)   { -  string s = Crypto.SHA1->hash(message); -  s = sprintf("%c%s%c%s", 4, "sha1", sizeof(s), s); +  string s = sprintf("%c%s%1H", 4, "sha1", Crypto.SHA1->hash(message));    return raw_verify(s, Gmp.mpz(signature, 256));   }      // Broken implementation of RSA/MD5 SIG RFC 2537. The 0x00 01 FF* 00   // prefix is missing.      // (RSA/SHA-1 SIG is in RFC 3110)      string md5_sign(string message, mixed|void r)   {