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

version» Context lines:

pike.git/lib/modules/Crypto.pmod/RSA.pike:215: Inside #if constant(Crypto.Hash)
      set_public_key(mod, pub);    set_private_key(gs[1], ({ p, q }));       } while (!raw_verify(msg, raw_sign(msg)));    return this;   }      #endif    + #if WORKING_VARIANT   //! Compatibility with Pike 7.8.   variant __deprecated__ this_program generate_key(int(128..) bits,    function(int:string(8bit)) rnd)   {    function(int:string(8bit)) old_rnd = random;    random = rnd;    this_program res = generate_key(bits);    random = old_rnd;    return res;   } -  + #endif      //   // --- PKCS methods   //      #define Sequence Standards.ASN1.Types.Sequence      //! Calls @[Standards.PKCS.RSA.signatue_algorithm_id] with the   //! provided @[hash].   Sequence pkcs_algorithm_id(.Hash hash)
pike.git/lib/modules/Crypto.pmod/RSA.pike:473: Inside #if constant(Crypto.MD5)
  {    string(8bit) s = Crypto.MD5->hash(message);    s = "0 0\14\6\10*\x86H\x86\xf7\15\2\5\5\0\4\20"+s;    return raw_verify(s, Gmp.mpz(signature, 256));   }      #endif      __deprecated__ string(8bit) sha_sign(string(8bit) message, mixed|void r)   { -  string(8bit) s = [string(8bit)]sprintf("%c%s%1H", 4, "sha1", -  Crypto.SHA1->hash(message)); +  string(8bit) s = sprintf("%c%s%1H", 4, "sha1", Crypto.SHA1->hash(message));    return raw_sign(s)->digits(256);r;   }      __deprecated__ int sha_verify(string(8bit) message, string(8bit) signature)   { -  string(8bit) s = [string(8bit)]sprintf("%c%s%1H", 4, "sha1", -  Crypto.SHA1->hash(message)); +  string(8bit) s = sprintf("%c%s%1H", 4, "sha1", Crypto.SHA1->hash(message));    return raw_verify(s, Gmp.mpz(signature, 256));   }      __deprecated__ Gmp.mpz sign(string(8bit) message, .Hash h)   {    return raw_sign(Standards.PKCS.Signature.build_digestinfo(message, h));   }      __deprecated__ int(0..1) verify(string(8bit) message, .Hash h, Gmp.mpz sign)   {    return raw_verify(Standards.PKCS.Signature.build_digestinfo(message, h), sign);   }      #else   constant this_program_does_not_exist=1;   #endif