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

version» Context lines:

pike.git/lib/modules/Crypto.pmod/RSA.pike:175: Inside #if constant(Gmp) && constant(Gmp.mpz) && constant(Crypto.Hash)
  //! Pads the @[digest] with @[rsa_pad] type 1 and signs it.   Gmp.mpz raw_sign(string digest)   {    return rsa_pad(digest, 1, 0)->powm(d, n);   }      //! Signs @[digest] as @[raw_sign] and returns the signature as a byte   //! string.   string cooked_sign(string digest)   { -  return raw_sign(digest)->digits(256); +  string sign = raw_sign(digest)->digits(256); +  while( sizeof(sign) < size ) +  sign = "\0"+sign; +  return sign;   }      //! Verifies the @[digest] against the signature @[s], assuming pad   //! type 1.   //! @seealso   //! @[rsa_pad], @[raw_sign]   int(0..1) raw_verify(string digest, Gmp.mpz s)   {    return s->powm(e, n) == rsa_pad(digest, 1, 0);   }