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

version» Context lines:

pike.git/lib/modules/Crypto.pmod/RSA.pike:203:   //! argument.   Sequence pkcs_public_key()   {    return [object(Sequence)]Standards.PKCS.RSA->build_public_key(this);   }      #undef Sequence      //! Signs the @[message] with a PKCS-1 signature using hash algorithm   //! @[h]. - Gmp.mpz sign(string message, .Hash h) + string pkcs_sign(string message, .Hash h)   { -  return raw_sign(Standards.PKCS.Signature.build_digestinfo(message, h)); +  string di = Standards.PKCS.Signature.build_digestinfo(message, h); +  return raw_sign(di)->digits(256);   }      //! Verify PKCS-1 signature @[sign] of message @[message] using hash   //! algorithm @[h]. - int(0..1) verify(string message, .Hash h, Gmp.mpz sign) + int(0..1) pkcs_verify(string message, .Hash h, string sign)   {    string s = Standards.PKCS.Signature.build_digestinfo(message, h); -  return raw_verify(s, sign); +  return raw_verify(s, Gmp.mpz(sign, 256));   }      //   // --- Encryption/decryption   //      //! Pads the message @[s] with @[rsa_pad] type 2, signs it and returns   //! the signature as a byte string.   //! @param r   //! Optional random function to be passed down to @[rsa_pad].