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

version» Context lines:

pike.git/lib/modules/Crypto.pmod/DSA.pmod:375:       /* The inner %q's are redundant, as g^q == y^q == 1 (mod p) */    return r == (g->powm( [object(Gmp.mpz)](w * h % q), p) *    y->powm( [object(Gmp.mpz)](w * r % q), p) % p) % q;    }       int(0..) key_size()    {    return p->size();    } -  -  // -  // --- Deprecated stuff -  // -  -  //! Make a RSA ref signature of message @[msg]. -  __deprecated__ string(8bit) sign_rsaref(string(8bit) msg) -  { -  [Gmp.mpz r, Gmp.mpz s] = raw_sign(hash(msg, .SHA1)); -  -  return sprintf("%'\0'20s%'\0'20s", r->digits(256), s->digits(256)); +    }    -  //! Verify a RSA ref signature @[s] of message @[msg]. -  __deprecated__ int(0..1) verify_rsaref(string(8bit) msg, string(8bit) s) -  { -  if (sizeof(s) != 40) -  return 0; -  -  return raw_verify(hash(msg, .SHA1), -  Gmp.mpz(s[..19], 256), -  Gmp.mpz(s[20..], 256)); -  } -  -  //! Make an SSL signature of message @[msg]. -  __deprecated__ string(8bit) sign_ssl(string(8bit) msg) -  { -  return pkcs_sign(msg, .SHA1); -  } -  -  //! Verify an SSL signature @[s] of message @[msg]. -  __deprecated__ int(0..1) verify_ssl(string(8bit) msg, string(8bit) s) -  { -  return pkcs_verify(msg, .SHA1, s); -  } -  - } -  +    //! Calling `() will return a @[State] object.   protected State `()()   {    return State();   }